Skill Tracer
Skills › Scientific Agent Skills › database-lookup › string.md

string.md

285 lines · skills/database-lookup/references/string.md at 5f2bc03

Open on GitHub
1# STRING REST API
2

STRING REST API

Raw lines 1 to 2
3## Base URL
4
5```
6https://string-db.org/api
7```
8

Base URL

https://string-db.org/api
Raw lines 3 to 8
9## URL Pattern
11```
12/api/{output_format}/{method}
13```
15- **output_format**: `json`, `tsv`, `tsv-no-header`, `image`, `svg` (not all formats for all endpoints)
16- **method**: endpoint name (see below)

URL Pattern

/api/{output_format}/{method}
  • output_format: json, tsv, tsv-no-header, image, svg (not all formats for all endpoints)
  • method: endpoint name (see below)
Raw lines 9 to 17
18## Authentication
20No API key required. All endpoints are public.

Authentication

No API key required. All endpoints are public.

Raw lines 18 to 21
22## Key Endpoints

Key Endpoints

Raw lines 22 to 23
24### 1. Resolve protein identifiers
26Map protein names/identifiers to STRING internal IDs. Always do this first to get canonical STRING IDs.
28```
29GET /api/json/get_string_ids?identifiers={query}&species={taxid}
30```
32| Parameter | Type | Description |
33|-------------|--------|-------------|
34| `identifier` | string | **Required.** Protein name, gene symbol, or external ID. |
35| `species` | int | NCBI taxonomy ID (9606 = human, 10090 = mouse). Recommended to avoid ambiguity. |
37**Example:**
38```
39https://string-db.org/api/json/get_string_ids?identifiers=TP53&species=9606
40```
42**Response:**
43```json
45 {
46 "stringId": "9606.ENSP00000269305",
47 "preferredName": "TP53",
48 "ncbiTaxonId": 9606,
49 "taxonName": "Homo sapiens",
50 "annotation": "Cellular tumor antigen p53; ..."
51 }
53```
55---

1. Resolve protein identifiers

Map protein names/identifiers to STRING internal IDs. Always do this first to get canonical STRING IDs.

GET /api/json/get_string_ids?identifiers={query}&species={taxid}
ParameterTypeDescription
identifierstringRequired. Protein name, gene symbol, or external ID.
speciesintNCBI taxonomy ID (9606 = human, 10090 = mouse). Recommended to avoid ambiguity.

Example:

https://string-db.org/api/json/get_string_ids?identifiers=TP53&species=9606

Response:

[
  {
    "stringId": "9606.ENSP00000269305",
    "preferredName": "TP53",
    "ncbiTaxonId": 9606,
    "taxonName": "Homo sapiens",
    "annotation": "Cellular tumor antigen p53; ..."
  }
]

Raw lines 24 to 56
57### 2. Get interaction partners (network)
59```
60GET /api/json/interaction_partners?identifiers={proteins}&species={taxid}
61```
63| Parameter | Type | Description |
64|--------------------|--------|-------------|
65| `identifiers` | string | **Required.** Protein name(s). Use `%0d` (newline) to separate multiple. |
66| `species` | int | NCBI taxonomy ID. |
67| `limit` | int | Max number of interaction partners to return (per input protein). |
68| `required_score` | int | Minimum combined score (0-1000). Default: 400. Common thresholds: 400 (medium), 700 (high), 900 (highest). |
69| `network_type` | string | `functional` (default, all associations) or `physical` (predicted physical associations, which need not prove direct binding). |
71**Example:**
72```
73https://string-db.org/api/json/interaction_partners?identifiers=TP53&species=9606&limit=10&required_score=900
74```
76**Response:**
77```json
79 {
80 "stringId_A": "9606.ENSP00000269305",
81 "stringId_B": "9606.ENSP00000261842",
82 "preferredName_A": "TP53",
83 "preferredName_B": "MDM2",
84 "ncbiTaxonId": 9606,
85 "score": 0.999,
86 "nscore": 0,
87 "fscore": 0,
88 "pscore": 0,
89 "ascore": 0.93,
90 "escore": 0.994,
91 "dscore": 0.9,
92 "tscore": 0.981
93 }
95```
97Score channels: `nscore` (neighborhood), `fscore` (fusion), `pscore` (phylogenetic co-occurrence), `ascore` (co-expression), `escore` (experimental), `dscore` (database/curated), `tscore` (text mining).
99---

