Hi. Following the tutorial found here
https://disc.gsfc.nasa.gov/information/howto?title=How%20to%20Access%20the%20%22Giovanni%20in%20the%20Cloud:%20Time%20Series%22%20Service%20Using%20Python
I was trying to run a script to get time-series of GLDAS_NOAH025_3H_2_1_Tair_f_inst over Brazil region but the Giovanni API was returning empty.
here's part of the script that was used
```
auth = earthaccess.login()
token = earthaccess.get_edl_token()['access_token']
time_series_url = "https://api.giovanni.earthdata.nasa.gov/timeseries"
query_parameters = {
"data":data,
"location":"[{},{}]".format(round(lat, 4), round(lon, 4)),
"time":"{}/{}".format(time_start,time_end)
}
headers = {
'Authorization': f'Bearer {token}'
}
response=requests.get(time_series_url, params=query_parameters, headers=headers)
```
according to the script in the tutorial it's because of "The returned CSV is empty.
Please ensure that your subsetting bounds are within the extent of your dataset
or that your .netrc file is stored and contains valid credentials."
However, when I revert the configuration to use the same parameter as the one in tutorial, I still get the same error.
Is there anything I could do to fix this?
(for the context, I was planning to basically do an area-average time-series from Python script)
Thank you
Unable to run API call to Giovanni
-
GES DISC - cbattisto
- Subject Matter Expert

- Posts: 30
- Joined: Wed Feb 16, 2022 4:38 pm America/New_York
Re: Unable to run API call to Giovanni
Hello,
The time series service will only work with single points passed; it will not return an area-averaged time series or a spatial subset. If you would like to spatially subset, please use this harmony-py tutorial: https://github.com/nasa/gesdisc-tutorials/blob/main/notebooks/How_to_Subset_and_Download_L234_Data_Using_Python.ipynb.
Please run the original, unedited tutorial and try again. There were some interruptions with the Earthdata Login service and CMR recently which could have impacted your access. Additionally, please make sure that you are entering your Earthdata Login credentials correctly when prompted.
The time series service will only work with single points passed; it will not return an area-averaged time series or a spatial subset. If you would like to spatially subset, please use this harmony-py tutorial: https://github.com/nasa/gesdisc-tutorials/blob/main/notebooks/How_to_Subset_and_Download_L234_Data_Using_Python.ipynb.
Please run the original, unedited tutorial and try again. There were some interruptions with the Earthdata Login service and CMR recently which could have impacted your access. Additionally, please make sure that you are entering your Earthdata Login credentials correctly when prompted.
Re: Unable to run API call to Giovanni
GES DISC - cbattisto wrote:
> Hello,
>
> The time series service will only work with single points passed; it will
> not return an area-averaged time series or a spatial subset. If you would
> like to spatially subset, please use this harmony-py tutorial:
> https://github.com/nasa/gesdisc-tutorials/blob/main/notebooks/How_to_Subset_and_Download_L234_Data_Using_Python.ipynb.
>
> Please run the original, unedited tutorial and try again. There were some
> interruptions with the Earthdata Login service and CMR recently which could
> have impacted your access. Additionally, please make sure that you are
> entering your Earthdata Login credentials correctly when prompted.
Thanks for the response.
Unfortunately, I ran the unedited tutorial again and still get the same error.
printing the response.text from
response=requests.get(time_series_url, params=query_parameters, headers=headers)
get me the
{
"code": "",
"message": "",
"context": ""
}
As for the 2nd tutorial link you mentioned, I was not able to run it as well
when calling the part
# Build request
request = Request(
collection=Collection(concept_id),
spatial=bbox,
temporal=temporal,
dimensions=[lev_dimension],
variables=variables
)
try:
# Check if the request syntax is valid
if not request.is_valid():
print("Local validation error:", request.validation_messages)
...
This gives me the error "Harmony request failed: Expecting value: line 1 column 1 (char 0)"
As a side note, I was able to use the Giovanni webservice https://giovanni.gsfc.nasa.gov/giovanni/
so, I think my credentials should still be valid?
> Hello,
>
> The time series service will only work with single points passed; it will
> not return an area-averaged time series or a spatial subset. If you would
> like to spatially subset, please use this harmony-py tutorial:
> https://github.com/nasa/gesdisc-tutorials/blob/main/notebooks/How_to_Subset_and_Download_L234_Data_Using_Python.ipynb.
>
> Please run the original, unedited tutorial and try again. There were some
> interruptions with the Earthdata Login service and CMR recently which could
> have impacted your access. Additionally, please make sure that you are
> entering your Earthdata Login credentials correctly when prompted.
Thanks for the response.
Unfortunately, I ran the unedited tutorial again and still get the same error.
printing the response.text from
response=requests.get(time_series_url, params=query_parameters, headers=headers)
get me the
{
"code": "",
"message": "",
"context": ""
}
As for the 2nd tutorial link you mentioned, I was not able to run it as well
when calling the part
# Build request
request = Request(
collection=Collection(concept_id),
spatial=bbox,
temporal=temporal,
dimensions=[lev_dimension],
variables=variables
)
try:
# Check if the request syntax is valid
if not request.is_valid():
print("Local validation error:", request.validation_messages)
...
This gives me the error "Harmony request failed: Expecting value: line 1 column 1 (char 0)"
As a side note, I was able to use the Giovanni webservice https://giovanni.gsfc.nasa.gov/giovanni/
so, I think my credentials should still be valid?