FIRMS API Tutorial – pd.read_json Not Working as Expected
Posted: Mon May 26, 2025 6:05 pm America/New_York
Hello,
I’m currently working through the FIRMS API tutorial provided at:
https://firms.modaps.eosdis.nasa.gov/content/academy/data_api/firms_api_use.html
I encountered an issue when using the line:
df = pd.read_json(url, typ='series')
This resulted in an error and did not return the expected output. After some debugging, I tried retrieving the same URL using the requests library and got the following raw response:
{
"transaction_limit": 5000,
"current_transactions": 0,
"transaction_interval": "10 minutes"
}
It seems like the API is returning a valid JSON object, but the format may not be compatible with the pd.read_json(..., typ='series') method as currently shown in the tutorial.
Replacing it with this worked as expected:
import requests
response = requests.get(url)
data = response.json()
df = pd.Series(data)
I wanted to flag this in case others run into the same problem. Would you recommend updating the tutorial or adding a note for users encountering this issue?
Thank you.
I’m currently working through the FIRMS API tutorial provided at:
https://firms.modaps.eosdis.nasa.gov/content/academy/data_api/firms_api_use.html
I encountered an issue when using the line:
df = pd.read_json(url, typ='series')
This resulted in an error and did not return the expected output. After some debugging, I tried retrieving the same URL using the requests library and got the following raw response:
{
"transaction_limit": 5000,
"current_transactions": 0,
"transaction_interval": "10 minutes"
}
It seems like the API is returning a valid JSON object, but the format may not be compatible with the pd.read_json(..., typ='series') method as currently shown in the tutorial.
Replacing it with this worked as expected:
import requests
response = requests.get(url)
data = response.json()
df = pd.Series(data)
I wanted to flag this in case others run into the same problem. Would you recommend updating the tutorial or adding a note for users encountering this issue?
Thank you.