وثائق API
ادمج تحويل كشوف الحسابات المصرفية في تطبيقاتك
مجموعة Postman
استورد مجموعتنا لاختبار API بسرعة
المصادقة
تتطلب جميع طلبات API المصادقة باستخدام مفتاح API. ضمّن مفتاح API الخاص بك في ترويسة Authorization:
Authorization: Bearer uk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
نقاط النهاية
POST
/api/v1/extract
ارفع كشف حساب مصرفي بصيغة PDF أو صورة للمعالجة.
الطلب
| المعامل | النوع | الوصف |
|---|---|---|
| file مطلوب | file | صيغة PDF أو JPG أو PNG أو أي صيغة صورة مدعومة أخرى |
curl -X POST https://uaestatementconverter.com/api/v1/extract \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@statement.pdf"
import requests
response = requests.post(
"https://uaestatementconverter.com/api/v1/extract",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file": open("statement.pdf", "rb")}
)
data = response.json()
file_id = data["file_id"]
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch('https://uaestatementconverter.com/api/v1/extract', {
method: 'POST',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
body: formData
});
const data = await response.json();
const fileId = data.file_id;
الاستجابة
{
"success": true,
"file_id": "doc_abc123...",
"original_name": "statement.pdf",
"page_count": 5,
"status": "processing"
}
GET
/api/v1/status
تحقق من حالة معالجة مستند مرفوع. استعلم عن نقطة النهاية هذه حتى تصبح الحالة "completed".
الطلب
| المعامل | النوع | الوصف |
|---|---|---|
| file_id مطلوب | string | قيمة file_id المُعادة من نقطة نهاية الرفع |
curl "https://uaestatementconverter.com/api/v1/status?file_id=doc_abc123" \ -H "Authorization: Bearer YOUR_API_KEY"
import requests
import time
while True:
response = requests.get(
"https://uaestatementconverter.com/api/v1/status",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"file_id": file_id}
)
data = response.json()
if data["status"] == "completed":
break
time.sleep(2) # Poll every 2 seconds
async function waitForCompletion(fileId) {
while (true) {
const response = await fetch(
`https://uaestatementconverter.com/api/v1/status?file_id=${fileId}`,
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
if (data.status === 'completed') return data;
await new Promise(r => setTimeout(r, 2000));
}
}
الاستجابة
{
"success": true,
"file_id": "doc_abc123...",
"status": "completed",
"page_count": 5,
"transaction_count": 47
}
GET
/api/v1/download
نزّل المعاملات المستخرجة بالصيغة التي تفضّلها.
الطلب
| المعامل | النوع | الوصف |
|---|---|---|
| file_id مطلوب | string | قيمة file_id المُعادة من نقطة نهاية الرفع |
| format | string | صيغة الإخراج: json أو csv أو xlsx. الافتراضي: csv |
curl "https://uaestatementconverter.com/api/v1/download?file_id=doc_abc123&format=json" \ -H "Authorization: Bearer YOUR_API_KEY"
response = requests.get(
"https://uaestatementconverter.com/api/v1/download",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"file_id": file_id, "format": "json"}
)
transactions = response.json()["transactions"]
const response = await fetch(
`https://uaestatementconverter.com/api/v1/download?file_id=${fileId}&format=json`,
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
);
const data = await response.json();
const transactions = data.transactions;
الاستجابة (بصيغة JSON)
{
"success": true,
"file_id": "doc_abc123...",
"transaction_count": 47,
"transactions": [
{
"date": "2024-01-15",
"type": "DEBIT",
"description": "TESCO STORES 1234",
"amountIn": null,
"amountOut": "45.67",
"balance": "1234.56"
}
]
}
GET
/api/v1/user
احصل على معلومات حسابك والحصة المتبقية.
curl "https://uaestatementconverter.com/api/v1/user" \ -H "Authorization: Bearer YOUR_API_KEY"
response = requests.get(
"https://uaestatementconverter.com/api/v1/user",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
quota = response.json()["quota"]
print(f"Pages remaining: {quota['remaining']}")
الاستجابة
{
"success": true,
"email": "user@example.com",
"plan": "professional",
"credits": 50,
"quota": {
"used": 150,
"limit": 400,
"remaining": 250,
"period": "month"
}
}
معالجة الأخطاء
تُعيد جميع الأخطاء استجابة JSON تحتوي على success: false ورسالة خطأ:
{
"success": false,
"error": "Invalid or missing API key",
"hint": "Provide your API key in the Authorization header"
}
رموز حالة HTTP
| الرمز | الوصف |
|---|---|
| 200 | نجاح |
| 400 | طلب غير صالح (معاملات غير صحيحة) |
| 401 | غير مُصرَّح (مفتاح API غير صالح أو مفقود) |
| 403 | محظور (غير مُصرَّح بالوصول إلى المورد) |
| 404 | غير موجود |
| 429 | تم تجاوز الحصة |
| 500 | خطأ في الخادم |
حدود المعدّل
يخضع استخدام API لحصة الصفحات الخاصة بخطتك. تُحتسب كل صفحة تُعالَج ضمن حدّك:
| الخطة | الصفحات | الفترة |
|---|---|---|
| مجانية | 5 صفحات | يوميًا |
| احترافية | 400 صفحة | شهريًا |
| أعمال | 1,000 صفحة | شهريًا |
| مؤسسات | 2,000 صفحة | شهريًا |
تحقق من حصتك المتبقية باستخدام نقطة النهاية /api/v1/user.