canonical: https://jentic.com/apis/cov-spectrum.org/cov-spectrum

# CoV-Spectrum LAPIS API

The CoV-Spectrum LAPIS API is the open data backend behind cov-spectrum.org, exposing 40 endpoints for querying SARS-CoV-2 sequence and metadata aggregates. Endpoints cover aligned and unaligned nucleotide sequences, aligned amino acid sequences per gene, nucleotide and amino acid mutations and insertions, phylogenetic subtrees, most-recent common ancestor lookups, sample details and aggregations, and a generic /query/parse helper. The base URL is the open v2 LAPIS endpoint and no authentication is required, making it suitable for public health dashboards, research pipelines, and academic agents that need bulk SARS-CoV-2 surveillance data.

## For AI agents

Query SARS-CoV-2 sequence data, mutations, insertions, phylogenetic subtrees, and sample metadata from the open CoV-Spectrum LAPIS backend with no authentication.

## Scope

Does not provide patient-level clinical data, hospital outcomes, or non-SARS-CoV-2 pathogens - use for SARS-CoV-2 sequence and aggregate metadata queries only.

## Capabilities

- Retrieve aligned or unaligned nucleotide sequences for filtered samples
- Retrieve aligned amino acid sequences across all genes or by specific gene
- Pull nucleotide and amino acid mutations and insertions as CSV or JSON
- Generate phylogenetic subtrees in Newick format
- Find the most recent common ancestor for a sample selection
- Aggregate sample counts grouped by date, lineage, or country
- Look up sample-level details for filtered cohorts

## Use cases

### Variant Surveillance Dashboard

Power a public-facing or institutional SARS-CoV-2 variant tracker that shows lineage prevalence over time and geography. The /sample/aggregated endpoint returns counts grouped by date, country, or lineage, which is the core query a surveillance dashboard runs every few hours. Because the API is open, dashboards can run client-side without a credential proxy.

Example prompt: Call POST /sample/aggregated with a filter on country and a groupBy of pangoLineage and date to refresh a variant prevalence chart

### Genomic Research Pipeline

Pull aligned nucleotide and amino acid sequences for a defined sample cohort into a downstream phylogenetics or mutation-analysis pipeline. /sample/alignedNucleotideSequences returns the aligned sequences and /sample/alignedAminoAcidSequences/{gene} narrows to a specific gene such as Spike. Together with /sample/nucleotideMutations and /sample/aminoAcidMutations, an agent can prepare a clean dataset for analysis without manual export.

Example prompt: Call GET /sample/alignedAminoAcidSequences/S filtered to a date range, then GET /sample/aminoAcidMutations to pull the mutation set for the same cohort

### Phylogenetic Context Lookup

Place a sample or set of samples in their phylogenetic context by fetching a Newick subtree or the most recent common ancestor. /sample/phyloSubtree returns Newick text suitable for visualisation libraries, and /sample/mostRecentCommonAncestor returns the MRCA for a query selection. Useful for researchers writing case reports or evolutionary analyses.

Example prompt: Call POST /sample/phyloSubtree with a country and lineage filter, then render the returned Newick string in a tree viewer

### AI Agent Public Health Q&A

Let an AI agent answer epidemiological questions like 'how prevalent is XBB in Switzerland' by calling LAPIS through Jentic. The agent searches by intent, executes the matching aggregate or details query, and returns structured counts. Because LAPIS is open, no credential is needed but Jentic still standardises the request shape and response handling.

Example prompt: Use Jentic to search 'aggregate SARS-CoV-2 sample counts', load the schema for POST /sample/aggregated, and execute it with country and lineage filters

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /sample/aggregated | Aggregate sample counts grouped by fields |
| GET | /sample/details | List per-sample metadata for a filtered cohort |
| POST | /sample/nucleotideMutations | Get nucleotide mutations for a cohort |
| POST | /sample/aminoAcidMutations | Get amino acid mutations for a cohort |
| POST | /sample/alignedNucleotideSequences | Fetch aligned nucleotide sequences |
| GET | /sample/alignedAminoAcidSequences/{gene} | Fetch aligned amino acid sequences for a gene |
| POST | /sample/phyloSubtree | Get a phylogenetic subtree as Newick |
| POST | /sample/mostRecentCommonAncestor | Get the MRCA for a sample selection |

## Key resources

- **Sequences** — Aligned and unaligned nucleotide and amino acid sequences
- **Mutations** — Nucleotide and amino acid mutations and insertions for filtered cohorts
- **Phylogenetics** — Subtrees in Newick format and most-recent common ancestor lookups
- **Aggregation** — Sample counts grouped by date, country, or lineage
- **Details** — Per-sample metadata records for filtered queries
- **Query** — Helper to parse LAPIS query expressions

## Why Jentic

- **Setup:** Wiring the CoV-Spectrum LAPIS API by hand means coding your own aggregated and mutation queries against the open v2 host and shaping each filter yourself. Through Jentic you install once, import the CoV-Spectrum LAPIS API from the API Directory, and your agent calls it.
- **Permission scoping:** LAPIS is a read-only query surface with no resource id in the URL path, so scope by operation: limit the agent to the operations it needs, such as fetching aggregated sample counts or nucleotide mutations. You choose the operations it may call, so anything outside that set is not reachable unless you add it.
- **Credential handling:** The CoV-Spectrum open API takes no credential to call; Jentic still runs it through your own Jentic One instance so nothing sensitive enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'aggregate SARS-CoV-2 samples by variant' or 'list nucleotide mutations', and Jentic returns the matching CoV-Spectrum operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **NCBI Datasets API** — Reference genomes and bulk genomic data downloads from NCBI
- **Clinical Tables API** — Lookup of medical codes and conditions hosted by the NIH
- **NLM API** — National Library of Medicine reference data services

## FAQ

### What authentication does the CoV-Spectrum LAPIS API use?

The open LAPIS endpoint at https://lapis.cov-spectrum.org/open/v2 requires no authentication. All 40 endpoints are publicly accessible. When called via Jentic, no credential is provisioned for this API.

### Can I download aligned amino acid sequences for a specific gene?

Yes. GET /sample/alignedAminoAcidSequences/{gene} returns aligned amino acid sequences for the specified gene, for example /sample/alignedAminoAcidSequences/S for the Spike gene. Filter parameters narrow the cohort by date, country, or lineage.

### How do I aggregate sample counts by lineage?

POST /sample/aggregated with a `groupBy` parameter listing fields such as `pangoLineage` and `date`. The response is a JSON array of grouped counts, suitable for variant prevalence dashboards.

### What are the rate limits for the LAPIS API?

The open LAPIS instance is provided as a public research utility and does not advertise hard rate limits. Heavy users (large bulk sequence pulls or repeated multi-million-row aggregations) should batch requests and cache results to remain a good citizen on shared infrastructure.

### How do I get a phylogenetic subtree through Jentic?

Search Jentic for 'get a SARS-CoV-2 phylogenetic subtree', load the schema for POST /sample/phyloSubtree, and execute it with country and lineage filters. The response is a Newick string ready for tree-viewer libraries.

### Does the API include patient-level clinical data?

No. LAPIS exposes anonymised genomic and metadata fields like collection date, country, and lineage. It does not include patient identifiers, hospital outcomes, or individual case clinical data.

### Can I limit what my agent is allowed to do with the CoV-Spectrum LAPIS API?

Yes. Because you run Jentic One yourself, your own rules decide which CoV-Spectrum operations the agent may call, and LAPIS is a read-only query surface with no resource id in the URL, so you scope access by operation. You can allow only the operations the agent needs, such as POST /sample/aggregated for grouped sample counts or POST /sample/nucleotideMutations, and leave sequence pulls like POST /sample/alignedNucleotideSequences or the phylogenetic operations out of reach. Any operation you do not grant is not callable, so the agent stays inside the set you approve.