2. Get interaction partners (network)

GET /api/json/interaction_partners?identifiers={proteins}&species={taxid}
ParameterTypeDescription
identifiersstringRequired. Protein name(s). Use %0d (newline) to separate multiple.
speciesintNCBI taxonomy ID.
limitintMax number of interaction partners to return (per input protein).
required_scoreintMinimum combined score (0-1000). Default: 400. Common thresholds: 400 (medium), 700 (high), 900 (highest).
network_typestringfunctional (default, all associations) or physical (predicted physical associations, which need not prove direct binding).

Example:

https://string-db.org/api/json/interaction_partners?identifiers=TP53&species=9606&limit=10&required_score=900

Response:

[
  {
    "stringId_A": "9606.ENSP00000269305",
    "stringId_B": "9606.ENSP00000261842",
    "preferredName_A": "TP53",
    "preferredName_B": "MDM2",
    "ncbiTaxonId": 9606,
    "score": 0.999,
    "nscore": 0,
    "fscore": 0,
    "pscore": 0,
    "ascore": 0.93,
    "escore": 0.994,
    "dscore": 0.9,
    "tscore": 0.981
  }
]

Score channels: nscore (neighborhood), fscore (fusion), pscore (phylogenetic co-occurrence), ascore (co-expression), escore (experimental), dscore (database/curated), tscore (text mining).


Raw lines 57 to 100
101### 3. Get network interactions between a set of proteins
103```
104GET /api/json/network?identifiers={proteins}&species={taxid}
105```
107| Parameter | Type | Description |
108|------------------|--------|-------------|
109| `identifiers` | string | **Required.** Protein names separated by `%0d` (newline-encoded). |
110| `species` | int | NCBI taxonomy ID. |
111| `required_score` | int | Minimum combined score (0-1000). |
112| `network_type` | string | `functional` or `physical`. |
113| `add_nodes` | int | Number of additional interactors to add (expands the network). |
115**Example — network among a set of proteins:**
116```
117https://string-db.org/api/json/network?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2%0dMDM2&species=9606&required_score=700
118```
120Returns all pairwise interactions among the input set.
122---

3. Get network interactions between a set of proteins

GET /api/json/network?identifiers={proteins}&species={taxid}
ParameterTypeDescription
identifiersstringRequired. Protein names separated by %0d (newline-encoded).
speciesintNCBI taxonomy ID.
required_scoreintMinimum combined score (0-1000).
network_typestringfunctional or physical.
add_nodesintNumber of additional interactors to add (expands the network).

Example — network among a set of proteins:

https://string-db.org/api/json/network?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2%0dMDM2&species=9606&required_score=700

Returns all pairwise interactions among the input set.


Raw lines 101 to 123
124### 4. Network image
126```
127GET /api/image/network?identifiers={proteins}&species={taxid}
128GET /api/svg/network?identifiers={proteins}&species={taxid}
129```
131Returns a PNG image or SVG of the interaction network.
133**Example:**
134```
135https://string-db.org/api/image/network?identifiers=TP53%0dBRCA1%0dMDM2&species=9606
136```
138---

4. Network image

GET /api/image/network?identifiers={proteins}&species={taxid}
GET /api/svg/network?identifiers={proteins}&species={taxid}

Returns a PNG image or SVG of the interaction network.

Example:

https://string-db.org/api/image/network?identifiers=TP53%0dBRCA1%0dMDM2&species=9606

