# /genbank/assemblies/search

`POST /api/genbank/assemblies/search`

Price: 20 credits

List genome assemblies for an organism, with quality and completeness filters

## How to use it

Lists every genome assembly NCBI holds for an organism. `taxon` takes a taxonomy id, a scientific name or a common name interchangeably, and always includes the subtree below it - so a genus returns its species' assemblies too. Both archive copies of one assembly are separate rows unless you set `assembly_source`, which is usually what you want when counting genomes. `reference_only` narrows to the single designated reference and is the way to answer 'the' genome of a species. Only the current version of each assembly is listed unless `assembly_version` is set to all_assemblies; `search_text` is how you reach an assembly by its name, such as GRCh38.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `taxon` (string, required) — Organism to list assemblies for: an NCBI taxonomy id, a scientific name or a common name. The whole subtree below it is included (examples: "9606", "Homo sapiens", "human", "Escherichia coli", "562"; minLength: 1)
- `count` (integer, required) — Number of assemblies to return (min: 1; max: 5000)
- `search_text` (string, nullable) — Free-text match against the assembly name, accession, submitter and isolate, which is how a named assembly such as GRCh38 is reached (examples: "GRCh38", "T2T-CHM13")
- `assembly_version` (string, nullable) — Which versions to list: only the current version of each assembly, or every version including the superseded ones. Defaults to the current version (one of: "current", "all_assemblies")
- `assembly_levels` (array, nullable) — Filter by how finished the assembly is (any-of) (one of: "complete_genome", "chromosome", "scaffold", "contig")
- `assembly_source` (string, nullable) — Filter by which archive holds the assembly: the RefSeq copy, the GenBank copy, or both (one of: "refseq", "genbank", "all")
- `reference_only` (boolean) — Return only the reference assembly designated for the taxon (default: false)
- `has_annotation` (boolean) — Return only assemblies that carry a gene annotation (default: false)
- `exclude_atypical` (boolean) — Drop assemblies NCBI flagged as atypical for their taxon (default: false)
- `first_release_date` (string, nullable) — Return only assemblies first released on or after this date (YYYY-MM-DD) (examples: "2020-01-01")

## Response

### 200 — Successful Response

- `@type` (string) (default: "GenbankAssembly")
- `id` (string, required)
- `accession` (string) (default: "")
- `paired_accession` (string) (default: "")
- `source_database` (string) (default: "")
- `name` (string) (default: "")
- `description` (string) (default: "")
- `level` (string) (default: "")
- `status` (string) (default: "")
- `assembly_type` (string) (default: "")
- `diploid_role` (string) (default: "")
- `refseq_category` (string) (default: "")
- `synonym` (string) (default: "")
- `comments` (string) (default: "")
- `release_date` (string) (default: "")
- `submitter` (string) (default: "")
- `assembly_method` (string) (default: "")
- `sequencing_technique` (string) (default: "")
- `blast_url` (string) (default: "")
- `organism` (string) (default: "")
- `common_name` (string) (default: "")
- `taxid` (string) (default: "")
- `strain` (string) (default: "")
- `isolate` (string) (default: "")
- `cultivar` (string) (default: "")
- `ecotype` (string) (default: "")
- `breed` (string) (default: "")
- `sex` (string) (default: "")
- `is_atypical` (boolean) (default: false)
- `atypical_warnings` (array) (default: [])
- `genome_notes` (array) (default: [])
- `suppression_reason` (string) (default: "")
- `type_material` (string) (default: "")
- `type_material_label` (string) (default: "")
- `biosample_accession` (string) (default: "")
- `bioproject_accession` (string) (default: "")
- `bioprojects` (array) (default: [])
  - `@type` (string) (default: "GenbankAssemblyBioProject")
  - `accession` (string, required)
  - `project_title` (string) (default: "")
  - `parent_accessions` (array) (default: [])
- `paired_assembly` (object, nullable)
  - `@type` (string) (default: "GenbankPairedAssembly")
  - `accession` (string) (default: "")
  - `status` (string) (default: "")
  - `annotation_name` (string) (default: "")
  - `changed_components` (string) (default: "")
  - `is_different` (boolean) (default: false)
  - `differences` (string) (default: "")
  - `manual_diff` (string) (default: "")
  - `only_genbank` (string) (default: "")
  - `only_refseq` (string) (default: "")
