---
title: "Fetch a gene's region from a genome"
method: POST
path: "/genome_region"
tags: ["Files & formats"]
---

# Fetch a gene's region from a genome

`POST /genome_region`

## Request

- Base URL: `https://seqbench.com/api/v1`
- URL: `https://seqbench.com/api/v1/genome_region`
- Auth: none required

Find a gene in an assembly by symbol or locus tag and return its sequence with however much flanking DNA you ask for — the step before designing a knockout, a C-terminal tag or an HDR donor, where you know the gene's name but not its coordinates. Give the assembly accession (GCF_000005845.2 for E. coli K-12 MG1655) and the gene (araC, or the locus tag b0064). `upstream` is upstream OF THE GENE: on a minus-strand gene that is the higher genomic coordinate, and the sequence comes back 5'→3' along the gene either way. Only an EXACT symbol or locus-tag match is used — NCBI's text search is fuzzy and ranks unrelated genes first, so a loose match is reported as a refusal naming what it found rather than answered with the wrong locus.

## Request body

- object
  - `assembly` string, required: Assembly accession, with its version — e.g. GCF_000005845.2. GCF_ (RefSeq) carries annotation more often than GCA_.
  - `gene` string, required: Gene symbol or locus tag, matched exactly and case-insensitively (araC, b0064).
  - `upstream` integer: Bases to include before the gene's 5' end (its promoter side).
  - `downstream` integer: Bases to include after the gene's 3' end.
  - `format` 'fasta' | 'genbank': GenBank brings the annotation that falls inside the region; FASTA is sequence only.

## Response `200`

Tool ran successfully.

- SuccessResponse: Standard success envelope returned by every single-tool call.
  - `ok` unknown, required
  - `tool` string, required: The tool slug that ran.
  - `result` object, required: Tool-specific output object. Its shape depends on the tool — call `GET /{tool}` or see the docs for each tool's fields.
  - `gate` GateResult
    - `pass` boolean, required: True if and only if every hard check passed.
    - `checks` GateCheck[], required
      - `id` string, required
      - `label` string, required
      - `severity` 'hard' | 'soft', required
      - `pass` boolean, required
      - `message` string, required
      - `value` number
      - `threshold` string
    - `notChecked` string[], required: Honest list of what this gate does NOT verify.
  - `provenance` Provenance, required
    - `apiVersion` string, required
    - `tool` union, required: Tool slug, or an array of slugs (one per step) for a workflow.
      - string
      - string[]
    - `generatedAt` string, date-time, required: ISO 8601 timestamp of when the result was generated.

## Other responses

- `400`: Invalid argument or the tool could not run.
- `404`: Unknown tool.
- `429`: Rate limited (metered tools only). Body carries code `rate_limited` and retryable `true`; honor the Retry-After header.
- `503`: A metered tool is momentarily at capacity. The identical request should succeed after Retry-After; body carries code `upstream_unavailable`.

---

[API](https://skmtc.dev/seqbench/apis/seqbench-api.md) · [All operations](https://skmtc.dev/seqbench/apis/seqbench-api/llms.txt) · [OpenAPI document](https://skmtc.dev/seqbench/apis/seqbench-api/revisions/132575216865?raw)