Raw lines 124 to 139
140### 5. Functional enrichment analysis
142Perform Gene Ontology, KEGG pathway, and other enrichment analysis on a set of proteins.
144```
145GET /api/json/enrichment?identifiers={proteins}&species={taxid}
146```
148| Parameter | Type | Description |
149|--------------|--------|-------------|
150| `identifiers` | string | **Required.** Newline-separated (`%0d`) protein names. |
151| `species` | int | NCBI taxonomy ID. |
153**Example:**
154```
155https://string-db.org/api/json/enrichment?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2%0dCDK2%0dCDKN1A&species=9606
156```
158**Response:**
159```json
161 {
162 "category": "Process",
163 "term": "GO:0006974",
164 "description": "cellular response to DNA damage stimulus",
165 "number_of_genes": 6,
166 "number_of_genes_in_background": 781,
167 "ncbiTaxonId": 9606,
168 "inputGenes": "TP53,BRCA1,ATM,CHEK2,CDK2,CDKN1A",
169 "preferredNames": "TP53,BRCA1,ATM,CHEK2,CDK2,CDKN1A",
170 "p_value": 1.2e-12,
171 "fdr": 5.6e-10
172 }
174```
176Categories include: `Process` (GO Biological Process), `Function` (GO Molecular Function), `Component` (GO Cellular Component), `KEGG`, `Pfam`, `InterPro`, `SMART`, `Keyword` (UniProt), `Reactome`, `WikiPathways`, `HPO` (Human Phenotype Ontology).
178---

5. Functional enrichment analysis

Perform Gene Ontology, KEGG pathway, and other enrichment analysis on a set of proteins.

GET /api/json/enrichment?identifiers={proteins}&species={taxid}
ParameterTypeDescription
identifiersstringRequired. Newline-separated (%0d) protein names.
speciesintNCBI taxonomy ID.

Example:

https://string-db.org/api/json/enrichment?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2%0dCDK2%0dCDKN1A&species=9606

Response:

[
  {
    "category": "Process",
    "term": "GO:0006974",
    "description": "cellular response to DNA damage stimulus",
    "number_of_genes": 6,
    "number_of_genes_in_background": 781,
    "ncbiTaxonId": 9606,
    "inputGenes": "TP53,BRCA1,ATM,CHEK2,CDK2,CDKN1A",
    "preferredNames": "TP53,BRCA1,ATM,CHEK2,CDK2,CDKN1A",
    "p_value": 1.2e-12,
    "fdr": 5.6e-10
  }
]

Categories include: Process (GO Biological Process), Function (GO Molecular Function), Component (GO Cellular Component), KEGG, Pfam, InterPro, SMART, Keyword (UniProt), Reactome, WikiPathways, HPO (Human Phenotype Ontology).


Raw lines 140 to 179
180### 6. Get protein annotations/info
182```
183GET /api/json/get_string_ids?identifiers={proteins}&species={taxid}
184```
186Maps arbitrary names to STRING IDs with annotation text.
188**Example:**
189```
190https://string-db.org/api/json/get_string_ids?identifiers=CDK2%0dp53&species=9606
191```
193**Response:**
194```json
196 {
197 "queryIndex": 0,
198 "queryItem": "CDK2",
199 "stringId": "9606.ENSP00000266970",
200 "ncbiTaxonId": 9606,
201 "taxonName": "Homo sapiens",
202 "preferredName": "CDK2",
203 "annotation": "Cyclin-dependent kinase 2; ..."
204 }
206```
208---

6. Get protein annotations/info

GET /api/json/get_string_ids?identifiers={proteins}&species={taxid}

Maps arbitrary names to STRING IDs with annotation text.

Example:

https://string-db.org/api/json/get_string_ids?identifiers=CDK2%0dp53&species=9606

Response:

[
  {
    "queryIndex": 0,
    "queryItem": "CDK2",
    "stringId": "9606.ENSP00000266970",
    "ncbiTaxonId": 9606,
    "taxonName": "Homo sapiens",
    "preferredName": "CDK2",
    "annotation": "Cyclin-dependent kinase 2; ..."
  }
]

Raw lines 180 to 209
210### 7. Get homology / best-hit in another species
212```
213GET /api/json/homology_best?identifiers={proteins}&species={taxid}&species_b={taxid_b}
214```
216| Parameter | Type | Description |
217|------------|------|-------------|
218| `identifiers` | string | Source protein(s). |
219| `species` | int | Source species. |
220| `species_b` | int | Target species for homolog lookup. |
222**Example:**
223```
224https://string-db.org/api/json/homology_best?identifiers=TP53&species=9606&species_b=10090
225```
227---

7. Get homology / best-hit in another species

