Example: UniProt Accession Lookup
Resolve a UniProtKB accession or entry name to a protein record — name, gene,
organism, function, sequence, and the Atlas protein_hash — via the UniProt REST
API (cached server-side).
Endpoint: GET /esm/protein/api/v1alpha1/uniprot/{uniprot_id}
Scope: UniProtKB accessions and entry names only (e.g. P24941, P53_HUMAN).
Other accession namespaces (UniParc UPI…, MGnify MGYP…, IMG, PDB, Ensembl) are
not supported and return 400.
Parameters
Parameter |
Type |
Description |
|---|---|---|
|
string (path) |
UniProtKB accession or entry name (e.g. |
curl
curl "https://biohub.ai/esm/protein/api/v1alpha1/uniprot/P24941"
Python
import httpx
response = httpx.get("https://biohub.ai/esm/protein/api/v1alpha1/uniprot/P24941")
record = response.json()
print(record["protein_name"], record["organism"])
print("hash:", record["protein_hash"])
Response
{
"accession": "P24941",
"protein_name": "Cyclin-dependent kinase 2",
"gene": "CDK2",
"organism": "Homo sapiens",
"function": "Serine/threonine-protein kinase involved in the control of the cell cycle...",
"sequence": "MENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIRLDTETEGVPSTAIREISLLKELNHPNIVKLLDVIHTENKLYLVFEFLHQDLKKFMDASALTGIPLPLIKSYLFQLLQGLAFCHSHRVLHRDLKPQNLLINTEGAIKLADFGLARAFGVPVRTYTHEVVTLWYRAPEILLGCKYYSTAVDIWSLGCIFAEMVTRRALFPGDSEIDQLFRIFRTLGTPDEVVWPGVTSMPDYKPSFPKWARQDFSKVVPPLDEDGRSLLSQMLHYDPNKRISAKAALAHPFFQDVTKPVPHLRL",
"protein_hash": "35b6d2d9f3fdbf93c112b7952fdb5d20",
"sequence_length": 298
}
The protein_hash is the Atlas content-address key (md5(sequence.upper())). Use
it to chain into the hash-keyed Atlas reads, e.g.
GET /esm/protein/api/v1alpha1/proteins/{protein_hash}.
To run a similarity search starting from a UniProt ID, chain these two calls:
GET /uniprot/{uniprot_id} to resolve the record, then pass the returned sequence
to GET /similarity-search?sequence=. Similarity search is sequence-only — it does
not accept a UniProt ID directly.
Malformed or non-UniProtKB ids return 400; a well-formed id with no UniProt entry
returns 404; an upstream UniProt failure returns 502.