Introduction

The DGIdb API can be used to query for drug-gene interactions in your own applications through a simple JSON based interface.

All endpoints can be reached at: http://dgidb.org

Documentation for v1 of the API (deprecated) can be found here.

Interactions

Search Interactions

The interactions endpoint can be used to return interactions for a given set of gene or drug names/symbols. It also allows you to filter returned interactions.

GET
/api/v2/interactions.json?

Note: While the preferred method for accessing this endpoint is a GET request, it will also accept POST requests to accomodate large gene lists if needed.

Accepted Parameters:
Parameter Description Example
genes / drugs (required) A comma delimited list of gene or drug names/symbols. genes=FLT1,STK1,FAKE1 or drugs=FICLATUZUMAB,ETOPOSIDE,NOTREAL
interaction_sources (optional) A comma delimited list of source names to include in the result set. If this field is omitted, all sources will be included. interaction_sources=TTD,DrugBank
interaction_types (optional) A comma delimited list of interaction types to include in the result set. If this field is omitted, all interaction types will be included. interaction_types=inhibitor,activator
fda_approved_drug (optional) A flag denoting whether or not to limit interactions to only the ones involving fda-approved drugs. If this field is omitted, interactions for all types of drugs will be included. fda_approved_drug=true
immunotherapy (optional) A flag denoting whether or not to limit interactions to only the ones involving immunotherapeutic drugs. If this field is omitted, interactions for all types of drugs will be included. immunotherapy=true
anti_neoplastic (optional) A flag denoting whether or not to limit interactions to only the ones involving antineoplastic drugs. If this field is omitted, interactions for all types of drugs will be included. anti_neoplastic=true
clinically_actionable (optional) A flag denoting whether or not to limit interactions to only the ones involving clinically actionable genes. If this field is omitted, interactions for all types of genes will be included. clinically_actionable=true
druggable_genome (optional) A flag denoting whether or not to limit interactions to only the ones involving the durggable genome. If this field is omitted, interactions for all types of genes will be included. druggable_genome=true
drug_resistance (optional) A flag denoting whether or not to limit interactions to only the ones involving drug-resistant genes. If this field is omitted, interactions for all types of genes will be included. drug_resistance=true
gene_categories (optional) A comma delimited list of gene categories to include in the result set. If this field is omitted, all gene categories will be included. gene_categories=kinase,tumor%20suppressor
source_trust_levels (optional) A comma delimited list of source trust levels to include in the result set. If this field is omitted, all trust levels will be included. source_trust_levels=Expert%20curated
Example Call:

Note: The following example would query DGIdb for interactions involving the genes FLT1, STK1, and FAKE. It will only show interactions reported by the source. TALC.

http://dgidb.org/api/v2/interactions.json?genes=FLT1,MM1,FAKE&nteraction_sources=TALC
Example Response:

The response will come back with three top level items:

matchedTerms will be a list containing a hash for each search term that you provided that we were able to map unambiguously to an Entrez gene. Each hash will contain your original search term, the Entrez long and full names that DGIdb matched them to as well as a list of categories that the given gene is in. Additionally, the hash will contain a list of drug interactions for the gene. This list includes interaction type information as well as the drug name and source that reported the interaction.

ambiguousTerms will be a list containing a hash of search terms that you provided that mapped to multiple Entrez genes. Each hash will contain your original search term, the Entrez long and full names of the potential math as well as a list of categories that the given gene is in. Additionally, the hash will contain a list of drug interactions for the gene. This list includes interaction type information as well as the drug name and source that reported the interaction.

unmatchedTerms will be a list of search terms you provided that we were unable to map any Entrez gene.

