# /npr/articles/search

`POST /api/npr/articles/search`

Price: 20 credits

Full-text search across the whole NPR archive — news stories, podcast episodes, journalist profiles, podcasts, broadcast shows, series, sections and blogs. Supports filtering by content kind, NPR program, topic, section, byline, producing organization, presence of broadcast audio and a publication date range, plus relevance, newest and oldest ordering.

## How to use it

Search npr.org. Give a query phrase, or leave it empty and browse with filters alone. Narrow with content_type (story, episode, person, podcast, show, series, topic, blog), program (an NPR broadcast show such as Morning Edition), topic, section, byline, source (NPR or a member station such as KQED), has_audio, and published_after/published_before as unix timestamps. Browse the undated entries — broadcast show pages (content_type=show), NPR+ tiles and standing section pages — without a date bound, since either bound drops them. sort accepts best_match, newest or oldest. Each result carries id, result_type, document_title, description, web_url, published_at, bylines, topics, image and audio metadata. Where id leads depends on result_type: for story and episode, id is usable in npr/articles; for person, id is usable in npr/authors. For show, id is a different NPR program identifier — look the program up in npr/programs by web_url instead. For podcast, series, topic and blog there is no matching detail endpoint; use web_url for those. The archive reaches back to the 1970s but a single search can page through at most 1000 results — narrow the filters or the date range to reach deeper.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `query` (string, nullable) — Full-text search phrase; omit it to browse the archive by filters only
- `count` (integer, required) — Max number of results to return (min: 1; max: 1000)
- `content_type` (string, nullable) — Restrict results to one kind of NPR page (one of: "story", "episode", "person", "podcast", "series", "topic", "blog", "show")
- `program` (string, nullable) — Restrict results to stories aired on one NPR program (one of: "All Things Considered", "Morning Edition", "Weekend Edition Saturday", "Weekend Edition Sunday", "Performance Today", "Fresh Air", "Talk of the Nation", "Day to Day", "Tell Me More", "Wait Wait...Don't Tell Me!", "News & Notes", "The Tavis Smiley Show", "The Bryant Park Project", "Ask Me Another", "The Motley Fool", "TED Radio Hour", "Special Coverage : Iraq", "Snap Judgment", "Science Friday", "Invisibilia", "Here & Now")
- `topic` (string, nullable) — Restrict results to one NPR topic (examples: "Environment", "Elections")
- `section` (string, nullable) — Restrict results to one NPR section (examples: "Politics", "Weather")
- `byline` (string, nullable) — Restrict results to one byline (examples: "Lauren Sommer")
- `source` (string, nullable) — Restrict results to one producing organization (examples: "NPR", "KQED")
- `has_audio` (boolean, nullable) — Restrict results to stories and podcast episodes by presence of on-demand audio; either value also drops people, podcasts, shows, series, topics and blogs, which carry no audio flag at all
- `published_after` (integer, nullable) — Only results published on or after this unix timestamp (day granularity); either bound also drops entries NPR publishes no date for — broadcast show pages, NPR+ tiles and standing section pages
- `published_before` (integer, nullable) — Only results published on or before this unix timestamp (day granularity); either bound also drops entries NPR publishes no date for — broadcast show pages, NPR+ tiles and standing section pages
- `sort` (string) — Result ordering (default: "best_match"; one of: "best_match", "newest", "oldest")

## Response

### 200 — Successful Response

- `@type` (string) (default: "NprSearchResult")
- `id` (string, required)
- `result_type` (string, required)
- `document_title` (string, required)
- `description` (string, nullable)
- `web_url` (string, nullable)
- `published_at` (integer, nullable)
- `last_modified_at` (integer, nullable)
- `indexed_at` (integer, nullable)
- `section` (string, nullable)
- `section_url` (string, nullable)
- `section_tag` (string, nullable)
- `shows` (array) (default: [])
  - `@type` (string) (default: "NprShowRef")
  - `id` (string, nullable)
  - `name` (string, required)
  - `image` (string, nullable)
  - `web_url` (string, nullable)
- `podcast` (object, nullable)
  - `@type` (string) (default: "NprShowRef")
  - `id` (string, nullable)
  - `name` (string, required)
  - `image` (string, nullable)
  - `web_url` (string, nullable)
- `topics` (array) (default: [])
- `series` (array) (default: [])
- `blogs` (array) (default: [])
- `bylines` (array) (default: [])
- `services` (array) (default: [])
  - `@type` (string) (default: "NprOrganization")
  - `id` (string, nullable)
  - `name` (string, required)
- `organizations` (array) (default: [])
  - `@type` (string) (default: "NprOrganization")
  - `id` (string, nullable)
  - `name` (string, required)
- `social_links` (array) (default: [])
  - `@type` (string) (default: "NprSocialLink")
  - `service` (string, required)
  - `handle` (string, nullable)
  - `url` (string, nullable)
- `collection_ids` (array) (default: [])
- `profile_ids` (array) (default: [])
- `audio_id` (string, nullable)
- `duration` (integer, nullable)
- `has_audio` (boolean) (default: false)
- `image` (string, nullable)
- `image_caption` (string, nullable)
- `image_credit` (string, nullable)
- `thumbnail` (string, nullable)
- `podcast_owner` (string, nullable)
- `feed_episode_title` (string, nullable)
- `window_title` (string, nullable)
- `job_title` (string, nullable)
- `access_level` (string, nullable)
- `is_explicit` (boolean) (default: false)
- `is_text_only` (boolean) (default: false)

## Errors

### 422 — Validation Error

The request body did not validate

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

The entity was not found, or a precondition failed

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

