integrations.sh
← all integrations

Open Targets Platform REST API

OpenAPI apis-guru open_data

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:

sh
curl -X POST -d '{"disease":["EFO_0000253"]}' --header 'Content-Type: application/json' https://platform-api.opentargets.io/v3/platform/public/evidence/filter

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.

sh
curl https://platform-api.opentargets.io/v3/platform/public/association/filter\?target\=ENSG00000157764 | jq

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. `

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.getApiDocs

    Access api docs as served by Redoc

  • private.getApiSwaggerUi

    Interactive API docs using swagger-ui

  • private.getAutocomplete

    Search for the closest term to autocomplete in the search box.

  • private.getDiseaseById

    Get disease objects.

  • private.getDrugById

    Get drug objects.

  • private.getEcObyId

    Get ECO objects.

  • private.getQuickSearch

    Get search-result objects. Enables search bar functionality.

  • private.getRelationByEfoid

    Get relation objects starting from diseases.

  • private.getRelationByEnsgid

    Get relation objects starting from diseases.

  • private.getSwagger

    Get swagger.yaml specs for the API

  • private.getTargetByEnsgid

    Get target objects.

  • private.getTargetExpressionByEnsgid

    Get gene-expression objects.

  • private.postBestHitSearch

    Fire the search method for multiple strings

  • private.postDiseaseById

    Get disease objects.

  • private.postEnrichmentTarget

    Returns an enrichment analysis for a list of targets passed in the body

  • private.postRelation

    Get relation objects.

  • private.postTargetByEnsgid

    Get target objects. Used for the target profile page.

  • private.postTargetExpressionByEnsgid

    Get gene-expression objects.

  • public.getAssociationById

    Once 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.getAssociationFilter

    More 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.getDataMetrics

    Returns the metrics about associations and evidences, divided by datasource, genes and so on.

  • public.getDataStats

    Returns the number of associations and evidences, divided by datasource.

  • public.getEvidenceById

    We 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. 8ed3d7568a8c6cac9c95cfb869bac762 for 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.getEvidenceFilter

    The 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.getPing

    Check if the API is up

  • public.getSearch

    This 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.getTherapeuticAreas

    Returns the list of therapeutic areas for the current data release

  • public.getVersion

    Returns current API version.

  • public.postAssociationFilter

    Complex queries and filters for association objects can also be submitted using a JSON object and the equivalent POST method.

  • public.postEvidenceById

    This is the POST version of . It allows to query for a list of evidence strings encoded in a json object to be passed in the body.

  • public.postEvidenceFilter

    POST version of . Filters can be specified as part of a json object in the body, simplifying the submission of queries.

  • openapi.previewSpec

    Preview an OpenAPI document before adding it as a source

  • openapi.addSource

    Add an OpenAPI source and register its operations as tools