Resource Information
Method | GET |
---|---|
URL | https://public-api.wordpress.com/rest/v1.1/videos/$guid |
Requires authentication? | No |
Method Parameters
Parameter | Type | Description |
---|---|---|
$guid | (string) | The guid of the video |
Query Parameters
Parameter | Type | Description |
---|---|---|
context | (string) |
|
http_envelope | (bool) |
|
pretty | (bool) |
|
meta | (string) | Optional. Loads data from the endpoints found in the 'meta' part of the response. Comma-separated list. Example: meta=site,likes |
fields | (string) | Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title |
callback | (string) | An optional JSONP callback function. |
birth_month | (int) | The month the visitor was born |
birth_day | (int) | The day of the month the visitor was born |
birth_year | (int) | The year the visitor was born |
Response Parameters
Parameter | Type | Description |
---|---|---|
title | (string) | Title of the video |
description | (string) | Description of the video |
width | (int) | Width of the video |
height | (int) | Height of the video |
duration | (int) | The length of the video, in milliseconds |
display_embed | (bool) | Should the embed menu be shown? |
rating | (string) | The rating of the video |
poster | (string) | The URL of the video image |
original | (string) | The URL of the original video |
watermark | (string) | URL of a watermark logo |
bg_color | (string) | Custom background color |
files | (array) | List of video formats and the associated filenames |
file_url_base | (array) | List of protocols and the base needed for creating file URLs |
blog_id | (int) | Blog ID of the site where the video was uploaded |
post_id | (int) | Post ID of the video attachment post |
upload_date | (string) | Date the video was uploaded in ISO 8601 format |
finished | (bool) | Is video transcoding finished? |
files_status | (array) | Transcoding status for each video file format |
subtitles | (array) | Available subtitle formats with information for each language that is available |
Resource Errors
These are the possible errors returned by this endpoint.
HTTP Code | Error Identifier | Error Message |
---|---|---|
404 | unknown_media | The specified video was not found. |
400 | invalid_input | Please supply the birthdate parameters. |
Example
curl 'https://public-api.wordpress.com/rest/v1.1/videos/OO4thna8?birth_month=1&birth;_day=1&birth;_year=2000'
<?php $options = array ( 'http' => array ( 'ignore_errors' => true, ), ); $context = stream_context_create( $options ); $response = file_get_contents( 'https://public-api.wordpress.com/rest/v1.1/videos/OO4thna8?birth_month=1&birth_day=1&birth_year=2000', false, $context ); $response = json_decode( $response ); ?>
Response
{ "guid": "OO4thna8", "title": "VideoPress demo", "description": "VideoPress makes sharing your high-definition videos a breeze, and even features a built-in, one-click video podcast feed. Here are the details!", "width": 1280, "height": 720, "duration": 143755, "display_embed": true, "rating": "G", "poster": "https:\/\/videos.files.wordpress.com\/OO4thna8\/videopress2-web2_hd.original.jpg", "original": "https:\/\/videos.files.wordpress.com\/OO4thna8\/videopress2-web2.mov", "watermark": "https:\/\/wptv.files.wordpress.com\/2010\/07\/wptv.png", "bg_color": "", "files": { "hd": { "mp4": "videopress2-web2_hd.mp4", "original_img": "videopress2-web2_hd.original.jpg", "thumbnail_img": "videopress2-web2_hd.thumbnail.jpg" }, "dvd": { "mp4": "videopress2-web2_dvd.mp4", "original_img": "videopress2-web2_dvd.original.jpg", "thumbnail_img": "videopress2-web2_dvd.thumbnail.jpg" }, "std": { "mp4": "videopress2-web2.mp4", "original_img": "videopress2-web2.original.jpg", "thumbnail_img": "videopress2-web2.thumbnail.jpg", "ogg": "videopress2-web2_fmt1.ogv" } }, "file_url_base": { "http": "http:\/\/videos.videopress.com\/OO4thna8\/", "https": "https:\/\/videos.files.wordpress.com\/OO4thna8\/" }, "blog_id": 5089392, "post_id": 1913, "upload_date": "2009-05-18T17:25:49+0000", "finished": true, "files_status": { "hd": { "mp4": "DONE" }, "dvd": { "mp4": "DONE" }, "std": { "mp4": "DONE", "ogg": "DONE" } }, "subtitles": [] }