Question: Accessing UNIPROT using REST API
gravatar for Natasha
23 months ago by
Natasha30 wrote:

Hello Everyone, I would like to programmatically access the entries(uniprot id,entry name,protein name,gene name,kinetics) for a given EC Number and organism of interest, using python.

import urllib,urllib2

url = ''

params = {
'query':'P13368 P20806 Q9UM73 P97793 Q17192'

data = urllib.urlencode(params)
request = urllib2.Request(url, data)
contact = "" # Please set your email address here to help us debug in case of problems.
request.add_header('User-Agent', 'Python %s' % contact)
response = urllib2.urlopen(request)
page =

I had a look at the above python code given here.However,I couldn't really understand how the code should be modified to download the search result(here) in xml format .

In the above code my query is ------'query':'' and format is -----"format": 'xml' How do we add the organism filter("Organism":'Homo sapiens') in the code and download the xml file of the serach result?

Many thanks,


ADD COMMENTlink modified 23 months ago by Elisabeth Gasteiger1.6k • written 23 months ago by Natasha30
gravatar for Elisabeth Gasteiger
23 months ago by
Elisabeth Gasteiger1.6k wrote:

The UniProt IDmapping doesn't actually support EC numbers. For performance reasons, databases where the mapping relationship to UniProtKB identifiers is one-to-many, e.g. GO, InterPro or PubMed, are not supported. There is a note about this in the help page

You can however build RESTful queries of the form

You could also use the tab-delimited format:,entry_name,protein_names,genes,comment(KINETICS)

ADD COMMENTlink written 23 months ago by Elisabeth Gasteiger1.6k
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: 1254 users visited in the last hour