Get Started with NASA APIs

Set up your credentials to get the API key for NASA APIs.

Why do we need an API key?

Authentication is not necessary to call the NASA APIs. We can use DEMO_KEY as the API key with our calls. However, there is a limit of 30 requests per hour on the number of calls we can make using the DEMO_KEY as the API key.

Since we'll use these APIs in our application, we want to extend this limit as much as possible. The API key helps us extend that limit. For user-specific API keys, the hourly limit is 1000 requests.

Sign up to get an API key

To get an API key, you'll need to perform the following steps:

  • Go to the NASA APIs website.
  • Click the "Generate API Key" tab.
  • Fill in the required information and click "Signup" to create an account.
  • After signing up successfully, you'll be redirected to a page containing your required API key.

Next, save this API key, click the "Edit" button, paste the API key in the given field, and then click the "Save" button. This API key will be used throughout this course.

The code below checks the validity of the API key. The code is hidden as we don’t need to go into the detail of its implementation. Click the "Run" button to check the validity of the API key.

validation() # A function that checks the validity of the API key using hidden code

Once we have a valid API key, we can use it while calling the NASA APIs.