التوثيق

POST /v1/read

POST /v1/read api-key · read #

يجلب عنوانًا ويرد النص المستخرج نظيفًا. يحاول الذاكرة المؤقتة أولًا ثم HTTP ثم متصفحًا معزولًا للصفحات كثيفة الجافاسكربت.

الطلب

الحقلالنوعالوصف
urlstringمطلوبعنوان الصفحة المطلوب قراءتها (http/https).
maxCharsintegerاختياريسقف الأحرف المُعادة (الافتراضي 200,000).
format'markdown' | 'text'اختياريصيغة الاستخراج — markdown تحفظ البنية، text نص مجرد.
forceBrowserbooleanاختيارييتخطى محاولة HTTP ويصيّر مباشرة في المتصفح المعزول.

مثال

curl -X POST https://agw.orcanox.xyz/v1/read \
  -H "Authorization: Bearer agw_…" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://example.com"}'

الاستجابة

json
{
  "url": "https://example.com",
  "finalUrl": "https://example.com/",
  "status": 200,
  "title": "Example Domain",
  "content": "This domain is for use in illustrative examples…",
  "contentType": "text/html; charset=UTF-8",
  "chars": 1256,
  "truncated": false,
  "blocks": 5,
  "linkCharsRatio": 0.12,
  "contentKind": "article",
  "fetchedVia": "http",
  "method": "http",
  "tookMs": 41,
  "renderReason": null,
  "cached": true,
  "latencyMs": 42
}

الأخطاء

الحالةcodeمثال
400bad_request{"code":"bad_request","message":"invalid url"}
502fetch_failed{"code":"fetch_failed","message":"upstream returned 404"}
504fetch_timeout{"code":"fetch_timeout","message":"deadline exceeded"}