API¶
API methods¶
- GET /api/¶
Deprecated since version 0.1: Use GET /api/info instead.
Status Codes: - 301 – redirects to GET /api/info
- 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.
Warning
This is True by default for compatibility reasons, it will be changed in a future version.
Response Headers: - Content-Type – application/json
- Access-Control-Allow-Origin – *
Status Codes: - 200 – On success
- 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-Type – application/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.