# /nasaads/papers/search

`POST /api/nasaads/papers/search`

Price: 20 credits

Search NASA ADS bibliographic records by an astronomy, physics or earth-science query, narrowed by publication year, document kind, subject collection, refereed or open-access status and citation count, and ordered by relevance, date, citations or readership

## How to use it

Search the NASA ADS literature index. `query` takes the ADS query language, so a bare phrase searches only the abstract (ADS's default field) and misses matches that exist only in the article body; prefix with body: or full: for full-text search, or with another field to target it — author:"Last, F", year:2020, bibstem:ApJ, doi:10.1000/xyz. Put author names and any phrase in double quotes, or the words are matched separately. The structured filters below are applied on top of `query` and are the reliable way to restrict year, document kind, subject collection, refereed and open-access status; `sort` is validated here, so an unlisted value is refused rather than silently ignored. Feed any returned `bibcode` to nasaads/papers or nasaads/papers/related.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `query` (string, required) — Search expression in the NASA ADS query language. Plain words match only the abstract (ADS's default field), not the article body; prefix a term with a field to target it, for example author:"Sagan, C", year:2020, bibstem:ApJ, title:exoplanet, or body:exoplanet / full:exoplanet to reach full-text search. (examples: "exoplanet atmosphere", "author:\"Sagan, C\"", "title:pulsar year:2020"; minLength: 1)
- `count` (integer, required) — Max number of papers to return (min: 1; max: 500)
- `sort` (string) — Field the results are ordered by (default: "relevance"; one of: "relevance", "date", "citation_count", "citation_count_normalized", "read_count", "first_author", "author_count", "indexed_at", "classic_factor", "bibcode")
- `sort_direction` (string) — Order of the sort field (default: "desc"; one of: "asc", "desc")
- `year_from` (integer, nullable) — Earliest publication year, inclusive (min: 1000)
- `year_to` (integer, nullable) — Latest publication year, inclusive (min: 1000)
- `doctype` (string, nullable) — Restrict to one kind of document (one of: "article", "eprint", "inproceedings", "inbook", "abstract", "book", "bookreview", "catalog", "circular", "erratum", "mastersthesis", "newsletter", "obituary", "phdthesis", "pressrelease", "proceedings", "proposal", "software", "talk", "techreport", "misc")
- `database` (string, nullable) — Restrict to one ADS subject collection (one of: "astronomy", "physics", "earthscience", "general")
- `refereed_only` (boolean) — Only papers published in a refereed venue (default: false)
- `open_access_only` (boolean) — Only papers with a freely readable full text (default: false)
- `min_citation_count` (integer, nullable) — Only papers cited at least this many times (min: 0)

## Response

### 200 — Successful Response

- `@type` (string) (default: "NasaadsPaper")
- `bibcode` (string, required)
- `url` (string, nullable)
- `abstract` (string, nullable)
- `authors` (array) (default: [])
- `first_author` (string, nullable)
- `author_count` (integer, nullable)
- `affiliations` (array) (default: [])
- `affiliation_ids` (array) (default: [])
- `emails` (array) (default: [])
- `orcids` (array) (default: [])
- `doi` (string, nullable)
- `arxiv_id` (string, nullable)
- `identifiers` (array) (default: [])
- `alternate_bibcodes` (array) (default: [])
- `keywords` (array) (default: [])
- `uat_concepts` (array) (default: [])
- `uat_concept_ids` (array) (default: [])
- `arxiv_categories` (array) (default: [])
- `publication` (string, nullable)
- `publication_raw` (string, nullable)
- `publication_codes` (array) (default: [])
- `publication_note` (string, nullable)
- `publisher` (string, nullable)
- `volume` (string, nullable)
- `issue` (string, nullable)
- `page` (string, nullable)
- `page_range` (string, nullable)
- `page_count` (integer, nullable)
- `electronic_id` (string, nullable)
- `issns` (array) (default: [])
- `isbns` (array) (default: [])
- `published_date` (string, nullable)
- `published_at` (string, nullable)
- `year` (integer, nullable)
- `doctype` (string, nullable)
- `databases` (array) (default: [])
- `record_flags` (array) (default: [])
- `esources` (array) (default: [])
- `data_sources` (array) (default: [])
- `bibgroups` (array) (default: [])
- `grants` (array) (default: [])
- `comments` (array) (default: [])
- `copyright` (string, nullable)
- `citation_count` (integer, nullable)
- `citation_count_normalized` (number, nullable)
- `reference_count` (integer, nullable)
- `read_count` (integer, nullable)
- `indexed_at` (string, nullable)

## 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.