"matchedTerms": [
    {
      "searchTerm": "FLT1",
      "geneName": "FLT1",
      "geneLongName": "fms related tyrosine kinase 1",
      "entrezId": 2321,
      "geneCategories": [
        {
          "id": "4c14ec3171544bd2b18b2f1a45e6c8f2",
          "name": "KINASE"
        },
        {
          "id": "6c528ef943614261afc5e4f52a3c60ee",
          "name": "TYROSINE KINASE"
        },
        {
          "id": "d3ec2631e0b2434b9dcc008e793d3fa5",
          "name": "DRUGGABLE GENOME"
        },
        {
          "id": "0d157beb-fd17-404d-8755-3a81aa5ed704",
          "name": "CLINICALLY ACTIONABLE"
        }
      ],
      "interactions": [
        {
          "interactionId": "841ed1ba-816f-4d62-9c7b-b6c81d79ad14",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "CEDIRANIB",
          "drugChemblId": "CHEMBL491473",
          "sources": [
            "ChEMBL",
            "TdgClinicalTrial",
            "TALC"
          ],
          "pmids": []
        },
        {
          "interactionId": "4a5005da-4a38-414c-93a8-f6a8d471f801",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "TIVOZANIB",
          "drugChemblId": "CHEMBL1289494",
          "sources": [
            "ChEMBL",
            "CancerCommons",
            "TALC",
            "MyCancerGenome",
            "TdgClinicalTrial",
            "ClearityFoundationClinicalTrial"
          ],
          "pmids": []
        },
        {
          "interactionId": "fcce486a-92d6-4740-bf56-d5c3ca43f85e",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "VATALANIB",
          "drugChemblId": "CHEMBL101253",
          "sources": [
            "ChEMBL",
            "DrugBank",
            "TALC",
            "MyCancerGenome",
            "TdgClinicalTrial"
          ],
          "pmids": []
        },
        {
          "interactionId": "6919fc44-75fa-41d0-bd11-fa2a2fba0f85",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "MOTESANIB",
          "drugChemblId": "CHEMBL572881",
          "sources": [
            "ChEMBL",
            "MyCancerGenome",
            "TdgClinicalTrial",
            "TALC"
          ],
          "pmids": []
        },
        {
          "interactionId": "127a6d88-9bf9-4175-9552-e025e1deba48",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "SUNITINIB",
          "drugChemblId": "CHEMBL535",
          "sources": [
            "DrugBank",
            "TEND",
            "MyCancerGenomeClinicalTrial",
            "TdgClinicalTrial",
            "TALC"
          ],
          "pmids": []
        },
        {
          "interactionId": "8c36e43e-a411-45e0-af46-89195e5dd856",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "AXITINIB",
          "drugChemblId": "CHEMBL1289926",
          "sources": [
            "ChEMBL",
            "TALC",
            "MyCancerGenome",
            "MyCancerGenomeClinicalTrial",
            "TdgClinicalTrial",
            "PharmGKB",
            "DrugBank",
            "CancerCommons"
          ],
          "pmids": []
        },
        {
          "interactionId": "2ab8d600-b787-407e-a4f8-88db0d22a9bf",
          "interactionTypes": [
            "inhibitor"
          ],
          "drugName": "REGORAFENIB",
          "drugChemblId": "CHEMBL1946170",
          "sources": [
            "ChEMBL",
            "DrugBank",
            "MyCancerGenome",
            "MyCancerGenomeClinicalTrial",
            "TALC"
          ],
          "pmids": []
        },
        {
          "interactionId": "731d0ad8-7909-474a-a67f-e7f0e94ba42d",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "LENVATINIB",
          "drugChemblId": "CHEMBL1289601",
          "sources": [
            "DrugBank",
            "TdgClinicalTrial",
            "TALC"
          ],
          "pmids": []
        },
        {
          "interactionId": "9cd02ac8-61ee-4266-8c54-f115288e709a",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "NINTEDANIB",
          "drugChemblId": "CHEMBL502835",
          "sources": [
            "DrugBank",
            "TALC",
            "MyCancerGenome",
            "TdgClinicalTrial",
            "ClearityFoundationClinicalTrial"
          ],
          "pmids": []
        },
        {
          "interactionId": "5f704ee0-153d-4b8d-b203-b41b04cbe256",
          "interactionTypes": [
            "inhibitor",
            "n/a"
          ],
          "drugName": "PAZOPANIB",
          "drugChemblId": "CHEMBL477772",
          "sources": [
            "MyCancerGenome",
            "MyCancerGenomeClinicalTrial",
            "TdgClinicalTrial",
            "DrugBank",
            "ClearityFoundationClinicalTrial",
            "TALC"
          ],
          "pmids": []
        }
      ]
    }
  ],
  "ambiguousTerms": [
    {
      "searchTerm": "MM1",
      "geneName": "PFDN5",
      "geneLongName": "prefoldin subunit 5",
      "entrezId": 5204,
      "geneCategories": [],
      "interactions": []
    },
    {
      "searchTerm": "MM1",
      "geneName": "PLXNB2",
      "geneLongName": "plexin B2",
      "entrezId": 23654,
      "geneCategories": [
        {
          "id": "26f6a4ea7779433ea2cbf524683accf7",
          "name": "CELL SURFACE"
        }
      ],
      "interactions": []
    }
  ],
  "unmatchedTerms": [
    "FAKE"
  ]

