NOAA is now on its second version of the NOAA web API. APIs are useful because you can essentially query a web service, using requests
and a python dict
of arguments that describe what you want. @Cravden has made a nice class that will get you started on GitHub. NOAA has nice documentation describing what you can get and how (you need to give them and email to get an access token). Other climate data aggregators also do this kind of thing.
Something as simple as this might get you started:
import requests
def get_noaa_data(url, data_type, header):
r = requests.get(url, data_type, headers=header)
print(r)
if __name__ == '__main__':
token = 'gotowebsitetorequesttoken'
creds = dict(token=token)
dtype = 'dataset'
url = 'https://www.ncdc.noaa.gov/cdo-web/api/v2/'
get_noaa_data(url, dtype, creds)
If you are going for thousands of places, you might consider downloading gridded data, making a shapefile of the points, then extracting raster values to an attribute table as done here.