3

I am using the USDA food database in an app, however I will not being able to use it in the live version because of the API request limitations. One workaround would be to give each registered user their own API key, which would easily suffice the API limitations. Is there a way to programmatically get an API key for each user, using the email they submitted when they signed up on my app?

2

Not possible, not respectful of API provider, and borderline unethical:

Not possible:
I bet anything that is a violation of USDA API's terms of use. [EDIT] Since they recommended it, my bet was wrong.
Most authentication has to be verified by the user. While you can get them to accept/verify, that is a bottleneck that while at the very least cause a delay, at worst never be executed. Either way, you still can't automate answering their email.

Not Respectful:
Willfully gaming a dot gov open data service takes advantage of a system designed for all citizens to use. The reason(s) behind the limit could be anything, including hardware/architecture/code that is non-performant, out-dated, etc. Hogging the service is not fair to everyone else.

Borderline unethical:
Unethical because you are taking advantage of a service designed for all, not you. Borderline because its an open data dot gov website/api, and in my experience limitations on use/service/access placed by dot gov departments/agencies are typically bogus. That is not to say they all are, far from it. But I'd say 4/6 times I've encountered something similar, the reasonings behind the 4 are not valid.

[EDIT] This is a very interesting idea of how to get around API limits...Since the are recommending that, I would set up your site with a login that required prior API registration, and either integrate the API into the login to get their key, or have them enter their key on sign up.

| improve this answer | |
  • 2
    OK well this wasnt my idea, it was someone who works at the API who told me to do this. I just didn't know how to go about doing it " Thank you for your interest in the API for the USDA National Nutrient Database for Standard Reference. We feel that the current rate limit is sufficient for individual users. If you engineer your app to request a key for each user – all they need is the users’ email, the app then acquires a key and stores it for use by the app. This then gives each instance of the app a rate limit of 1000/hr." – PrestigeWW Jul 1 '16 at 6:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.