Getting Started with NASA APIs
Setting up our credentials to get an API key for NASA APIs.
We'll cover the following
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 on the requests per hour 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.
Sign up to get an API key
To get an API key, we'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, we'll be redirected to a page containing the required API key.
To 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 since we don't need to go into the details of its implementation. Click the "Run" button to check the validity of the API key.
check_validation()
Once we have a valid API key, we can use it to call the NASA APIs.