Thank you, Paul. I am new to this whole process of working with an API...steep learning curve!
I am trying to get the first example GET command at
developer.nrel.gov/docs/wind/wind-toolkit/offshore-hawaii-download/#examples to work.
I got ChatGPT to convert the command to Python
I changed the email in the code to mine.
That gives me the Python code below. I put it in a file and ran it using Python3 on my Mac. It generates a 404 error.
The one thing that sticks out to me is that there is no actual HTTP address for the url, it's just a path.
If you have any insight on what I should enter for the server address, (or any other advice) I would be grateful!
- John
___________
import requests
url = "
https://??????/api/wind-toolkit/v2/wind/offshore-hawaii-download.json"
params = {
"wkt": "POLYGON((-130.756145509839060 48.75520578942107,-130.75571635639668 48.75520578942107,-130.75571635639668 48.75485477666326,-130.75614550983906 48.75485477666326,-130.75614550983906 48.75520578942107))",
"attributes": "winddirection_180m",
"names": "2017",
"utc": "false",
"leap_day": "true",
"email": "
This email address is being protected from spambots. You need JavaScript enabled to view it."
}
response = requests.get(url, params=params)
if response.status_code == 200:
data = response.json() # Assuming the response is in JSON format
# Process the data as needed
else:
print(f"Request failed with status code {response.status_code}")