Feed examples
Tips
|
|
-
To try these examples, supply your API key in the x-api-key request header; for example, using a web browser plug-in for submitting an HTTP request header.
-
To learn more about request syntax and parameters, see Feed and Supported query syntax.
|
|
|
|
Important
|
|
Make sure that your request is URL-encoded.
|
|
|
|
Getting a feed for a specific product ID
Initial feed request: https://api.ap.org/media/v/content/feed?q=productid:31989&include=*&page_size=50
All subsequent feed requests must use the next_page link or ETag from the previous feed response.
Tips
|
|
-
To minimize duplicate content and maintain optimal efficiency, we recommend combining all package/product IDs into a single request unless your workflow calls for querying specific products in separate batches. If you are querying by package ID, there is no need to query individual products within that package because by default, querying a package includes all products within the package.
-
Your API key might not have access to this product ID. To get product IDs for your API key, try https://api.ap.org/media/v/account/plans and look for entitlements.id values in the response. To learn more, see Account plans.
|
|
|
|
Getting a feed for multiple product IDs along with all available content metadata
The optional include=*
parameter is used to request all available content metadata fields (a predefined set of fields is returned by default).
Initial feed request:
https://api.ap.org/media/v/content/feed?q=productid:(30079+OR+31536)&include=*&page_size=50
All subsequent feed requests must use the next_page link or ETag from the previous feed response.
Getting a feed for all entitled content
Initial feed request:
https://api.ap.org/media/v/content/feed?include=*&page_size=50
All subsequent feed requests must use the next_page link or ETag from the previous feed response.
Getting a feed of content that matches a specific keyword
Initial feed request:
https://api.ap.org/media/v/content/feed?q=soccer&include=*&page_size=50
All subsequent feed requests must use the next_page link or ETag from the previous feed response.
Note
|
|
This is an example of a query-based feed, and no results will be returned on the initial feed call. When you follow the next_page links, you will receive any new content that matches your query.
|
|
|
|
Requesting content from a saved search feed created in AP Newsroom
-
For your account, get a list of saved searches (formerly "personal followed topics") for which a feed was created in AP Newsroom:
https://api.ap.org/media/v/account/followedtopics
-
Use the following request URL for the initial feed request:
https://api.ap.org/media/v/content/feed?q=followedtopicid:714600&include=*&page_size=50
All subsequent feed requests must use the next_page link or ETag from the previous feed response.
For more information, see Feed delivery of saved searches.