Standard or Query-Based Feed?

AP Media API distinguishes between two types of feeds - standard and query-based.

 

  Important

 

When submitting your request, make sure that it is URL-encoded.

 

 

 

Standard Feed

A standard feed returns results on the initial request and may start anywhere in the past 72 hours. The standard feed request may specify zero or more product IDs and/or the mindate parameter; for example:

  • A specific product ID: /feed?q=productid:30079

  • A list of product IDs (separated by OR): /feed?q=productid:(30079+OR+31536)

  • All entitled content: /feed

  • Any of the above in conjunction with the mindate parameter to get a feed starting from a specific point in time during the past 72 hours; for example:

    • All entitled content starting from three days ago:

      /feed?q=mindate:>now-3d

    • A single product ID starting from one day ago:

      /feed?q=productid:30079+AND+mindate:>now-1d

    • Multiple product IDs starting from two days ago:

      /feed?q=productid:(30079+OR+31536)+AND+mindate:>now-2d

Query-Based Feed

A query-based feed refers to all of the other possible feed requests; for example:

/feed?q=soccer or /feed?q=productid:(30079+AND+31536)

A query-based feed returns content published only after the time of the initial request and typically returns zero results on the initial request.

Following the next request link returns content that was published since the time of the initial request of this keyword feed. For example, if you follow the next page link 30 seconds after your initial request, you will get the items matching your query that have been published in the last 30 seconds.

 

 

  Tips

 

  • We recommend using standard feed requests whenever possible. Query-based feeds can be useful when the content you are looking to ingest is very specific, but typically require more tweaking to achieve expected results.

  • Use Search to query for past content, even if that content was published a few minutes ago.

  • Before setting up a query-based feed, verify the results of your query using Search, and then formulate your feed request. Note that optional parameters supported by Search and Feed requests are not identical; for example, the sort search parameter is not supported for feeds. Therefore, only Search parameters common with Feed are transitioned over.

  • If you only want to update the latest content, use conditional GET requests.

 

 

 

There is a limit on the number of query-based feeds that you can create. If you exceed that limit, you will get the 409 Status Code - 6003 Detail Code error and will be asked to delete an existing feed by following one of the links returned in the queries.delete_and_continue_link properties in the error message: