-
Notifications
You must be signed in to change notification settings - Fork 5
Platform API Reference
robdiciuccio edited this page May 31, 2011
·
2 revisions
The platform API is not enabled by default. To enable, set enable_api to true, in the configuration.
The platform API supports both JSON and XML responses. Response format will be determined by the extension used in the API call. For example, the following URL will return JSON data:
/api/v1/videos.json
- .json
- .xml
Parameters sent with all API calls
- page (integer, optional)
- Default: 1
- page_size (integer, optional)
- Results per page. Default: 16
Returned with all API responses
- status (object)
- text (string, possible values: "OK", "FAIL")
- message (string, descriptive status message)
- response_time (date)
- sort (string, if present in request and status=OK)
- paging (object, present only if status=OK)
- page (integer)
- pages (integer)
- page_size (integer)
- total_items (integer)
- topic (object)
- id (integer)
- name (string)
- url (string)
- description (string)
- entities (list of Linked Data Entity objects)
- entity (object)
- url (string)
- name (string)
- source (string)
- video (object)
- id (integer)
- name (string)
- url (string)
- duration (integer)
- description (string)
- publish_date (date YYYY-MM-DD HH:SS)
- thumbnail_url (string, width: 100px)
- thumbnail_url_lg (string, width: 480px)
- embed_code (string, HTML)
- transcript_text (string, returned only if return_transcript='true')
- topics (list of related Topic objects, returned only if return_topics='true')
- chapters (list of Chapter objects, returned only if return_chapters='true')
- chapter (object)
- id (integer)
- name (string)
- start_time (integer)
- thumbnail_url (string, 75px)
- thumbnail_url_lg (string, 400px)
- transcript_text (string, returned only if return_transcript='true')
- region (object)
- id (integer)
- name (string)
Return topic data
- featured (string)
- Return only featured topics. Possible values: "true", "false" (default: "false")
- sort (string)
- Possible values: "alpha", "newest", "popular" (default: "alpha")
- topics (list of Topic objects)
Return topic data for a specified topic
- topic (Topic object)
Return topics that match the text query.
- q (string)
- sort (string)
- Possible values: "relevance", "alpha", "newest", "popular" (default: "relevance")
- topics (list of Topic objects)
Return region data (no additional parameters)
- regions (list of Region objects)
Return region data for specified region (no additional parameters)
- region (Region object)
Return video data
- featured (string)
- Return only featured videos. Possible values: "true", "false" (default: "false")
- topics (list of topic IDs, comma separated)
- Each topic ID passed will narrow the result set (eg. "Water" AND "Education"). If no topics are passed, all videos will be returned.
- regions (list of region IDs, comma separated)
- Each region ID passed will narrow the result set (eg. "Africa" AND "Asia"). If no regions are passed, all videos will be returned.
- sort (string)
- Possible values: "relevance", "alpha", "newest" (default: "relevance")
- return_topics (string)
- Possible values: "true", "false" (default: "false")
- return_transcript (string)
- Possible values: "true", "false" (default: "false")
- return_chapters (string)
- Possible values: "true", "false" (default: "false")
- videos (list of Video objects)
Return video data for a specified video
- return_topics (string)
- Possible values: "true", "false" (default: "false")
- return_transcript (string)
- Possible values: "true", "false" (default: "false")
- return_chapters (string)
- Possible values: "true", "false" (default: "false")
- video (Video object)
Return video IDs based on search query
- q (string)
- sort (string)
- Possible values: "relevance", "alpha", "newest", "popular" (default: "relevance")
- videos (list of Video objects)