DEV Community

bo zhang
bo zhang

Posted on AI-assisted

YouTube Video Downloader API: Parse Public URLs and Media Metadata with Python

YouTube Video Downloader API: Parse Public URLs and Media Metadata with Python

If your application needs to accept a public YouTube URL and turn it into structured media data, a focused API endpoint is usually easier to integrate than maintaining a scraper in every service. This guide shows a small Python integration for the Easydown YouTube API.

The examples assume a public single-video URL and a bearer token. The API is intended for developer integrations; the browser downloader is a separate free tool for individual use.

Endpoint and request format

Use the YouTube-specific endpoint when you want platform-aware data:

POST https://api.easydown.org/api/v1/platforms/youtube/parse
Authorization: Bearer YOUR_EASYDOWN_TOKEN
Content-Type: application/json

{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID"
}
Enter fullscreen mode Exit fullscreen mode

The request body accepts a public media URL. The compatibility field link can also be used, but url is the clearest option for new integrations.

A successful YouTube parse returns normalized media information together with full platform data. The exact response schema is documented in the YouTube API reference.

Python example

import os
import requests

API_URL = "https://api.easydown.org/api/v1/platforms/youtube/parse"
TOKEN = os.environ["EASYDOWN_API_TOKEN"]

response = requests.post(
    API_URL,
    headers={
        "Authorization": f"Bearer {TOKEN}",
        "Content-Type": "application/json",
    },
    json={"url": "https://www.youtube.com/watch?v=VIDEO_ID"},
    timeout=30,
)

response.raise_for_status()
data = response.json()
print(data)
Enter fullscreen mode Exit fullscreen mode

Keep the token in an environment variable or secret manager. Do not put it in browser JavaScript, a public repository, or a client-side mobile bundle.

Credits and error handling

A successful YouTube parse costs 3 credits. Authentication, permission, invalid URL, unsupported platform, balance, and temporary failure responses do not charge a credit according to the API definition. That makes it useful to separate client errors from retryable server errors:

  • Treat 4xx responses as input or account problems and show a useful message to the caller.
  • Retry 5xx responses with bounded exponential backoff.
  • Set a request timeout and log a request ID or your own correlation ID without logging the bearer token.

For an application that handles more than one platform, the normalized endpoint can be used instead:

POST https://api.easydown.org/api/v1/parse
Enter fullscreen mode Exit fullscreen mode

The unified endpoint applies platform-specific credit rules while keeping the request shape consistent.

When to use the API

This pattern works well for a product that needs to validate a submitted YouTube URL, show available media choices, or pass normalized metadata into a queue. It is designed for public single-post media URLs. Private content, profile scraping, bulk profile downloads, and live-page parsing are outside the documented scope.

See the unified API documentation for authentication, response schemas, and the other supported platforms. Current credit plans are listed on the API pricing page.

Disclosure: this article documents the Easydown API and links to its official developer documentation.

Top comments (0)