NSRDB API HTTP request error

Forums: 

Hi everyone,

I was excited by the last email sent by NSRDB related to the use of the API. I was making some tests but have some issues. I was basically copying the example at https://nsrdb.nrel.gov/api-instructions , but it seems the url format is incorrect, since I am returned an HTTP 400 Error. I am executing the example in iPython Notebook using pandas.

This is the definition of the URL, which basically is copy+paste of the example.

url ='http://developer.nrel.gov/api/solar/nsrdb_0512_download.csv?wkt=POINT({lon}%20{lat})&names={year}&leap_day={leap}&interval={interval}&utc={utc}&full_name={name}&email={email}&affiliation={affiliation}&mailing_list={mailing_list}&reason={reason}&api_key={api}&attributes={attr}'.format(year=year, lat=lat, lon=lon, leap=leap_year, interval=interval, utc=utc, name=your_name, email=your_email, mailing_list=mailing_list, affiliation=your_affiliation, reason=reason_for_use, api=api_key, attr=attributes)

The url is correctly parsed, but when trying to access the data with:

info = pd.read_csv(url, nrows=1)

I am returned:

HTTPError: HTTP Error 400: BAD_REQUEST

I have correctly set my API Key, and all other data. I will appreciate your support. W