Feed Examples

 

ON THIS PAGE      Show

 

 

 

 

 

  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.

 

 

 

How to get 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.

 

 

 

How to get 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.

How to get 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.

How to get 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.

 

 

 

How to request content from a personal Followed Topic feed that was created in AP Newsroom?

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.

In the sample URL above, 714600 is the desired personal Followed Topic ID. To obtain the Topic ID, make sure the Show personal topics only check box is selected on AP Newsroom's Manage Your Followed Topics page and move your mouse over the personal Followed Topic:

To learn more, see Feed Delivery of Personal Followed Topics.