GET /api/json/homology_best?identifiers={proteins}&species={taxid}&species_b={taxid_b}
ParameterTypeDescription
identifiersstringSource protein(s).
speciesintSource species.
species_bintTarget species for homolog lookup.

Example:

https://string-db.org/api/json/homology_best?identifiers=TP53&species=9606&species_b=10090

Raw lines 210 to 228
229### 8. PPI enrichment (is my set more connected than expected?)
231```
232GET /api/json/ppi_enrichment?identifiers={proteins}&species={taxid}
233```
235**Example:**
236```
237https://string-db.org/api/json/ppi_enrichment?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2&species=9606
238```
240**Response:**
241```json
243 {
244 "number_of_nodes": 4,
245 "number_of_edges": 6,
246 "average_node_degree": 3.0,
247 "local_clustering_coefficient": 1.0,
248 "expected_number_of_edges": 1,
249 "p_value": 0.000123
250 }
252```
254---

8. PPI enrichment (is my set more connected than expected?)

GET /api/json/ppi_enrichment?identifiers={proteins}&species={taxid}

Example:

https://string-db.org/api/json/ppi_enrichment?identifiers=TP53%0dBRCA1%0dATM%0dCHEK2&species=9606

Response:

[
  {
    "number_of_nodes": 4,
    "number_of_edges": 6,
    "average_node_degree": 3.0,
    "local_clustering_coefficient": 1.0,
    "expected_number_of_edges": 1,
    "p_value": 0.000123
  }
]

Raw lines 229 to 255
256## Common Species Taxonomy IDs
258| Species | Taxon ID |
259|---------|----------|
260| Homo sapiens (human) | 9606 |
261| Mus musculus (mouse) | 10090 |
262| Rattus norvegicus (rat) | 10116 |
263| Drosophila melanogaster (fruit fly) | 7227 |
264| Saccharomyces cerevisiae (yeast) | 4932 |
265| Caenorhabditis elegans (worm) | 6239 |
266| Danio rerio (zebrafish) | 7955 |
267| Escherichia coli K12 | 511145 |
268| Arabidopsis thaliana | 3702 |

Common Species Taxonomy IDs

SpeciesTaxon ID
Homo sapiens (human)9606
Mus musculus (mouse)10090
Rattus norvegicus (rat)10116
Drosophila melanogaster (fruit fly)7227
Saccharomyces cerevisiae (yeast)4932
Caenorhabditis elegans (worm)6239
Danio rerio (zebrafish)7955
Escherichia coli K12511145
Arabidopsis thaliana3702
Raw lines 256 to 269
270## Rate Limits
272- No published hard rate limit, but the API is intended for programmatic access at moderate rates.
273- Recommended: **max 1 request per second**.
274- For large-scale data downloads, use the flat-file downloads on the STRING website instead.
275- If you send too many requests, you may receive HTTP 429 or temporary blocking.
276- Multiple identifiers per request is strongly preferred over multiple single-identifier requests.

Rate Limits

  • No published hard rate limit, but the API is intended for programmatic access at moderate rates.
  • Recommended: max 1 request per second.
  • For large-scale data downloads, use the flat-file downloads on the STRING website instead.
  • If you send too many requests, you may receive HTTP 429 or temporary blocking.
  • Multiple identifiers per request is strongly preferred over multiple single-identifier requests.
Raw lines 270 to 277
278## Error Handling
280- Returns HTTP 400 for malformed requests.
281- Returns HTTP 404 if no matching protein is found.
282- Empty JSON array `[]` if the query is valid but returns no results (e.g., no interactions above the threshold).
283- Include `species` parameter whenever possible to avoid ambiguous identifier resolution.
285Current [STRING API contract](https://string-db.org/help/api/) also supports regulatory networks. Pin the returned STRING version and network type; best sequence similarity does not by itself establish orthology.

Error Handling

  • Returns HTTP 400 for malformed requests.
  • Returns HTTP 404 if no matching protein is found.
  • Empty JSON array [] if the query is valid but returns no results (e.g., no interactions above the threshold).
  • Include species parameter whenever possible to avoid ambiguous identifier resolution.

Current STRING API contract also supports regulatory networks. Pin the returned STRING version and network type; best sequence similarity does not by itself establish orthology.

Raw lines 278 to 285