Question: Access Pathwaycommons Api
gravatar for wlq121
8.1 years ago by
wlq12120 wrote:

Hi all,

I want to incorporate pathway search into my routine program for network analysis. As a starting point, I want to use the API service of PathwayCommons. I am an API newbie. From reading some API instruction webpages, I think that I will need the following information to setup my API search

  1. Is PathwayCommons API SOAP- or REST-based?
  2. What is the URL of PathwayCommons API server?
  3. What language can I use? Can I use Python to access API?

However, I did not find this information on the PathwayCommons website ( Does anyone here have experience of using PathwayCommons API? Would you mind giving me some guidance?

Your help is much appreciated.

Thank you, Wendy

pathway data api • 1.5k views
ADD COMMENTlink modified 4.5 years ago by Biostar ♦♦ 20 • written 8.1 years ago by wlq12120

I could find all the needed information on . Where's the problem ? 1) REST API 2) 3) whatever you want.

ADD REPLYlink written 8.1 years ago by Pierre Lindenbaum129k
gravatar for Joachim
8.1 years ago by
San Francisco, California
Joachim2.9k wrote:


To extend a bit on Pierre's comment:


REST, because you access the API through parametrized URLs. SOAP would have some form of XML message that you need to send,

PathwayCommons API URL

The base URL for making RESTful requests is:

In order to get the API to do anything, you need to add some arguments to the URL though. For example:
  1. cmd: command for the API
  2. version: API version to use, which will be mostly 2.0, but is 3.0 for the command get_neighbors
  3. q: I am quoting the documentation here: "a comma separated list of internal or external identifiers (IDs), used to identify the physical entities of interest"
  4. input_id_type: the type of IDs you are using; a list of valid IDs is listed here:

You can execute a query in your BASH as follows:

$ curl -s ''
Database:ID Pathway_Name    Pathway_Database_Name   CPATH_ID
UNIPROT:O14763  Caspase-8 is formed from procaspase-8   REACTOME    486288
UNIPROT:O14763  TRAIL signaling REACTOME    486289
UNIPROT:O14763  Activation of Pro-Caspase 8 REACTOME    486291
UNIPROT:O14763  Death Receptor Signalling   REACTOME    486300
UNIPROT:O14763  Extrinsic Pathway for Apoptosis REACTOME    486301
UNIPROT:O14763  Apoptosis   REACTOME    486302


It is possible to query the API with curl from the command line, or pretty much any programming language which has libraries for making HTTP requests. Here is a simple snippet how to get the same information from above via Ruby. Save the following text as api.rb:

require 'net/http'
require 'uri'

url = URI.parse('')

res = Net::HTTP.start(, url.port) {|http|

puts res.body

Now you can run this Ruby script in your shell as:

ruby api.rb

Hope that helps,


ADD COMMENTlink written 8.1 years ago by Joachim2.9k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1650 users visited in the last hour