public_api_specs
public_api_specs copied to clipboard
Cannot retrieve some articles by ID
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:
- This does not happen in all articles, some return the document just fine
- I know that the full ID of an article is
nyt://article/(hash)
but in this page I could query byfq=_id=(just the hash part)
and for most articles it works (not for this one though)
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
Yes, using quotes worked. Thank you!