v1

latestSwagger 2.02026-07-1422425.0 KB
stationfinder

List stations close to you or filter by search criteria

This endpoint has two main use cases:

  • If no query parameters passed in, it returns a list of stations that are geographically closest to the calling client (based on GeoIP information)
  • If one or more query parameters are passed in, it performs a search of NPR stations that match those search criteria (not taking into account the client's physical location)

Clients wanting to implement a 'Change Station' UI should use this endpoint to power their search. In most cases, you'll want to build a search interface that uses one of the 3 provided schemas: lat and lon (using e.g. the HTML5 Geolocation API), city and state, or the generic q query which can accept a station name, call letters, network name, or zip code. Technically speaking, q can also take in either a city name or a state name, but using the city and state parameters together will yield more accurate geographic search results than q={cityName}.

The lat and lon query parameters should always be passed in together (otherwise the API will return a 400 error), and if included in the query, they will take precedence over any other search criteria; that is, lat and lon will do a purely geographic search and not take into account q, city or state.

Similarly, city and/or state will take precedence over (and ignore) q.

If clients want to be able to offer multiple types of searches (e.g. 'Search for a station name, city or zipcode') using a single search input form, q should be used. But again, be aware that using city and state together will yield more accurate search results than q={cityName}.

get/v3/stations

Query parameters

qstring

Search terms to search on; can be a station name, network name, call letters, or zipcode

citystring

A city to look for stations from; intended to be paired with state

statestring

A state to look for stations from (using the 2-letter abbreviation); intended to be paired with city

latnumber float

A latitude value from a geographic coordinate system; only works if paired with lon

lonnumber float

A longitude value from a geographic coordinate system; only works if paired with lat

Headers

Authorizationstring required

Your access token from the Authorization Service. Should start with Bearer, followed by a space, followed by the token.

Response

A list of one or more stations matching the search query

errorsobject[] required

A list of encountered errors, ignored on POST, PUT

hrefstring required

A URL representation of the resource; should generally be ignored by clients unless noted otherwise

linksobject required

Not used

versionstring required

The version of the Collection.Doc+JSON spec being used

All 2 operations