Searching NPR API Content

Feb 27, 2013

Here's how you can search and browse NPR content from the API in Core Publisher.

NPR content is indexed when it's put into the API. Indexing is the practice of scanning and capturing parts of text that can later be searched. This allows API users to search content with keywords.

In Core Publisher the first step is to navigate to the "Get NPR Content" tab on the Find Content page. You can search using two options "Browse with filters" or "Find by URL or ID."

To browse with filters, you can enter any search criteria you would use with other internet search engines. Core Publisher will remember the most popular searches you have done and will display them below the search box as you start typing.

If you saw a post on NPR.org you can simply select "Find by URL or ID" and copy/paste the URL from NPR.org into the field in Core Publisher.  If you'd like to use ID, the ID in the URL would be a series of numbers.  For example, in this URL :

http://www.npr.org/blogs/thetwo-way/2014/12/02/366832916/nasa-prepares-to-test-new-spacecraft-that-youve-likely-never-heard-of

The ID would be 366832916.

After you choose a publish date, you will be able to see the story in the post form. You can locate the post in your home page river, if you automatically retrieve NPR content into your site. Or, you can locate it on the "Find Content" page.  There you can tag and categorize it as you choose as well as add related stories.  

If you're querying the NPR API directly through HTTP you can add "&searchTerm=" to your query to search through the API.

Example: http://api.npr.org/query?apiKey=<insert your key here>&searchTerm=nasa