How do I Query the NPR Story API?

Feb 22, 2013

This post explains what a query is and how to use it with the NPR Story API.

A query can be thought of as a way of asking the API a question. The answer to that question can be returned in many forms. The grammar for these questions and answers is defined at api.npr.org.

On the api.npr.org page you'll find the Query Generator which can be used to help you narrow down your query criteria. This tool is especially useful for stations who are not Core Publisher clients as it allows a user to generate queries to the API through a graphical interface and see the results in a human-readable form.

One common way to query the NPR Story API is through an HTTP URL. For example, the following query will ask the API for a list of the headline stories from the npr.org homepage:

Example: http://api.npr.org/query?id=1002&dateType=story&output=HTML&apiKey=

<insert your key here>

Tags: