Open Targets Platform REST API
The Open Targets Platform REST API
The Open Targets Platform API ('Application Programming Interface') allows programmatic retrieval of the Open Targets Platform data via a set of services.
You can make calls to the latest version of our API using the base URL https://platform-api.opentargets.io/v3/platform. Please make sure you use https instead of the unencrypted http calls, which we do not accept.
We list below the methods available to query our data directly from the API, followed by an interactive interface that you can use to try out the parameters and execute the REST-API calls.
For every request you create, the interactive interface will display both a command and a request URL that you can use to ensure you get the expected response before using your application or workflow.
Check our documentation for some and if you have any questions.
Available Methods
The available methods can be grouped in three types:
- public - Methods that serve the core set of our data. These are stable and we fully supported them.
- private - Methods used by the web app to serve additional data not specific to our platform. These methods may change without notice and should be used with caution.
- utils - Methods to get statistics and technical data about our API.
Supported formats
The methods above are all available via a GET request, and will serve outputs as JSON.
Alternative output formats, such xml, csv and tab, are also available for some of the methods. However alternative output formats are not supported in interactive interface below where the response will be always in `JSON.
If you have complex queries with large number of parameters, you should use a POST request instead of GET.
POST methods require a body encoded as json. When querying for a specific disease using the latest version of the API, your call would look like the example below:
How to interpret a response
Each HTTPS response will serve data in headers and body. The headers will give you details about your query, such as how long it took to run.
In the body of the response, you will find the data you have requested for in JSON format. The program is a useful tool to parse the json response while on the command line.
We do not analyse the nature of any specific API queries except for the purposes of improving the performance of our API. Read more in our .
How can we make the Open Targets Platform API more useful to you? Would you like additional methods to be implemented? Please and send your suggestions. `
curl -X POST -d '{"disease":["EFO_0000253"]}' --header 'Content-Type: application/json' https://platform-api.opentargets.io/v3/platform/public/evidence/filtercurl https://platform-api.opentargets.io/v3/platform/public/association/filter\?target\=ENSG00000157764 | jq- Homepage
- https://api.apis.guru/v2/specs/opentargets.io/19.02.1.json
- Provider
- opentargets.io
- OpenAPI version
- 3.0.0
- Spec (JSON)
- https://api.apis.guru/v2/specs/opentargets.io/19.02.1/openapi.json
- Spec (YAML)
- https://api.apis.guru/v2/specs/opentargets.io/19.02.1/openapi.yaml
Tools (33)
Extracted live via the executor SDK.
-
private.getApiDocsAccess api docs as served by Redoc
-
private.getApiSwaggerUiInteractive API docs using swagger-ui
-
private.getAutocompleteSearch for the closest term to autocomplete in the search box.
-
private.getDiseaseByIdGet
diseaseobjects. -
private.getDrugByIdGet
drugobjects. -
private.getEcObyIdGet
ECOobjects. -
private.getQuickSearchGet
search-resultobjects. Enables search bar functionality. -
private.getRelationByEfoidGet
relationobjects starting from diseases. -
private.getRelationByEnsgidGet
relationobjects starting from diseases. -
private.getSwaggerGet swagger.yaml specs for the API
-
private.getTargetByEnsgidGet
targetobjects. -
private.getTargetExpressionByEnsgidGet
gene-expressionobjects. -
private.postBestHitSearchFire the search method for multiple strings
-
private.postDiseaseByIdGet
diseaseobjects. -
private.postEnrichmentTargetReturns an enrichment analysis for a list of targets passed in the body
-
private.postRelationGet
relationobjects. -
private.postTargetByEnsgidGet
targetobjects. Used for the target profile page. -
private.postTargetExpressionByEnsgidGet
gene-expressionobjects. -
public.getAssociationByIdOnce we integrate all evidence connecting a target to a specific disease, we compute an association score by the means of an harmonic sum. This association score provides an indication of how strong the evidence behind each connection is and can be used to rank genes in order of likelihood as drug targets. The association ID is constructed by using the Ensembl ID of the gene and the EFO ID for the disease (e.g. ENSG00000073756-EFO_0003767). The method returns an association object, which contains the data and summary on each evidence type included in the calculation of the score, as well as the score itself.
-
public.getAssociationFilterMore complex queries for associations scores and objects can be done using this method, which allows to sort in different order, restrict to a specific class of diseases or targets, as well as filtering results by score and associated pathways.
-
public.getDataMetricsReturns the metrics about associations and evidences, divided by datasource, genes and so on.
-
public.getDataStatsReturns the number of associations and evidences, divided by datasource.
-
public.getEvidenceByIdWe call evidence a unit of data that support a connection between a target and a disease. The Open Targets Platform integrates multiple types of evidence including genetic associations, somatic mutations, RNA expression and target-disease associations mined from the literature. This method allows you to retrieve a single evidence item or a list of pieces of evidence by using their targetvalidation.org ID.
Evidence IDs are unique within each data release (e.g.
8ed3d7568a8c6cac9c95cfb869bac762for release 1.2). You can obtain a list of evidence and their IDs from other API calls such as .Please note that a specific evidence ID may change between data releases. We can not guarantee that a specific evidence ID will refer to the same piece of evidence connecting a target and its diseases.
-
public.getEvidenceFilterThe filter method allows to retrieve the specific data that supports a connection between targets and diseases. Filters can be used to restrict the results by source and type of data, or limit results to targets which are part of a particular pathway. Minimum and maximum scores can be specified as well as the type of evidence linking target and disease. Note that multiple genes and diseases can be specified in the same request.
-
public.getPingCheck if the API is up
-
public.getSearchThis method allows you to look for gene or diseases of interest using a free text search, replicating the functionality of the search box on our homepage. It should be used to identify the best match for a disease or target of interest, rather than gathering a specific set of evidence.
-
public.getTherapeuticAreasReturns the list of therapeutic areas for the current data release
-
public.getVersionReturns current API version.
-
public.postAssociationFilterComplex queries and filters for association objects can also be submitted using a JSON object and the equivalent POST method.
-
public.postEvidenceByIdThis is the POST version of . It allows to query for a list of evidence strings encoded in a
jsonobject to be passed in the body. -
public.postEvidenceFilterPOST version of . Filters can be specified as part of a
jsonobject in the body, simplifying the submission of queries. -
openapi.previewSpecPreview an OpenAPI document before adding it as a source
-
openapi.addSourceAdd an OpenAPI source and register its operations as tools