Skip to content

Authenticate with Earthdata Login

Important

You will need a NASA Earthdata Login account to download or stream NASA Earthdata. To obtain a NASA Earthdata Login account , please follow the instructions at NASA EDL

Once you have a NASA Earthdata Login account you can use earthaccess.login to authenticate.

import earthaccess

auth = earthaccess.login()

By default earthaccess.login will try several strategies to get your login credentials. First, it will look to see if your Earthdata Login credentials are set as environment variables EARTHDATA_USERNAME and EARTHDATA_PASSWORD. Next, it will look to see if you have a .netrc file with your Earthdata Login credentials. If none of these strategies are available, you will be prompted to enter your username and password.

See the Authentication explanation page for more details.