Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api_key parameter to DoSearch method #9

Closed
hscells opened this issue Jun 15, 2018 · 3 comments
Closed

Add api_key parameter to DoSearch method #9

hscells opened this issue Jun 15, 2018 · 3 comments

Comments

@hscells
Copy link
Contributor

hscells commented Jun 15, 2018

Recently ncbi added an api_key that allows users to register their tools to issue more requests. This should be included in the parameters to DoSearch.

https://www.ncbi.nlm.nih.gov/books/NBK25499/#chapter4.api_key__enforced_in_May_2018

If you don't mind I might be able to do this myself, I'm still learning how to use the tool.

Thank you!

@kortschak
Copy link
Member

kortschak commented Jun 15, 2018

You are welcome to send a PR. Note that the requirement doesn't actually hit us since it applies to "sites that post more than 3 requests per second" and there is an enforced limit of 3 requests per second, however it is a worthwhile addition.

BTW This is not limited to DoSearch.

@kortschak
Copy link
Member

The easy fix is to add the following line to Parameters

APIKey string `param:"api_key"`

This will fix all functions that take *Parameters, but I imagine the limits apply to Info, Post, Global, Spell and CitMatch which don't accept that parameter.

@hscells
Copy link
Contributor Author

hscells commented Jun 15, 2018

I did not notice that this utility contained the limit, that is a very nice addition!

That sounds like a fairly simple fix 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants