Queries the Ensembl genome database REST API across 250+ species for gene lookups, sequence retrieval, variant analysis, comparative genomics, orthologs, and VEP annotations. Useful for genomic research workflows.
Access and query the Ensembl genome database, a comprehensive resource for vertebrate genomic data maintained by EMBL-EBI. The database provides gene annotations, sequences, variants, regulatory information, and comparative genomics data for over 250 species. The classic REST API serves release 116 (released 9 June 2026; GET /info/software → {"release": 116}).
Heads-up (verified 2026-09-23): Release 116 is the final release on the classic platform. https://rest.ensembl.org (and grch37.rest.ensembl.org) stay online with no announced sunset date but receive no further data updates; the classic website lives on as the archive https://jun2026.archive.ensembl.org. New data now appear on the new Ensembl platform at https://www.ensembl.org (formerly beta.ensembl.org, 5,200+ genomes), whose programmatic access is GraphQL (POST https://www.ensembl.org/data/graphql) plus GA4GH refget for sequences. The REST API documented here still works and is the simplest route for GRCh38/GRCh37 human work; use GraphQL for genomes or annotation updates added after release 116, and plan migration for long-lived pipelines.
This skill should be used when:
| Scenario | Use Instead |
|---|---|
| NCBI Gene records, RefSeq accessions, Entrez gene IDs | alterlab-gene-db |
| Population allele frequencies / constraint (gnomAD v4) | alterlab-gnomad |
| Clinical significance of a variant (ClinVar) | alterlab-clinvar |
| Raw reads or assemblies by ENA/SRA accession | alterlab-ena |
| Quick one-liner gene lookups from a CLI | alterlab-gget |
| Protein function, domains, PTMs or the curated UniProtKB entry | alterlab-uniprot |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-gene-db) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
Query gene data by symbol, Ensembl ID, or external database identifiers.
Common operations:
Using the ensembl_rest package:
from ensembl_rest import EnsemblClient
client = EnsemblClient()
# Look up gene by symbol
gene_data = client.symbol_lookup(
species='human',
symbol='BRCA2'
)
# Get detailed gene information (method is lookup, NOT lookup_id)
gene_info = client.lookup(
'ENSG00000139618', # BRCA2 Ensembl ID
expand=True
)
Direct REST API (no package):
import requests
server = "https://rest.ensembl.org"
# Symbol lookup
response = requests.get(
f"{server}/lookup/symbol/homo_sapiens/BRCA2",
headers={"Content-Type": "application/json"}
)
gene_data = response.json()
Fetch genomic, transcript, or protein sequences in various formats (JSON, FASTA, plain text).
Operations:
Example:
# Using ensembl_rest package
sequence = client.sequence_id(
id='ENSG00000139618', # Gene ID
content_type='application/json'
)
# Get sequence for a genomic region
region_seq = client.sequence_region(
species='human',
region='7:140424943-140624564' # chromosome:start-end
)
Query genetic variation data and predict variant consequences using the Variant Effect Predictor (VEP).
Capabilities:
VEP example:
# Predict variant consequences (GET variant is vep_hgvs_get; POST batch is vep_hgvs_post)
vep_result = client.vep_hgvs_get(
species='human',
hgvs_notation='ENST00000380152.7:c.803C>T'
)
# Query variant by rsID
variant = client.variation_id(
species='human',
id='rs699'
)
Perform cross-species comparisons to identify orthologs, paralogs, and evolutionary relationships.
Operations:
Example:
import requests
# Find orthologs for a human gene. The species segment is required:
# GET /homology/id/:species/:id (the old /homology/id/:id path now returns 404,
# and so does ensembl_rest's homology_ensemblgene(), which still calls it).
orthologs = requests.get(
"https://rest.ensembl.org/homology/id/human/ENSG00000139618", # Human BRCA2
params={"target_species": "mouse", "type": "orthologues", "format": "condensed"},
headers={"Content-Type": "application/json"},
timeout=60,
).json()
# -> data[0]["homologies"][0]["id"] == "ENSMUSG00000041147" (ortholog_one2one)
# Get gene tree (GET /genetree/member/symbol/:species/:symbol; large and slow)
gene_tree = client.genetree_member_symbol(
species='human',
symbol='BRCA2'
)
Find all genomic features (genes, transcripts, regulatory elements) in a specific region.
Use cases:
Example:
# Find all features in a region
features = client.overlap_region(
species='human',
region='7:140424943-140624564',
feature='gene'
)
Convert coordinates between different genome assemblies (e.g., GRCh37 to GRCh38).
Important: Use https://grch37.rest.ensembl.org for GRCh37/hg19 queries and https://rest.ensembl.org for current assemblies.
Example:
from ensembl_rest import AssemblyMapper
# Map coordinates from GRCh37 to GRCh38.
# AssemblyMapper prefetches the whole-assembly mapping on init (slow once,
# then fast for repeated point lookups). map() takes a single position.
mapper = AssemblyMapper(
from_assembly='GRCh37',
to_assembly='GRCh38',
species='human'
)
mapped_pos = mapper.map(chrom='7', pos=140453136)
# For one-off lookups, the direct REST endpoint is simpler:
# GET /map/human/GRCh37/7:140453136..140453136/GRCh38
The Ensembl REST API has rate limits. Follow these practices:
Retry-After header and waitAlways implement proper error handling:
import requests
import time
def query_ensembl(endpoint, params=None, max_retries=3):
server = "https://rest.ensembl.org"
headers = {"Content-Type": "application/json"}
for attempt in range(max_retries):
response = requests.get(
f"{server}{endpoint}",
headers=headers,
params=params
)
if response.status_code == 200:
return response.json()
elif response.status_code == 429:
# Rate limited - wait and retry
retry_after = int(response.headers.get('Retry-After', 1))
time.sleep(retry_after)
else:
response.raise_for_status()
raise Exception(f"Failed after {max_retries} attempts")
uv pip install 'ensembl_rest==0.3.4' # latest release: Oct 2023
The ensembl_rest package (Ad115/EnsemblRest) wraps the REST endpoints, but it is a thin, unmaintained-since-2023 wrapper. The bundled scripts/ensembl_query.py uses plain requests instead and is the recommended path — it adds rate limiting and retry handling the package lacks.
Method-naming gotcha: the package auto-generates each method name from the last segment of the endpoint's documentation URL, which is often reversed from the REST path. This trips people up:
| REST endpoint | EnsemblClient method |
|---|---|
GET /lookup/symbol/... | symbol_lookup |
GET /lookup/id/... | lookup (NOT lookup_id) |
GET /info/assembly/... | assembly_info (NOT info_assembly) |
GET /info/species | species |
GET /vep/:species/hgvs/... | vep_hgvs_get (POST batch: vep_hgvs_post) |
GET /sequence/id/... | sequence_id |
GET /homology/id/:species/:id | none that works — homology_ensemblgene calls the retired /homology/id/:id (404); use requests or homology_symbol |
When unsure, prefer the direct REST call — the path is unambiguous.
No installation needed - use standard HTTP libraries like requests:
uv pip install requests
api_endpoints.md: Comprehensive documentation of all 17 API endpoint categories with examples and parametersensembl_query.py: Reusable Python script for common Ensembl queries with built-in rate limiting and error handlingTo query available species and assemblies:
# List all available species (method is species, for GET /info/species)
species_list = client.species()
# Get assembly information for a species (method is assembly_info, for GET /info/assembly/:species)
assembly_info = client.assembly_info(species='human')
Common species identifiers:
homo_sapiens or humanmus_musculus or mousedanio_rerio or zebrafishdrosophila_melanogasterWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job