- `linked_assemblies` (array) (default: [])
  - `@type` (string) (default: "GenbankLinkedAssembly")
  - `accession` (string, required)
  - `assembly_type` (string) (default: "")
- `stats` (object, nullable)
  - `@type` (string) (default: "GenbankAssemblyStats")
  - `total_sequence_length` (integer, nullable)
  - `total_ungapped_length` (integer, nullable)
  - `chromosome_count` (integer, nullable)
  - `contig_count` (integer, nullable)
  - `contig_n50` (integer, nullable)
  - `contig_l50` (integer, nullable)
  - `scaffold_count` (integer, nullable)
  - `scaffold_n50` (integer, nullable)
  - `scaffold_l50` (integer, nullable)
  - `gaps_between_scaffolds_count` (integer, nullable)
  - `component_sequence_count` (integer, nullable)
  - `organelle_count` (integer, nullable)
  - `atgc_count` (integer, nullable)
  - `gc_count` (integer, nullable)
  - `gc_percent` (number, nullable)
  - `genome_coverage` (string) (default: "")
- `annotation` (object, nullable)
  - `@type` (string) (default: "GenbankAssemblyAnnotation")
  - `name` (string) (default: "")
  - `provider` (string) (default: "")
  - `release_date` (string) (default: "")
  - `report_url` (string) (default: "")
  - `method` (string) (default: "")
  - `pipeline` (string) (default: "")
  - `software_version` (string) (default: "")
  - `status` (string) (default: "")
  - `gene_counts` (object, nullable)
    - `@type` (string) (default: "GenbankGeneCounts")
    - `total` (integer, nullable)
    - `protein_coding` (integer, nullable)
    - `non_coding` (integer, nullable)
    - `pseudogene` (integer, nullable)
    - `other` (integer, nullable)
  - `busco` (object, nullable)
    - `@type` (string) (default: "GenbankBusco")
    - `lineage` (string) (default: "")
    - `version` (string) (default: "")
    - `complete` (number, nullable)
    - `single_copy` (number, nullable)
    - `duplicated` (number, nullable)
    - `fragmented` (number, nullable)
    - `missing` (number, nullable)
    - `total_count` (integer, nullable)
- `organelles` (array) (default: [])
  - `@type` (string) (default: "GenbankOrganelle")
  - `description` (string, required)
  - `total_sequence_length` (integer, nullable)
  - `submitter` (string) (default: "")
- `average_nucleotide_identity` (object, nullable)
  - `@type` (string) (default: "GenbankAverageNucleotideIdentity")
  - `taxonomy_check_status` (string) (default: "")
  - `match_status` (string) (default: "")
  - `category` (string) (default: "")
  - `comment` (string) (default: "")
  - `submitted_organism` (string) (default: "")
  - `submitted_species` (string) (default: "")
  - `best_match` (object, nullable)
    - `@type` (string) (default: "GenbankAniMatch")
    - `assembly` (string) (default: "")
    - `organism_name` (string) (default: "")
    - `category` (string) (default: "")
    - `ani` (number, nullable)
    - `assembly_coverage` (number, nullable)
    - `type_assembly_coverage` (number, nullable)
  - `submitted_match` (object, nullable)
    - `@type` (string) (default: "GenbankAniMatch")
    - `assembly` (string) (default: "")
    - `organism_name` (string) (default: "")
    - `category` (string) (default: "")
    - `ani` (number, nullable)
    - `assembly_coverage` (number, nullable)
    - `type_assembly_coverage` (number, nullable)
- `checkm` (object, nullable)
  - `@type` (string) (default: "GenbankCheckm")
  - `version` (string) (default: "")
  - `marker_set` (string) (default: "")
  - `marker_set_rank` (string) (default: "")
  - `species_taxid` (string) (default: "")
  - `completeness` (number, nullable)
  - `completeness_percentile` (number, nullable)
  - `contamination` (number, nullable)
- `additional_submitters` (array) (default: [])
  - `@type` (string) (default: "GenbankAdditionalSubmitter")
  - `submitter` (string, required)
  - `chromosome_name` (string) (default: "")
  - `molecule_type` (string) (default: "")
  - `bioproject_accession` (string) (default: "")
  - `genbank_accession` (string) (default: "")
  - `refseq_accession` (string) (default: "")
- `wgs_project_accession` (string) (default: "")
- `wgs_master_url` (string) (default: "")
- `wgs_contigs_url` (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

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.