All Interactions

When used without any parameters, the interactions endpoint returns a list of all interactions in the DGIdb database.

GET
http://dgidb.org/api/v2/interactions.json
[
  {
    "id":"d7f26f83-681f-4546-a71e-4651c8c88c7c",
    "gene_name":"AKT1",
    "entrez_id":207,
    "drug_name":"GSK-690693",
    "chembl_id":"CHEMBL494089",
    "publications":[18800763],
    "interaction_types":[
      "n/a",
      "inhibitor"
    ],
    "sources":[
      "ChEMBL",
      "GuideToPharmacologyInteractions"
    ]
  },
  ...
]

Interaction Details

The interaction details endpoint can be used to retrieve detailed information about one particular interaction.

GET
http://dgidb.org/api/v2/interactions/<interaction_id>
Example Call:

Note: The following example would query DGIdb for the interaction with ID d7f26f83-681f-4546-a71e-4651c8c88c7c

http://dgidb.org/api/v2/interactions/d7f26f83-681f-4546-a71e-4651c8c88c7c
Example Response:
"id": "d7f26f83-681f-4546-a71e-4651c8c88c7c",
"gene_name": "AKT1",
"entrez_id": 207,
"drug_name": "GSK-690693",
"chembl_id": "CHEMBL494089",
"publications": [
  18800763
],
"interaction_types": [
  "n/a",
  "inhibitor"
],
"sources": [
  "ChEMBL",
  "GuideToPharmacologyInteractions"
],
"attributes": [
  {
    "name": "Mechanism of Interaction",
    "value": "Serine/threonine-protein kinase AKT inhibitor",
    "sources": [
      "ChEMBL"
    ]
  },
  {
    "name": "Direct Interaction",
    "value": "yes",
    "sources": [
      "ChEMBL"
    ]
  },
  {
    "name": "Specific Action of the Ligand",
    "value": "Inhibition",
    "sources": [
      "GuideToPharmacologyInteractions"
    ]
  },
  {
    "name": "Endogenous Drug?",
    "value": "False",
    "sources": [
      "GuideToPharmacologyInteractions"
    ]
  },
  {
    "name": "Direct Interaction?",
    "value": "True",
    "sources": [
      "GuideToPharmacologyInteractions"
    ]
  }
],
"interaction_claims": [
  {
    "source": "ChEMBL",
    "drug": "GSK-690693",
    "gene": "PKB ",
    "interaction_types": [
      "inhibitor"
    ],
    "attributes": [
      {
        "name": "Mechanism of Interaction",
        "value": "Serine/threonine-protein kinase AKT inhibitor"
      },
      {
        "name": "Direct Interaction",
        "value": "yes"
      }
    ],
    "publications": []
  },
  {
    "source": "GuideToPharmacologyInteractions",
    "drug": "GSK690693",
    "gene": "1479",
    "interaction_types": [
      "n/a"
    ],
    "attributes": [
      {
        "name": "Specific Action of the Ligand",
        "value": "Inhibition"
      },
      {
        "name": "Endogenous Drug?",
        "value": "False"
      },
      {
        "name": "Direct Interaction?",
        "value": "True"
      }
    ],
    "publications": [
      18800763
    ]
  }
]

