Closed mattmakesmaps closed 7 years ago
The responses from the Archive API can be pretty big (~20mb). Does your request have a timeout?
The Archive API is meant so you can build up your own database locally of NYT article metadata.
Hi and thanks for the quick response. My request doesn't have a timeout associated with it.
My workaround was basically to check if the response was a valid JSON object, and retry if not. Seems to be working fine.
Hello, and happy 4th of July ππΊπΈπ
I'm hacking on the Archive API, and am running into some behavior I wasn't expecting.
In my node script, I send two requests for two different month's worth of data, three seconds apart. I'm using the request-promise library to issue the requests. Sometimes these will complete successfully, but often they will not.
Specifically, the response will come back with a
200
status code, but the JSON body will be incomplete.I was able to replicate this behavior using Charles, making back-to-back queries for February 1985, over 30 seconds apart.
Here are gists representing the first complete response, and the second partial response.
My main questions are:
Thanks and please let me know if there are additional details I can provide.