SOOT API Access

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
me.gonzalez674
Posts: 2
Joined: Wed Nov 19, 2025 10:23 pm America/New_York
Answers: 0

SOOT API Access

by me.gonzalez674 » Thu Feb 12, 2026 1:29 pm America/New_York

For a project we are trying to download SOOT data through the API in R or Python. As of right now, we can get the API to download the campaign, platform, etc. lists but according to the API instructions you have to activate your session to be able to actually download the files. How can we do this from R/Python? We are currently using the curl package in R if that is helpful. But we would also like to do this in Python eventually. Thanks!

Filters:

ASDC - rkey
Posts: 88
Joined: Thu Dec 12, 2019 1:20 pm America/New_York
Answers: 1
Endorsed: 6 times

Re: SOOT API Access

by ASDC - rkey » Fri Feb 13, 2026 3:31 pm America/New_York

Please be advised the SOOT team is aware of your request and currently working on a solution.

ASDC - jennifer.tindell
Subject Matter Expert
Subject Matter Expert
Posts: 46
Joined: Wed Mar 13, 2019 12:51 pm America/New_York
Answers: 2

Re: SOOT API Access

by ASDC - jennifer.tindell » Thu Feb 19, 2026 1:27 pm America/New_York

The following Python code demonstrates how to authenticate the user and download a single file or a set of files for a dataID, platform and year. Before running this script, you will need to create the .urs_cookies file as explained on this page https://urs.earthdata.nasa.gov/documentation/for_users/data_access/curl_and_wget

Code: Select all

import requests
from http.cookiejar import MozillaCookieJar
from pathlib import Path

auth_url = "http://asdc.larc.nasa.gov/soot-api/Authenticate/user"
# To download all files for the ACTIVATE-TRACEGAS-CO dataID for the HU25 platform in 2021
get_file_url = "https://asdc.larc.nasa.gov/soot-api/data_files/downloadDataIDFiles?dataID=ACTIVATE-TRACEGAS-CO&platform=HU25&year=2021"

# To download 1 specific file
# get_file_url = "http://asdc.larc.nasa.gov/soot-api/data_files/downloadFiles?filenames=ACTIVATE-LegFlags_HU25_20220118_R0.ict"

# First, create the .urs_cookies file. Instructions here https://urs.earthdata.nasa.gov/documentation/for_users/data_access/curl_and_wget
#
# Define the path to your cookie file and load them
cookie_file_path = Path('.urs_cookies')
cookies = MozillaCookieJar(cookie_file_path)
cookies.load(ignore_expires=True)

# Create a session and update its cookies with the loaded cookies
session = requests.Session()
session.cookies.update(cookies)

# Now all requests made with this session will use the cookies from the file.
# Authorize the user and then download the file(s)
response = session.get(auth_url)
if response.status_code == 200:
    print('User authorized')
    response = session.get(get_file_url)
    if response.status_code == 200:
        with open('data.zip', 'wb') as f:
            f.write(response.content)
        print('Data downloaded to data.zip')
    else:
        print('Unable to download files. Response code {response.status_code}')
else:
    print('User not authorized')
Please reach back out to us if you have additional questions. Happy downloading!

me.gonzalez674
Posts: 2
Joined: Wed Nov 19, 2025 10:23 pm America/New_York
Answers: 0

Re: SOOT API Access

by me.gonzalez674 » Thu Feb 19, 2026 4:22 pm America/New_York

Thank you!

Post Reply