Drugs

All Drugs

The drugs endpoint can be used to retrieve a list of all drugs in the DGIdb database.

GET
http://dgidb.org/api/v2/drugs.json
[
  {
    "name":"TESAMORELIN",
    "chembl_id":"CHEMBL1237026",
    "fda_approved":true,
    "immunotherapy":false,
    "anti_neoplastic":false,
    "alias":[
      "178103540",
      "6959",
      "DAP001556",
      "GHRH(1-44)",
      "N-[(3E)-1-oxo-3-hexenyl]Somatoliberin (human pancreatic islet)",
      "218949-48-5",
      "Egrifta",
      "DB08869"
    ]
  },
  ...
]

Drug Details

The drug details endpoint can be used to retrieve detailed information about one particular drug.

GET
http://dgidb.org/api/v2/drugs/<chembl_id>
Example Call:

Note: The following example would query DGIdb for the drug with ChEMBL ID CHEMBL1237026

http://dgidb.org/api/v2/drugs/CHEMBL1237026
Example Response:
{
  "name":"TESAMORELIN",
  "chembl_id":"CHEMBL1237026",
  "fda_approved":true,
  "immunotherapy":false,
  "anti_neoplastic":false,
  "alias":[
    "178103540",
    "6959",
    "DAP001556",
    "GHRH(1-44)",
    "N-[(3E)-1-oxo-3-hexenyl]Somatoliberin (human pancreatic islet)",
    "218949-48-5",
    "Egrifta",
    "DB08869"
  ],
  "pmids":[],
  "attributes":[
    {
      "name":"Year of Approval",
      "value":"2010",
      "sources":[
        "TEND"
      ]
    },
    {
      "name":"Drug Class",
      "value":"antilipodystrophy agents",
      "sources":[
        "TEND"
      ]
    },
    {
      "name":"Drug Indications",
      "value":"for treatment of HIV-associated lipodystrophy",
      "sources":[
        "TdgClinicalTrial"
      ]
    },
    {
      "name":"Drug Class",
      "value":"peptide",
      "sources":[
        "TdgClinicalTrial"
      ]
    },
    {
      "name":"FDA Approval",
      "value":"approved",
      "sources":[
        "TdgClinicalTrial"
      ]
    },
    {
      "name":"Drug Type",
      "value":"small molecule",
      "sources":["DrugBank"]
    },
    {
      "name":"Drug Groups",
      "value":"approved",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Groups",
      "value":"investigational",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"amino acids",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"peptides",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"and proteins",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"anterior pituitary lobe hormones and analogues",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"chemical actions and uses",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"hormones",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"hormone substitutes",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"and hormone antagonists",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"hypothalamic hormones",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"lipodystrophy",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"nerve tissue proteins",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"neuropeptides",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"peptide hormones",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"pharmacologic actions",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"physiological effects of drugs",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"pituitary and hypothalamic hormones and analogues",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"pituitary hormone-releasing hormones",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"proteins",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"somatropin and somatropin agonists",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"systemic hormonal preparations",
      "sources":[
        "DrugBank"
      ]
    },
    {
      "name":"Drug Categories",
      "value":"excl. sex hormones and insulins",
      "sources":[
        "DrugBank"
      ]
    }
  ],
  "drug_claims":[
    {
      "source":"GuideToPharmacologyInteractions",
      "name":"6959",
      "primary_name":"TESAMORELIN",
      "aliases":[
        "TESAMORELIN",
        "178103540"
      ],
      "attributes":[],
      "publications":[]
    },
    {
      "source":"TTD",
      "name":"DAP001556",
      "primary_name":"TESAMORELIN",
      "aliases":[
        "TESAMORELIN",
        "DAP001556"
      ],
      "attributes":[],
      "publications":[]
    },
    {
      "source":"DrugBank",
      "name":"DB08869",
      "primary_name":"TESAMORELIN",
      "aliases":[
        "TESAMORELIN",
        "GHRH(1-44)",
        "N-[(3E)-1-oxo-3-hexenyl]Somatoliberin (human pancreatic islet)",
        "218949-48-5",
        "Egrifta"
      ],
      "attributes":[
        {
          "name":"Drug Type",
          "value":"small molecule"
        },
        {
          "name":"Drug Groups",
          "value":"approved"
        },
        {
          "name":"Drug Groups",
          "value":"investigational"
        },
        {
          "name":"Drug Categories",
          "value":"amino acids"
        },
        {
          "name":"Drug Categories",
          "value":"peptides"
        },
        {
          "name":"Drug Categories",
          "value":"and proteins"
        },
        {
          "name":"Drug Categories",
          "value":"anterior pituitary lobe hormones and analogues"
        },
        {
          "name":"Drug Categories",
          "value":"chemical actions and uses"
        },
        {
          "name":"Drug Categories",
          "value":"hormones"
        },
        {
          "name":"Drug Categories",
          "value":"hormone substitutes"
        },
        {
          "name":"Drug Categories",
          "value":"and hormone antagonists"
        },
        {
          "name":"Drug Categories",
          "value":"hypothalamic hormones"
        },
        {
          "name":"Drug Categories",
          "value":"lipodystrophy"
        },
        {
          "name":"Drug Categories",
          "value":"nerve tissue proteins"
        },
        {
          "name":"Drug Categories",
          "value":"neuropeptides"
        },
        {
          "name":"Drug Categories",
          "value":"peptide hormones"
        },
        {
          "name":"Drug Categories",
          "value":"pharmacologic actions"
        },
        {
          "name":"Drug Categories",
          "value":"physiological effects of drugs"
        },
        {
          "name":"Drug Categories",
          "value":"pituitary and hypothalamic hormones and analogues"
        },
        {
          "name":"Drug Categories",
          "value":"pituitary hormone-releasing hormones"
        },
        {
          "name":"Drug Categories",
          "value":"proteins"
        },
        {
          "name":"Drug Categories",
          "value":"somatropin and somatropin agonists"
        },
        {
          "name":"Drug Categories",
          "value":"systemic hormonal preparations"
        },
        {
          "name":"Drug Categories",
          "value":"excl. sex hormones and insulins"
        }
      ],
      "publications":[]
    },
    {
      "source":"TEND",
      "name":"TESAMORELIN",
      "primary_name":"TESAMORELIN",
      "aliases":[
        "TESAMORELIN"
      ],
      "attributes":[
        {
          "name":"Year of Approval",
          "value":"2010"
        },
        {
          "name":"Drug Class",
          "value":"antilipodystrophy agents"
        }
      ],
      "publications":[]
    },
    {
      "source":"TdgClinicalTrial",
      "name":"TESAMORELIN",
      "primary_name":"TESAMORELIN",
      "aliases":[],
      "attributes":[
        {
          "name":"Drug Indications",
          "value":"for treatment of HIV-associated lipodystrophy"
        },
        {
          "name":"Drug Class",
          "value":"peptide"
        },
        {
          "name":"FDA Approval",
          "value":"approved"
        }
      ],
      "publications":[]
    }
  ]
}

