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

Cannot retrieve some articles by ID #58

Open EuniceB opened 3 years ago

EuniceB commented 3 years ago

There seems to be an issue with retrieving some articles by ID.

Example: Ask for a page of news:

https://api.nytimes.com/svc/search/v2/articlesearch.json?fl=_id,headline,document_type&api-key=...&page=0

and the API returns

{"status":"OK", "copyright":"Copyright (c) 2021 The New York Times Company. All Rights Reserved.", "response":{ "docs":[{"headline":{"main":"Why Are There More Successful Older Golfers Today?","kicker":null,"content_kicker":null,"print_headline":"Defying age, and winning","name":null,"seo":null,"sub":null}"document_type":"article","_id":"nyt://article/bcfb380a-cf66-5d37-ab93-052af2759d94"},...], "meta":{"hits":13610,"offset":0,"time":9}}}

So the id is bcfb380a-cf66-5d37-ab93-052af2759d94. But when I try to get the article information: https://api.nytimes.com/svc/search/v2/articlesearch.json?fq=_id%3Dbcfb380a-cf66-5d37-ab93-052af2759d94 The API returns 0 documents: {"status":"OK","copyright":"Copyright (c) 2021 The New York Times Company. All Rights Reserved.","response":{"docs":[],"meta":{"hits":0,"offset":0,"time":4}}}

Notes:

nyt-hughmandeville commented 3 years ago

Try fq=uri:"nyt://article/bcfb380a-cf66-5d37-ab93-052af2759d94".

articlesearch.json?fq=uri%3A%22nyt%3A%2F%2Farticle%2Fbcfb380a-cf66-5d37-ab93-052af2759d94%22
EuniceB commented 3 years ago

Yes, using quotes worked. Thank you!