API key as query parameter

GET https://api.nasa.gov/planetary/apod?api_key={{api_key}}

Note: Sending sensitive information in the query string is arguably not secure, but you will likely come across this if you're working with public APIs. If you're building your own API, a better option is to send the API key as an Authorization header, as seen in the last example.

Sending an API key in the query string as part of the URL is a common practice.

Go to the NASA API portal, and sign up for an API key to access and use web services available on the Data.gov developer network. An API key is a required query parameter for this request, as seen under the Params tab. If you don't have a valid API key, you can browse the [saved examples]

Update your environment variable

[Update the environment variable] called api_key by adding your own API key, and hit Send.

Keep your environment variable private

If you're [sharing the environment] with your team in a team workspace, use the environment's initial value to share data with the team. Use the environment's current value to restrict this data to your session within the Qodex app.

Use your environment variable

You can access api_key using double curly braces in the text fields, like {{api_key}}, as seen under the Params tab. You can also access api_key using pm.environment.get('variableName') in the script areas, as seen under the Pre-request Script tab.

Request Params

KeyDatatypeRequiredDescription
api_keystring

RESPONSES

status: OK

{"date":"2020-06-02","explanation":"Humanity is under attack. The attack is not from large tentacle-flailing aliens, but from invaders so small they can barely be seen, and so strange they are not even clearly alive.  All over planet Earth, the human home world, DNA-based humans are being invaded by the RNA-based SARS-CoV2.  The virus, which creates a disease known as  COVID-19, specializes in reprogramming human cells into zombies that manufacture and release copies of itself.   Pictured here is a high magnification image of a human cell covered by attacking novel coronavirus SARS-CoV2 (orange).  Epic battles where two species square off in a fight to the death are not unusual on Earth, with several just involving humans typically ongoing at any time.  Even so, most humans are predicted to survive. After several years, humanity expects to win this war -- but only after millions of humans have died and trillions of coronaviruses have been destroyed.   Wash your hands: Tips for humans on how to survive this SARS-CoV2 assault","hdurl":"https://apod.nasa.gov/apod/image/2006/SarsCov2_Niaid_4096.jpg","media_type":"image","service_version":"v1","title":"Novel Coronavirus Attacks Humanity","url":"https://apod.nasa.gov/apod/image/2006/SarsCov2_Niaid_960.jpg"}