2

Having trouble getting NOAA API to give the results I want. I have found the data that I would like to use but I cannot get the API to find it. I want to be able to search the records for the average first frost date based on zipcode. The data should be in the NORMAL_ANN dataset. When I use "https://www.ncdc.noaa.gov/cdo-web/api/v2/data?datasetid=NORMAL_ANN"; I get a bad request error.

Any ideas on what am I doing wrong? I can get the API to return objects when I use https://www.ncdc.noaa.gov/cdo-web/api/v2/datasets (and I confirmed that NORMAL_ANN is a valid dataset).

Thanks

  • are you including the required `startdate` and `enddate` parameters? https://www.ncdc.noaa.gov/cdo-web/webservices/v2#data – Jaromanda X Aug 24 '17 at 06:19
  • i did not realize they were required, missed that in the documentation. Now when I add in `startdate` and `enddate` i can pull data but it is not the data I thought it would be. I am trying to access the data represented here: https://www1.ncdc.noaa.gov/pub/data/normals/1981-2010/supplemental/products/agricultural/ann-tmin-prbfst-t32Fp90.txt using this code `"https://www.ncdc.noaa.gov/cdo-web/api/v2/data?datasetid=NORMAL_ANN&datatypeid=ANN-TMIN-PRBFST-T32FP90&startdate=2001-01-01&enddate=2010-12-31&stationid=GHCND:USC00053553";` and I am not getting the date of the frost to display. Any ideas? – Brennen Murphy Aug 24 '17 at 06:52
  • `Any ideas` - I don't have access to the data, so perhaps you need to read the API documentation more? I really don't know – Jaromanda X Aug 24 '17 at 06:58
  • If you found the answer, can you let me know as well. What kind of REST call can I make to get a data which is similar to this?https://www.almanac.com/gardening/frostdates/zipcode/75053 I want to have the REST call structured such that I add the zipcode, and I obtain the spring and fall frost dates? Simple – kdas Mar 24 '18 at 01:16

1 Answers1

2

Ok I found the answer. For 50% probability of first occurence of 28F, the below query is able to fetch a result

https://www.ncdc.noaa.gov/cdo-web/api/v2/data?datasetid=NORMAL_ANN&datatypeid=ANN-TMIN-PRBFST-T28FP50&startdate=2010-01-01&enddate=2010-01-01&&stationid=GHCND:USC00047821

The same data can be obtained from their UI tool here https://www.ncdc.noaa.gov/cdo-web/datasets/NORMAL_ANN/stations/GHCND:USC00047821/detail

The rest query returns result like this:

{
    "metadata": {
        "resultset": {
            "offset": 1,
            "count": 1,
            "limit": 25
        }
    },
    "results": [
        {
            "date": "2010-01-01T00:00:00",
            "datatype": "ANN-TMIN-PRBFST-T28FP50",
            "station": "GHCND:USC00047821",
            "attributes": "S",
            "value": 361
        }
    ]
}

How to interpret? Value 361 implies 361st day from the start of calendar year which would be 12/27. This confirms with the actual data. To view the actual data, click on "view data" for the station(I used San Jose, CA).

kdas
  • 602
  • 2
  • 7
  • 22