If you are working in
drug discovery and/or
target identification, the chances are you have seen our previous post on the Open Targets project.
Perhaps you have even used our Open Targets Platform to search for target-disease associations on a gene by gene (or disease by disease) basis.
But if you are a bioinformatician working in disease biology, drug discovery and/or drug validation, the chances are you want to access and retrieve data on several genes or several diseases. All at the same time. To do this, you would access Open Targets in a programmatic way, wouldn’t you?
Our public REST (REpresentation State Transfer) API is what you would be looking for. Easy access to our data via one of the following:
- Internet browser (using HTTPS)
- Command line (e.g. CURL)
- With any programming language (e.g. Python, R)
Note: Not a bioinformatician? Not to worry! You don’t need to be one to access larger chunks of data from our API. If you are wet-lab scientists with no programming skills (like me), you can give the Open Targets REST API a go too, using the internet browser (see below).
But how would you go about doing that?
- With a browser, you can simply copy and paste the URL in the URL bar in your favourite internet browser (e.g. Firefox, Google Chrome, Safari).
For example, if you paste in the location https://api.opentargets.io/v3/platform/public/utils/stats in the URL bar, you will retrieve the statistics as per the latest release of the Open Targets Platform.
That URL will give you the number of targets (i.e. genes), the number of diseases and the number of somatic mutations we have to associate genes to cancer, plus much more.
Check our API collection of blog posts for more examples and use cases.
- With a terminal window, you can access our API using command lines such as CURL e.g.
- If you know R or Python, you can use our R and Python clients.
Whether you use the internet browser, a terminal window or our clients, let’s have a look at this use case:
Franke et al (2006) have found three genes associated with Congenital stationary night blindness: ENSG00000163914, ENSG00000114349 and ENSG00000133256.
"How can I find out all diseases (besides Congenital stationary night blindness) associated with those three Ensembl gene IDs?"
"Which diseases have got the highest overall association score for each of those three genes?"
One option is:
"Can I download the above list in TAB format?"
Yes, you can. Just add ‘&format=tab’ to the previous URL and there you are.
Note: TAB is not the only format you can output the data from our API: we support XML and CSV too.
"I’m relatively new to REST URLs. How can I break them down?"
You will do so in three parts (server, endpoint parameters and optional parameters). Check this example:
Want extra help?
Check our Open Targets REST API documentation page for more details.
If you have questions or suggestions on our REST API or programmatic access, get in touch.