opentargets-py - Python client for the Open Targets Platform REST API

opentargets-py is the official python client for the Open Targets REST API.

This client allows you to query the API automatically handling all the calls and returning data in a pythonic way.

Main advantages of using the client versus querying the REST API directly:

  • Include wrappers for all public methods, with query validation
  • Tools for the most common calls (E.g. get data for a target gene symbol even if you do not know its Ensembl Gene Id)
  • Supports automatic retrieval of paginated results with an iterator pattern
  • Easily save query results as JSON, CSV or Excel file
  • Handles Authentication
  • Handles fair usage limits transparently
  • Follows HTTP cache as set by the REST API
  • Experimental HTTP2 support for better performance (beware the client library is in alpha)

This client is supported for Python 3.5 and higher. Works with lower versions (including python 2.7) on a best effort basis. Take a look at the Tutorial to get an idea of what you can do.


pip install opentargets

or directly from github

pip install git+git://

Get the source code (or make your own fork) on GitHub : opentargets/opentargets-py


Open Targets Support (