Genes

All Genes

The genes endpoint can be used to retrieve a list of all genes in the DGIdb database.

GET
http://dgidb.org/api/v2/genes.json
[
  {
    "name":"A1BG",
    "long_name":"alpha-1-B glycoprotein",
    "entrez_id":1,
    "aliases":[
      "A1B",
      "ABG",
      "GAB",
      "HYST2477",
      "ENSG00000121410"
    ]
  },
  ...
]

Gene Details

The gene details endpoint can be used to retrieve detailed information about one particular gene.

GET
http://dgidb.org/api/v2/genes/<entrez_id>
Example Call:

Note: The following example would query DGIdb for the gene with Entrez ID 346

http://dgidb.org/api/v2/genes/346
Example Response:
{
  "name":"APOC4",
  "long_name":"apolipoprotein C4",
  "entrez_id":346,
  "aliases":[
    "APO-CIV",
    "APOC-IV",
    "ENSG00000224916",
    "P55056",
    "apolipoprotein C-IV","346",
    "ENSG00000267467",
    "P21731",
    "TBXA2R",
    "TP receptor"
  ],
  "pmids":[
    1386885,
    10634944,
    2530338,
    2968449,
    1387312,
    1833018,
    1825698,
    16604093,
    2975605,
    1830308,
    1434130,
    8437108,
    3008368,
    11454901,
    2527074,
    8242228,
    9871769,
    2743082
  ],
  "attributes":[
    {
      "name":"Gene Biotype",
      "value":"PROTEIN_CODING",
      "sources":[
        "Ensembl"
      ]
    }
  ],
  "categories":[
    "TRANSPORTER"
  ],
  "gene_claims":[
    {
      "source":"GuideToPharmacologyInteractions",
      "name":"346",
      "aliases":[
        "P21731",
        "TBXA2R",
        "TP receptor"
      ],
      "attributes":[],
      "publications":[
        10634944,
        8242228,
        2748606,
        8859002,
        1434130,
        10537280,
        8882612,
        3594077,
        1386885,
        2530338,
        2968449,
        1387312,
        1833018,
        16604093,
        2975605,
        1830308,
        8437108,
        3008368,
        11454901,
        2527074,
        9871769,
        2743082,
        1825698
      ]
    },
    {
      "source":"Ensembl",
      "name":"ENSG00000224916",
      "aliases":[
        "ENSG00000224916",
        "APOC4"
      ],
      "attributes":[
        {
          "name":"Gene Biotype",
          "value":"PROTEIN_CODING"
        }
      ],
      "publications":[]
    },
    {
      "source":"GO",
      "name":"APOC4",
      "aliases":[
        "P55056"
      ],
      "attributes":[],
      "publications":[]
    }
  ]
}

