Skip to content

Instantly share code, notes, and snippets.

@caalle
Last active March 15, 2020 19:53
Show Gist options
  • Select an option

  • Save caalle/6b1103a0c246ad7fc4fa41b8ffe58abd to your computer and use it in GitHub Desktop.

Select an option

Save caalle/6b1103a0c246ad7fc4fa41b8ffe58abd to your computer and use it in GitHub Desktop.
Fetch forecast for coordinate
import requests
response = requests.get(
'https://api.stormglass.io/v2/weather/point',
params={
'lat': 58.5,
'lng': 17.8,
'params': 'waveHeight,wavePeriod,swellHeight,swellDirection,windSpeed'
},
headers={
'Authorization': 'YOUR API KEY' # Get your at https://stormglass.io
}
)
# Do something with response data.
json_data = response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment