Attempting to retrieve JSON data from the New York Times API using a modified query. The query includes placeholders for sensitive information:
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" represents the secure API key that has been anonymized. "search_city_name" is where the search keyword should be inserted based on current understanding.
Issue: Regardless of the search term used, the query returns the same result. Query:
http://api.nytimes.com/svc/search/v2/articlesearch.json?q="search_city_name"&sort=newest&&api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
For instance, every attempt yields identical first object in response array:
_id: "553a537238f0d87fad3b3cd7"
abstract: null
blog: Array[0]
byline: Object
document_type: "article"
headline: Object
keywords: Array[1]
lead_paragraph: "Cokie Roberts’s “Capital Dames,” No. 10 on the hardcover nonfiction list, is about powerful women in Washington during the Civil War era."
multimedia: Array[2]
news_desk: "BookReview"
print_page: "26"
pub_date: "2015-05-03T00:00:00Z"
section_name: "Books"
snippet: "Cokie Roberts’s “Capital Dames,” No. 10 on the hardcover nonfiction list, is about powerful women in Washington during the Civil War era."
source: "The New York Times"
subsection_name: "Sunday Book Review"
type_of_material: "News"
web_url: "http://www.nytimes.com/2015/05/03/books/review/inside-the-list.html"
word_count: "480"
Update: Revised working version of the query:
"http://api.nytimes.com/svc/search/v2/articlesearch.json?q="+ city +"&&api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxx"