nytimes / public_api_specs

The API Specs (in OpenAPI/Swagger) for the APIs available from developer.nytimes.com
http://developer.nytimes.com
Apache License 2.0
136 stars 40 forks source link

limit article search results? #19

Closed indefinitelee closed 8 years ago

indefinitelee commented 8 years ago

hi, is there a way to limit the number of articles returned from a query? I'd like to return only 10 articles from a given date (for example), or say 20 articles mentioning "Obama" within a data range.

Sorry if this is documented and I'm just not seeing it.

Thanks.

nyt-hughmandeville commented 8 years ago

Some APIs support query parameters limit and offset.

With the Article Search API, it always returns a max of 10 results. Use page=N to paginate thru results.

http://api.nytimes.com/svc/search/v2/articlesearch.json?q=obama&begin_date=20160901&end_date=20160930&page=0&api-key=

http://api.nytimes.com/svc/search/v2/articlesearch.json?q=obama&begin_date=20160901&end_date=20160930&page=1&api-key=