PRODUCTION REST API · v1

Build downloads with DWYT

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 DWYT website.

JSON over HTTPSAsynchronous jobsScoped API keysSigned downloads
01

Quick start

All production requests use the central API host https://web.ytsave.app or the assigned tenant host with an operator-issued credential.

Tenant URLhttps://dwyt.app
AuthenticationX-API-Key: ys_live_…
Content typeapplication/json
API versionv1
curl -X POST https://dwyt.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"}'

Keep the key on your server. Never place it in browser JavaScript, a mobile bundle, a public repository or a client-visible log.

02

Resolve a link

Detect the source and receive only formats actually returned for that exact public link.

POST/v1/resolveScope: resolve
FieldTypeRequiredDescription
urlHTTPS URLYesPublic or authorized media page to analyze.
tenantstringNoAssigned tenant domain. Usually omitted.
{
  "success": true,
  "platform": "youtube",
  "title": "Example video",
  "formats": [
    {"id":"18","type":"video","quality":"360p","container":"mp4"}
  ],
  "cached": false
}

Store the returned format.id unchanged. Do not invent quality identifiers: availability varies by link, source, region and current upstream response.

03

Create and follow a download job

Preparation is asynchronous so your HTTP worker never has to remain open while media is fetched or merged.

POST/v1/jobsScope: jobs
FieldTypeRequiredDescription
urlHTTPS URLYesThe same normalized source submitted to resolve.
format_idstringYesAn exact ID from the resolve response.
tenantstringNoAssigned tenant domain. Usually omitted.
curl -X POST https://dwyt.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 AcceptedSave job.id.
2Poll statusGET /v1/jobs/{job_id} with the same key.
3ReadyOpen the signed job.download_url.
StatusMeaningClient action
queuedAdmitted to the bounded queue.Poll again with backoff.
extractingRefreshing source metadata or route.Continue polling.
processingDownloading, remuxing or merging.Display server progress.
readySigned download is available.Send the URL to the user.
failedTerminal structured error.Read error_code; retry only when advised.
expiredTemporary output was removed.Create a new job.
curl https://dwyt.app/v1/jobs/JOB_ID \
  -H "X-API-Key: $YTSAVE_API_KEY"

Poll after 1 second, then use a capped 2–5 second backoff. Signed links and prepared files are temporary; download promptly and do not cache them as permanent media URLs.

04

Predictable errors

Non-2xx responses use one envelope with a request ID suitable for support.

{
  "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": "…"
}
HTTPTypical meaningAction
400Invalid URL, body or unavailable format.Correct the request; resolve again for formats.
401Missing, invalid, expired or wrong-scope key.Check the server-side credential.
403Tenant or source policy rejected the request.Do not bypass the policy; contact support.
404Unknown or expired job.Create a new job if appropriate.
429Request or active-job limit reached.Honor retry_after_seconds.
503Queue/capacity or upstream temporarily unavailable.Retry with exponential backoff and jitter.
05

Operational contract

Limits are assigned during review and protect both your integration and upstream platforms.

Machine-readable schemas and an interactive explorer are available in the OpenAPI reference. Authentication and assigned limits still apply there.

OPERATOR-REVIEWED ACCESS

Request your API key

Tell us your product, expected monthly volume, required platforms and whether you need analysis, jobs or both. After approval, the key is shown once and only its secure hash is retained.

Request API access Keys are tenant-scoped, revocable and issued through the Contact form. Anonymous scripts cannot execute downloader work.