Interaction Types

The interaction types endpoint can be used to retrieve a current list of supported interaction types for use in the interactions endpoint.

GET
http://dgidb.org/api/v2/interaction_types.json
Example Response:
["activator", "inhibitor", "unknown"]

Interaction Sources

The interaction sources endpoint can be used to retrieve a current list of supported interaction sources for use in calls to the interactions endpoint.

GET
http://dgidb.org/api/v2/interaction_sources.json
Example Response:
["DrugBank","PharmGKB","TALC","TEND","TTD"]

Gene Categories

The gene categories endpoint can be used to retrieve a current list of supported gene categories for use in calls to the interactions endpoint.

GET
http://dgidb.org/api/v2/gene_categories.json
Example Response:
["KINASE", "DNA REPAIR", "TUMOR SUPPRESSOR"]

Source Trust Levels

The source trust levels endpoint can be used to retrieve a current list of supported source trust levels for use in calls to the interactions endpoint.

GET
http://dgidb.org/api/v2/source_trust_levels.json
Example Response:
["Expert curated", "Non-curated"]

Genes in Category

The Genes in Category endpoint can be used to get a list of all genes in DGIdb that are known to be in a specific category.

GET
/api/v2/genes_in_category.json?
Accepted Parameters:
Parameter Description Example
category (required) The name of the category to retrieve genes from category=kinase
Example Call:

