Search 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 Search and Supported query syntax.
|
|
|
|
Important
|
|
Make sure that your request is URL-encoded.
|
|
|
|
Finding content from a specific calendar day
This search returns content for various media types; for example, text stories, pictures and video:
https://api.ap.org/media/v/content/search?q=versioncreated:2018-01-19&include=*&page_size=50
Finding text stories containing "Super Bowl" in the headline
https://api.ap.org/media/v/content/search?q=headline:"Super+Bowl"+AND+type:text&include=*&page_size=50
Searching for pictures of Emma Stone or stories about Ryan Gosling
https://api.ap.org/media/v/content/search?q=(type:picture+AND+"Emma+Stone")+OR+(type:text+AND+"Ryan+Gosling")&include=*&page_size=50
Finding text and video from a custom date range
https://api.ap.org/media/v/content/search?q=type:(text+OR+video)+AND+versioncreated:[2017-01-19+TO+2018-01-22]&include=*&page_size=50
Finding audio from the past two days
https://api.ap.org/media/v/content/search?q=type:audio+AND+versioncreated:>now-2d&include=*&page_size=50
Searching for the newest stories about technology
https://api.ap.org/media/v/content/search?q=type:text+AND+subject:Technology&sort=versioncreated:desc&include=*&page_size=50
Searching for AP-sourced pictures about an event on a specific day
https://api.ap.org/media/v/content/search?q=type:picture+AND+event:olympics+AND+firstcreated:2014-02-17+AND+source:AP&include=*&page_size=50
Searching using multiple categories
This search returns stories for either f
, i
or n
categories:
https://api.ap.org/media/v/content/search?q=type:text+AND+category:(f+OR+i+OR+n)&include=*&page_size=50
Finding content about hurricanes in the Gulf of Mexico, but not in Puerto Rico
Note that in this search, the optional include=*
parameter returns all available metadata including subject and geography classifications:
https://api.ap.org/media/v/content/search?q=subject:hurricanes+AND+geography:("Gulf+of+Mexico"+AND+NOT+"Puerto+Rico")&include=*&page_size=50
Getting video content with pricing
AP Media API always returns price tags required for charge acknowledgment on priced downloads. To receive additional pricing information (for example, formatted item price, use code and pricing message), use the pricing=true
parameter:
https://api.ap.org/media/v/content/search?q=type:video&pricing=true&include=*&page_size=50
To learn more, see Pricing.
https://api.ap.org/media/v/content/search?q=signals:newscontent&include=*&page_size=50
To learn more, see Identifying publishable content.
Excluding embargoed content from search results
https://api.ap.org/media/v/content/search?q=releasedatetime:<now&include=*&page_size=50
To learn more, see Identifying publishable content.