PRODUCTION REST API · v1

Build downloads with YTSave

Resolve a public media URL, select an exact format, create an asynchronous job and hand the signed result to your user. The same bounded production pipeline powers the YTSave website.

YTSaveClientJSON عبر HTTPSوظائف غير متزامنةوثائق التفويض المحددة النطاق
01

البداية السريعة

YTSave handles API host by first identifying support-activated credentials. It follows with an assigned tenant endpoint and keeps a server-only call path in view.

عنوان URL المستأجرhttps://ytsave.app
التوثيقX-API-Key: ys_live_…
نبذة عن العميلYTSaveClient
إصدار APIv1
# Available only after support activation
export YTSAVE_API_KEY="issued-after-review"

curl -X POST https://ytsave.app/v1/resolve \
  -H "X-API-Key: $YTSAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.youtube.com/watch?v=VIDEO_ID"}'

To explain Credential safety, YTSave separates server-side secret storage from no client bundle embedding. An evidence record gives no public logs or repositories its own place.

02

حل رابط

YTSave handles Resolve operation by first identifying source detection. It follows with formats from one submitted URL and keeps no invented outputs in view.

الوظائف/v1/resolveالنطاق: حل
الميداننوع المشروعالمطلوبوصف المشروع
urlعنوان URL HTTPSنعمصفحة وسائل الإعلام العامة أو المأذون بها لتحليل.
tenantسلسلةلانطاق المستأجر المخصص.عادة ما يتم حذفه.
{
  "success": true,
  "platform": "youtube",
  "title": "Example video",
  "formats": [
    {"id":"18","type":"video","quality":"360p","container":"mp4"}
  ],
  "cached": false
}

To explain Format identifier, YTSave separates the returned value unchanged from per-link availability. An evidence record gives no guessed quality label its own place.

03

إنشاء ومتابعة عمل التنزيل

For Job creation, YTSave begins with asynchronous preparation. Its evidence record pairs that with a short HTTP request and ends with bounded worker execution.

الوظائف/v1/jobsالنطاق: الوظائف
الميداننوع المشروعالمطلوبوصف المشروع
urlعنوان URL HTTPSنعمنفس المصدر المُطّبيع المقدم لحلّ.
format_idسلسلةنعممعرف دقيق من استجابة الحل.
tenantسلسلةلانطاق المستأجر المخصص.عادة ما يتم حذفه.
curl -X POST https://ytsave.app/v1/jobs \
  -H "X-API-Key: $YTSAVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.youtube.com/watch?v=VIDEO_ID","format_id":"18"}'
1202 مقبولةSave job_id.
2حالة الاستفتاءGET /v1/jobs/{job_id} with the same key.
3جاهزافتح عنوان URL للتنزيل الموقّع.
ألف - الحالةالمعنىإجراءات العملاء
queuedتم القبول في الطابور المحدود.استطلاع رأي مرة أخرى مع التراجع.
extractingتحديث البيانات الوصفية المصدر أو الطريق.واصلوا التصويت.
processingالتنزيل أو إعادة المزج أو الدمج.عرض تقدم الخادم.
readyتحميل موقع متاح.أرسل عنوان URL إلى المستخدم.
failedخطأ مهيكلة المحطة الطرفية.Read error_code. Retry only when advised.
expiredأزيل الناتج المؤقت.إنشاء وظيفة جديدة.
curl https://ytsave.app/v1/jobs/JOB_ID \
  -H "X-API-Key: $YTSAVE_API_KEY"

YTSave makes Job polling easy to scan. The page starts with one-second initial wait, moves to capped backoff, and clearly states temporary signed delivery.

04

الأخطاء المتوقعة

For Error contract, YTSave checks one non-2xx envelope before a support request ID. This evidence record also makes predictable client handling clear.

{
  "success": false,
  "error": {
    "code": "RATE_LIMITED",
    "category": "rate_limited",
    "message": "Too many requests. Please try again shortly.",
    "retryable": true,
    "details": {"retry_after_seconds": 20}
  },
  "request_id": "…"
}
بروتوكول نقل الملفات السريعالمعنى النموذجيالإجراء
400عنوان URL غير صحيح أو جسم أو تنسيق غير متاح.تصحيح الطلب.حل مرة أخرى للأشكال.
401مفتاح مفقود أو غير صالح أو منتهية الصلاحية أو ذات نطاق خاطئ.تحقق من وثائق الاعتماد على جانب الخادم.
403رفضت سياسة المستأجر أو المصدر الطلب.لا تتجاوز السياسة اتصل بالدعم.
404وظيفة غير معروفة أو منتهية الصلاحية.قم بإنشاء وظيفة جديدة إذا كان ذلك مناسبًا.
429طلب أو حد الوظائف النشطة تم الوصول إليه.Honor retry_after_seconds.
503الطابور / السعة أو أعلى المسار غير متاح مؤقتًا.حاول مرة أخرى مع التراجع الأسي والتذبذب.
05

عقد التشغيل

YTSave issues an operational quota with each approval to safeguard the API consumer and upstream media services.

YTSave handles Schema access by first identifying activation before exploration. It follows with assigned authentication and keeps documented request shapes in view. مرجع OpenAPI

الوصول الذي يستعرضه المشغل

Request your API key

Document the API consumer, its monthly request estimate and supported platform requirements. YTSave reviews whether resolve, job submission or both are justified before issuing a once-visible key.

Request API access المفاتيح هي مستأجر نطاق، قابل للإلغاء وإصدارها من خلال نموذج الاتصال لا يمكن للنصوص المجهولة تنفيذ عمل المُحمّل.