التوثيق
البداية السريعة
سجّل، وأنشئ مفتاحًا، ونادِ أول مرة خلال خمس دقائق.
- 1.سجّل وتحقّق من بريدك.
- 2.أنشئ مفتاح API من لوحة التحكم — انسخه مرة واحدة.
- 3.نادِ /v1/read بعنوان — هذا تكامل شغّال.
يجلب عنوانًا ويرد النص المستخرج نظيفًا. يحاول الذاكرة المؤقتة أولًا ثم HTTP ثم متصفحًا معزولًا للصفحات كثيفة الجافاسكربت.
الطلب
| الحقل | النوع | الوصف | |
|---|---|---|---|
url | string | مطلوب | عنوان الصفحة المطلوب قراءتها (http/https). |
maxChars | integer | اختياري | سقف الأحرف المُعادة (الافتراضي 200,000). |
format | 'markdown' | 'text' | اختياري | صيغة الاستخراج — markdown تحفظ البنية، text نص مجرد. |
forceBrowser | boolean | اختياري | يتخطى محاولة HTTP ويصيّر مباشرة في المتصفح المعزول. |
مثال
curl -X POST https://agw.orcanox.xyz/v1/read \ -H "Authorization: Bearer agw_…" \ -H "Content-Type: application/json" \ -d '{"url":"https://example.com"}'
import requests r = requests.post("https://agw.orcanox.xyz/v1/read", headers={"Authorization": "Bearer agw_…"}, json={"url":"https://example.com"}) print(r.status_code, r.json())
const r = await fetch("https://agw.orcanox.xyz/v1/read", { method: "POST", headers: { "Authorization": "Bearer agw_…", "Content-Type": "application/json" }, body: JSON.stringify({"url":"https://example.com"}) }); console.log(r.status, await r.json());
الاستجابة
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 | مثال |
|---|---|---|
| 400 | bad_request | {"code":"bad_request","message":"invalid url"} |
| 502 | fetch_failed | {"code":"fetch_failed","message":"upstream returned 404"} |
| 504 | fetch_timeout | {"code":"fetch_timeout","message":"deadline exceeded"} |