Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot retrieve some articles by ID #58

Open
EuniceB opened this issue Jul 14, 2021 · 2 comments
Open

Cannot retrieve some articles by ID #58

EuniceB opened this issue Jul 14, 2021 · 2 comments

Comments

@EuniceB
Copy link

EuniceB commented Jul 14, 2021

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 by fq=_id=(just the hash part) and for most articles it works (not for this one though)
@nyt-hughmandeville
Copy link
Collaborator

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
Copy link
Author

EuniceB commented Jul 17, 2021

Yes, using quotes worked. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants