[ensembl-dev] Duration of 403 error?

Melissa van Wieringen m.vanwieringen at omnigen.nl
Mon Jun 27 15:15:30 BST 2016


Hello,

While testing code for my internship, I *may* have overloaded your REST
API.
As a result, I suppose, I have been getting a 403 response. (HTTPError: 403
Client Error: Forbidden, "You are submitting far too many requests and have
been temporarily forbidden access to the service. Wait and retry with a
maximum of 15 requests per second." -
https://github.com/Ensembl/ensembl-rest/wiki/HTTP-Response-Codes)

While trying to figure out how long my access would be restricted, I
stumbled across HTTP Headers, which Ensembl REST supposedly provides. (
https://github.com/Ensembl/ensembl-rest/wiki/HTTP-Headers)
I have tried the following python code, but it doesn't provide any of the
'special' extras, as the waiting time or number of calls left.

server = "http://rest.ensembl.org"
site = server + ext.format(rsid=variant, downloadoption=option)
r = requests.get(site, headers={"Content-Type": "application/json"})
print(r.headers)
> CaseInsensitiveDict({'connection': 'close', 'content-type': 'text/html',
'cache-control': 'no-cache'})

My questions are: How long will my access to the Ensembl REST API be
restricted & How can I check X-RateLimit-Limit, X-RateLimit-Reset,
X-RateLimit-Period, X-RateLimit-Remaining myself?
Hoping to hear from you soon.

With kind regards,
Melissa van Wieringen,
Intern at Omnigen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20160627/1c8bdef3/attachment.html>


More information about the Dev mailing list