GraphQL API
Last updated
Was this helpful?
Last updated
Was this helpful?
The Open Targets Platform GraphQL — available at — is our new API that allows for language-agnostic access to our data, along with other key benefits:
You can construct a query that returns only the fields that you need
You can build graphical queries that traverse a data graph through resolvable entities and this reduces the need for multiple queries
You can access the with built-in documentation and schema showing required and optional parameters
You can view the that shows the available fields for each object along with a description and data type attribute
You only have to use POST
requests with a simple query string and variables object
Our GraphQL API supports queries for a single target, disease/phenotype, drug, or target-disease association. For more systematic queries (e.g. for multiple targets), please use or .
The base URL endpoint for our new GraphQL API is:
You can then access relevant data from the following endpoints:
/target: contains annotation information for targets including tractability assessments, mouse phenotype models, and baseline expression; also contains data on diseases and phenotypes association with the given target
/disease: contains annotation information for diseases and phenotypes including ontology, known drugs, and clinical signs and symptoms; also contains data on targets associated with the given disease or phenotype
/drug: contains annotation information for compounds and drugs including mechanisms of action, indications, and pharmacovigilance data
/variant: contains annotation information for variants including population allele frequencies, variant effect, transcript consequences, and credible sets associated with complex traits containing the variant.
/studies: contains annotation information for studies including trait or phenotype, publication, cohort information and list of credible sets associated with the study.
/credibleSet: contains annotation information for credible sets including the complete sets of variants in the credible set, gene assignment based on our L2G predictions and colocalisation metrics.
/search: contains index of all entities contained within the Platform
Below is an example GraphQL query for AR (ENSG00000169083) that will return Genetic Constraint and Tractability data.
Below is an example script using the same AR query above, but written for Python and R:
Using GraphQL's and constructs, you can also access the data using a programming language that supports HTTP POST
requests. While this is a valid approach, we discourage users from repeatedly querying the GraphQL API one entity at a time. Instead, our comprehensive provide a simpler and more performant strategy to achieve the same result.
For more information on how to use the GraphQL API and example queries based on actual use cases and research questions, check out the .