# /sra/experiments

`POST /api/sra/experiments`

Price: 1 credit

Get an SRA sequencing experiment, with its runs, by accession or uid

## How to use it

Resolves one SRA experiment - a single sequencing library prepared from one sample - together with the runs produced from it. An SRR/ERR/DRR run accession also resolves, to the experiment that produced that run. A study (SRP) or sample (SRS) accession and a BioProject accession name many experiments rather than one, so they are rejected here; pass them to /sra/experiments/search as `accession`, which matches at any level. `runs` is commonly a single entry and can legitimately be empty, so do not read an empty list as a failed fetch. When `controlled_access_study` is set the reads sit behind dbGaP authorisation even though this metadata is public.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `id` (string, required) — SRA experiment accession (SRX, ERX or DRX), a run accession (SRR, ERR or DRR) which resolves to the experiment that produced it, or the numeric SRA uid (examples: "SRX1234567", "ERX16816445", "SRR2376830", "1780830"; minLength: 1)

## Response

### 200 — Successful Response

- `@type` (string) (default: "SraExperiment")
- `id` (string, required)
- `accession` (string) (default: "")
- `experiment_title` (string) (default: "")
- `name` (string) (default: "")
- `version` (string) (default: "")
- `status` (string) (default: "")
- `platform` (string) (default: "")
- `instrument_model` (string) (default: "")
- `run_count` (integer, nullable)
- `spot_count` (integer, nullable)
- `base_count` (integer, nullable)
- `size` (integer, nullable)
- `cluster_name` (string) (default: "")
- `is_load_done` (boolean) (default: false)
- `has_static_data` (boolean) (default: false)
- `has_filtered_data` (boolean) (default: false)
- `submitter_accession` (string) (default: "")
- `center_name` (string) (default: "")
- `contact_name` (string) (default: "")
- `lab_name` (string) (default: "")
- `study_accession` (string) (default: "")
- `study_title` (string) (default: "")
- `sample_accession` (string) (default: "")
- `sample_name` (string) (default: "")
- `organism` (string) (default: "")
- `common_name` (string) (default: "")
- `taxid` (string) (default: "")
- `bioproject_accession` (string) (default: "")
- `biosample_accession` (string) (default: "")
- `library_name` (string) (default: "")
- `library_strategy` (string) (default: "")
- `library_source` (string) (default: "")
- `library_selection` (string) (default: "")
- `library_layout` (string) (default: "")
- `library_construction_protocol` (string) (default: "")
- `nominal_length` (integer, nullable)
- `nominal_sdev` (number, nullable)
- `controlled_access_study` (string) (default: "")
- `controlled_access_consent` (string) (default: "")
- `runs` (array) (default: [])
  - `@type` (string) (default: "SraRun")
  - `accession` (string, required)
  - `spot_count` (integer, nullable)
  - `base_count` (integer, nullable)
  - `cluster_name` (string) (default: "")
  - `is_public` (boolean) (default: false)
  - `is_load_done` (boolean) (default: false)
  - `is_unavailable` (boolean) (default: false)
  - `has_static_data` (boolean) (default: false)
  - `has_filtered_data` (boolean) (default: false)
  - `url` (string) (default: "")
- `created_date` (string) (default: "")
- `updated_date` (string) (default: "")
- `url` (string) (default: "")

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

Experiment not found

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.

