PhaRBP API
Read-only JSON over HTTP — no key or account needed.
Quick start
Most workflows are three steps.
Find proteins
Filter with /api/proteins/ and collect the IDs you need.
Fetch details
Look up sequences, domains and structures per sequence_hex_id.
# Tailspikes of E. coli phages, with host info curl "https://pharbp.bionetic.org/api/proteins/?protein=tailspike&host=coli&include=host&limit=50"
import requests url = "https://pharbp.bionetic.org/api/proteins/" params = {"protein": "tailspike", "host": "coli", "include": "host", "limit": 200} rows = [] while url: # follow "next" until the last page page = requests.get(url, params=params).json() rows += page["results"] url, params = page["next"], None print(len(rows), "proteins")
library(httr2) page <- request("https://pharbp.bionetic.org/api/proteins/") |> req_url_query(protein = "tailspike", host = "coli", limit = 200) |> req_perform() |> resp_body_json() page$count
{
"count": 76, "limit": 50, "offset": 0,
"next": ".../api/proteins/?...&offset=50", "previous": null,
"results": [{
"protein_id": "35bd8a03690e132d…",
"protein_name": "Bacteriophage P22 tailspike N-terminal domain-containing protein",
"source": "UniProt", "source_id": "A0A6B9X2A4",
"sequence_ids": ["8ad910445d5b6bbe…"],
"phage": { "name": "Escherichia phage sortsyn", "taxon_id": 2696447, "genus": "Murrayvirus" },
"hosts": [{ "name": "Escherichia coli K-12", "taxon_id": 83333 }]
}]
}
Identifiers
Two IDs, two levels. Pick the one that matches the data you want.
One protein record in one phage. Identical sequences in different genomes get different protein IDs. Use it for phage, host and genome context.
SHA-256 of the amino-acid sequence. Shared by all identical proteins. Use it for domains, properties and predicted structures. Equals the Sequence_ID column in exports.
Conventions
JSON everywhere
Errors return {"error": "…"} with a 4xx/5xx status code.
Pagination
limit (max 200) and offset; follow next until it is null.
Be gentle
Requests are rate-limited per IP. For the whole database, use a bulk release instead of paging.
Public set
Same data as the website: phage proteins only; prophages are not exposed.
Query
Filter the whole database and page through matching proteins.
GET/api/proteins/Filter by name, taxonomy, sequence properties, domains, structure, evidence and validation.
All filters combine with AND; text filters are case-insensitive substring matches. Every filter on the Export page works here too. Results include sequence_ids for the per-sequence endpoints.
proteinphagehostphage_genushost_familylen_min / len_maxdomainevidence_queryvalidation_tiervalidation_rbpseq2symminclude=host,validation,symmetrylimit (≤200)offsetcurl "https://pharbp.bionetic.org/api/proteins/?protein=tailspike&host=coli&include=host&limit=50"Sequences
Keyed by sequence_hex_id; shared by every protein with that exact sequence.
GET/api/sequence/<sequence_hex_id>/basic/Amino-acid sequence and physicochemical properties.
curl "https://pharbp.bionetic.org/api/sequence/8ad910445d5b6bbe28f2dea706fa18c5f6a191760320335079b5d3ae6eee488f/basic/"GET/api/sequence/<sequence_hex_id>/domains/Domain annotations with coordinates and InterPro fields.
curl "https://pharbp.bionetic.org/api/sequence/8ad910445d5b6bbe28f2dea706fa18c5f6a191760320335079b5d3ae6eee488f/domains/"GET/api/sequence/<sequence_hex_id>/proteins/All protein records carrying this sequence, across genomes.
curl "https://pharbp.bionetic.org/api/sequence/8ad910445d5b6bbe28f2dea706fa18c5f6a191760320335079b5d3ae6eee488f/proteins/"GET/api/sequence/<sequence_hex_id>/structure/Structures, evidence and metadata for the sequence, bundling its proteins.
curl "https://pharbp.bionetic.org/api/sequence/8ad910445d5b6bbe28f2dea706fa18c5f6a191760320335079b5d3ae6eee488f/structure/"Proteins
Keyed by protein_hex_id; one record per protein in one phage.
GET/api/protein/<protein_hex_id>/structure/Full record: metadata, structures, domains, phage/host, evidence, EC numbers.
curl "https://pharbp.bionetic.org/api/protein/35bd8a03690e132d73cf5a91986f25c2205c1b18201e7905efedf2513c23717a/structure/"GET/api/genome-context/<protein_hex_id>/Neighbouring genes around the protein in its genome.
curl "https://pharbp.bionetic.org/api/genome-context/35bd8a03690e132d73cf5a91986f25c2205c1b18201e7905efedf2513c23717a/"Similarity search
Submit a query, receive a query_id, then poll for hits.
POST/api/blastp/upload/BLASTP: send a sequence field or a fasta_file.
curl -X POST "https://pharbp.bionetic.org/api/blastp/upload/" -F "sequence=MKTFIFLALLGAAVAFPVSAQ..."GET/api/blastp/results/<query_id>/Status and hit list of a BLASTP job.
curl "https://pharbp.bionetic.org/api/blastp/results/<query_id>/"POST/api/foldseek/upload/FoldSeek: upload a pdb_file.
curl -X POST "https://pharbp.bionetic.org/api/foldseek/upload/" -F "[email protected]"
GET/api/foldseek/results/<query_id>/Status and hit list of a FoldSeek job.
curl "https://pharbp.bionetic.org/api/foldseek/results/<query_id>/"GET/api/foldseek/query-structure/<query_id>/The uploaded query structure as PDB text.
curl "https://pharbp.bionetic.org/api/foldseek/query-structure/<query_id>/"GET/api/foldseek/target-structure/<sequence_hex_id>/Structure of a hit, for alignment viewers.
curl "https://pharbp.bionetic.org/api/foldseek/target-structure/8ad910445d5b6bbe28f2dea706fa18c5f6a191760320335079b5d3ae6eee488f/"Bulk downloads
Versioned snapshots of the whole database — the fastest way to get everything.
GET/api/releases/All releases, newest first, with file sizes, checksums and links.
curl "https://pharbp.bionetic.org/api/releases/"GET/api/releases/<version|latest>/One release manifest with download URLs (Zenodo when published).
curl "https://pharbp.bionetic.org/api/releases/latest/"Visualization
Data behind the interactive views; handy for custom plots.
GET/api/explore/data/UMAP point cloud with optional filters and colouring.
n_neighborscolor_categorycolor_valuefilters_jsoncurl "https://pharbp.bionetic.org/api/explore/data/?n_neighbors=15&color_category=detection_method&color_value=RBPdetect2"GET/api/pae/<sequence_hex_id>/Predicted aligned error matrix of the predicted structure.
curl "https://pharbp.bionetic.org/api/pae/8ad910445d5b6bbe28f2dea706fa18c5f6a191760320335079b5d3ae6eee488f/"Expand an endpoint and press Execute to run a live request against this server.