Note: The following example would query DGIdb for a list of genes known to be Kinases

http://dgidb.org/api/v2/genes_in_category.json?category=kinase
Example Response:
["SNRK","BCR","FKBP1A","TAB2","DGKE","PHKA1","PRKCH"]

Formats

Currently, all API responses are provided only in JSON. If you are experimenting with the API in your browser and you want to improve the display for JSON output you use a JSON formatter such as this one.


Status Codes

The DGIdb API can respond to requests with a number of status codes. They are explained in the table below.

Code Meaning
200 Success. Your query was processed and the response contains the information that was requested.
400 Bad Request. Something about your request was malformed or incorrect. The response will contain an error message indicating what was wrong.
404 Resource Not Found. This indicates that you attempted to get a resource that doesn't exist.
50X Server Error. This means there was a server side error processing your request. An email will be automatically dispatched to the developer notifying them of the problem.

Perl

A sample Perl application that interacts with DGIdb can be found on github.

Use the command line script to search for interactions FLT3 or EGFR, and limit to drugs that act as inhibitors:
EXECUTE EXAMPLE SCRIPT

wget https://raw.github.com/genome/dgi-db/master/files/perl_example.pl
chmod +x perl_example.pl
./perl_example.pl --genes='FLT3,EGFR' --interaction_types='inhibitor'
INSTALL INSTRUCTIONS


You may need to install the 'json' package from cpan before this script will work.
On a mac you can do the following:

First configure the 'cpan' tool:

sudo cpan
Then at the 'cpan' prompt:
get JSON
make JSON
install JSON
q


Python

A sample Python application that interacts with DGIdb can be found on github.

Use the command line script to search for interactions FLT3 or EGFR, and limit to drugs that act as inhibitors:
EXECUTE EXAMPLE SCRIPT

wget https://raw.github.com/genome/dgi-db/master/files/python_example.py
chmod +x python_example.py
./python_example.py --genes='FLT3,EGFR' --interaction_types='inhibitor'
INSTALL INSTRUCTIONS

This example uses the 'requests' python library. Installing 'requests' is easiest with 'pip' which is one of the easiest and recommended ways to install Python packages.:

sudo pip install requests
If you don't have pip, see the pip home-page.
or you can do this,
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py

Ruby

A small Ruby client library, along with a short usage demo can be found on github.

Use the client library to search for interactions involving FLT3 or EGFR, only from trusted sources:
SAMPLE CODE

client = DgidbApiClient.new
query_params = { source_trust_levels: 'Expert curated', genes: 'FLT3,EGFR' }
interaction_results = client.query(:interactions, query_params)
EXECUTE EXAMPLE SCRIPT
wget https://raw.github.com/genome/dgi-db/master/files/ruby_example.rb
ruby ruby_example.rb


Shell

A small tutorial showing command-line usage of the DGIdb API using shell commands on github.

Try the following examples from the command line to view and format output from the API:
SAMPLE CODE

curl http://dgidb.org/api/v2/interactions.json

curl http://dgidb.org/api/v2/interactions.json?genes=FLT3

curl http://dgidb.org/api/v2/interactions.json?genes=FLT3 | python -mjson.tool

curl http://dgidb.org/api/v2/interactions.json?genes=FLT3,STK1,FAKE1 | python -mjson.tool

curl http://dgidb.org/api/v2/interactions.json?genes=STK1,FAKE1 | python -mjson.tool

curl http://dgidb.org/api/v2/interactions.json?genes=STK1,FAKE1 | python -mjson.tool

curl http://dgidb.org/api/v2/interactions.json?genes=FLT3,STK1,FAKE1&interaction_sources=TTD,DrugBank | python -mjson.tool

curl http://dgidb.org/api/v2/interactions.json?genes=FLT3,STK1,FAKE1&interaction_sources=TTD,DrugBank&interaction_type=inhibitor | python -mjson.tool