curlencodingnyt-apisnyt-article-search-api

Receiving '403 Developer Inactive' when calling through Terminal, however I'm getting data through the browser


I am receiving the 403 Developer Inactive message when trying to use the New York Times article search API in the terminal, but I'm able to access the data in Chrome. This leads me to believe my call is correct and my API key is active, but clearly there's another problem.

In browser:

http://api.nytimes.com/svc/search/v2/articlesearch.json?q=new+york+times&page=2&sort=oldest&api-key=####

In terminal:

curl http://api.nytimes.com/svc/search/v2/articlesearch.json?q=new+york+times&page=2&sort=oldest&api-key=####

Solution

  • The terminal encodes characters differently than my browser, and the ampersand needed to be surrounded with double quotes in order to pass correctly.