API

API methods

GET /api/info

Get the video information

Query Parameters:
 
  • url – The video url
  • flatten (boolean) –

    If True return a list of dictionaries in the videos field. Otherwise a single dictionary will be returned in the info field.

    Changed in version NEXT: The default value is False.

    Deprecated since version NEXT: This parameter will be removed in a future version, you’ll have to implemenent this functionality in your client.

  • * – A whitelist of extra parameters are passed directly to the YoutubeDL object. Currently it supports: playlist_items, rejecttitle, playlistend, matchtitle, playliststart, playlistreverse, subtitleslangs, subtitlesformat, allsubtitles, writeautomaticsub, writesubtitles. See the youtube-dl documentation for more info
Response Headers:
 
  • Content-Typeapplication/json
  • Access-Control-Allow-Origin*
Status Codes:
  • 200 – On success
  • 400 – For invalid query parameters
  • 500 – If the extraction fails

Example request

GET /api/info?url=http://www.ted.com/talks/dan_dennett_on_our_consciousness.html&flatten=False HTTP/1.1

Example response

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json

{
  "info": {
    "description": "Philosopher Dan Dennett makes a compelling argument that not only don't we understand our own consciousness, but that half the time our brains are actively fooling us.",
    "display_id": "102",
    "ext": "mp4",
    "extractor": "TED",
    "extractor_key": "TED",
    "format": "high",
    "format_id": "high",
    "formats": [
      {
        "ext": "mp4",
        "format": "low",
        "format_id": "low",
        "preference": 1,
        "url": "..."
      },
      {
        "ext": "mp4",
        "format": "medium",
        "format_id": "medium",
        "preference": 2,
        "url": "...",
      },
      {
        "ext": "mp4",
        "format": "high",
        "format_id": "high",
        "preference": 3,
        "url": "..."
      }
    ],
    "id": "102",
    "playlist": null,
    "playlist_index": null,
    "preference": 3,
    "subtitles": null,
    "thumbnail": "http://images.ted.com/images/ted/488_480x360.jpg",
    "title": "The illusion of consciousness",
    "uploader": "Dan Dennett",
    "url": "...",
    "webpage_url": "http://www.ted.com/talks/dan_dennett_on_our_consciousness.html",
    "webpage_url_basename": "dan_dennett_on_our_consciousness.html"
  },
  "url": "http://www.ted.com/talks/dan_dennett_on_our_consciousness.html",
  "youtube-dl.version": "2014.03.12"
}

Example request

GET /api/info?url=http://www.ted.com/talks/dan_dennett_on_our_consciousness.html&flatten=True HTTP/1.1

Example response

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json

{
  "url": "http://www.ted.com/talks/dan_dennett_on_our_consciousness.html",
  "videos": [
    {
      "description": "Philosopher Dan Dennett makes a compelling argument that not only don't we understand our own consciousness, but that half the time our brains are actively fooling us.",
      "display_id": "102",
      "ext": "mp4",
      "extractor": "TED",
      "extractor_key": "TED",
      "format": "high",
      "format_id": "high",
      "formats": [
        {
          "ext": "mp4",
          "format": "low",
          "format_id": "low",
          "preference": 1,
          "url": "..."
        },
        {
          "ext": "mp4",
          "format": "medium",
          "format_id": "medium",
          "preference": 2,
          "url": "...",
        },
        {
          "ext": "mp4",
          "format": "high",
          "format_id": "high",
          "preference": 3,
          "url": "..."
        }
      ],
      "id": "102",
      "playlist": null,
      "playlist_index": null,
      "preference": 3,
      "subtitles": null,
      "thumbnail": "http://images.ted.com/images/ted/488_480x360.jpg",
      "title": "The illusion of consciousness",
      "uploader": "Dan Dennett",
      "url": "...",
      "webpage_url": "http://www.ted.com/talks/dan_dennett_on_our_consciousness.html",
      "webpage_url_basename": "dan_dennett_on_our_consciousness.html"
    }
  ],
  "youtube-dl.version": "2014.03.12"
}
GET /api/extractors

Get the available extractors

Response Headers:
 
  • Content-Typeapplication/json
  • Access-Control-Allow-Origin*
Status Codes:
  • 200 – On success

Example request

GET /api/extractors HTTP/1.1

Example response

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json

{
    "extractors": [
        {
            "name": "vimeo",
            "working": true
        },
        {
            "name": "TED",
            "working": true
        },
        ...
    ]

}

Test server

You can try the API by doing requests to http://youtube-dl.appspot.com.