UPDATE: The government generously increased the API request limit to 1,000 per IP per hour. This question is now obsolete.

api.data.gov allows for up to 1,000 API requests per user per hour, which is plenty. However, each user requires their own API Key. How can I request a key for them without asking a user to register with api.data.gov?

The API I am using says:

"If you engineer your app to request a key for each user during your registration process – 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."

But they do not say how to create a key for those users.

The underlying technology is API Umbrella, but their documentation is not clear to me in programatically generating a key for users either.

How can I create a new key for each of my users, which could number in the thousands?

4 Answers 4


We have set a rate limit of 1000 requests/hr per IP rather than key. Our documentation now reflects this change.


On the USDA Food Composition Database page you posted, there's a form to create an account via their website. That form submits a HTTP POST message to the following link:


(note the API key that's in this link is probably tied to the USDA's user creation privilege - this might change in the future)

If you submit a POST message with the following parameters, it should respond with an API key for that user (replacing "firstname", "lastname" and "[email protected]" with the appropriate fields for your users:

I'm not a lawyer either, so I don't know how legal this method is. You might be able to replace the USDA's API key "D8IbNeJvK7hjqvJ8hMzuAR5Gfl3FLF1YSiiAK0fy" with your API key if it doesn't work in the future.

EDIT: looking at an answer to this question, you might be able to make unauthenticated API requests to some US government APIs without a key, but usage limits are lower.


I've asked the team at api.data.gov to respond.


api.data.gov doesn't actually support end users programmatically creating API keys at this time. Sorry for the mixup (technically the API exists, as Anthony Joseph's answer points out, but this is only intended for federal agency partners right now). We'll followup in more detail with you and the USDA team via email about potential alternatives for higher rate limits.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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