API Documentation

Programmatic access to ExPheWas results is provided through a web API. This makes is easy to use any programming language or the command line (e.g. using cURL on UNIX-based systems). Every entry from the API documentation is accompanied by a dynamically populated example (blue buttons in the table below). Clicking the "Example" button will show a sample request using the curl command along with live results from the API. For Python users, we suggest looking at the requests library to facilitate programmatic access. For now, all API endpoints use JSON as the content-type. This format is widely supported by modern programming languages. For specific applications that may require high throughput access, contact the authors for the possibility of deploying local instances.

We provide provide multiple simple examples (notebooks) which uses the API.

The API root is: 'https://exphewas.ca/v1/api'

Resource Description Parameters
GET /metadata Get information for the data release currently available through the API.
Query results by outcome
GET /outcome Get a list of outcomes
GET /outcome/<id>/results Get all gene association statistics for an outcome.
  • id The outcome identifier
  • analysis_subset Sample subset (either BOTH, FEMALE_ONLY or MALE_ONLY, default is BOTH).
GET /outcome/venn Get number of shared associated genes between two outcomes.
  • outcomes List of outcomes delimited by ';'
  • q The Q-value threshold to call an association 'significant' (default: 0.05)
Query results by gene and utilities for cross referencing
GET /gene Get name strand and location of a gene.
GET /gene/name/<name> Get gene information by name. Used for cross-referencing.
GET /gene/ensembl/<ensg> Get gene information by Ensembl ID. Used for cross-referencing.
GET /gene/<ensg>/results Get results for a gene given its Ensembl ID.
GET /gene/<ensg>/xrefs Get cross references to other external databases from an Ensembl gene ID.
cis-MR analysis
GET /cisMR Perform a cis-MR analysis.
  • ensembl_id The gene's Ensembl ID.
  • analysis_subset Sample subset (either BOTH, FEMALE_ONLY or MALE_ONLY, default is BOTH).
  • exposure_id the exposure ID.
  • exposure_type the exposure type (either CONTINUOUS_VARIABLE, CV_ENDPOINTS, SELF_REPORTED or PHECODES).
  • outcome_id the outcome ID.
  • outcome_type the outcome type (either CONTINUOUS_VARIABLE, CV_ENDPOINTS, SELF_REPORTED or PHECODES).