Last active
March 15, 2020 19:52
-
-
Save caalle/b5f1dd9630886f41cc5fccdf385687d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const lat = 45.7; | |
| const lng = -6.0; | |
| const params = [ | |
| 'currentDirection', 'currentSpeed', | |
| 'iceCover', 'seaLevel', | |
| 'visiblity', 'waterTemperature', | |
| 'windDirection', 'windSpeed' 'gust', | |
| 'swellDirection', 'swellHeight', 'swellPeriod', | |
| 'waveDirection','waveHeight', 'wavePeriod', | |
| 'windWaveDirection', 'windWaveHeight', 'windWavePeriod' | |
| ].join(','); | |
| fetch(`https://api.stormglass.io/v2/weather/point?lat=${lat}&lng=${lng}¶ms=${params}`, { | |
| headers: { | |
| // Get your key by signing up. | |
| 'Authorization': '2c16411d-8f11-4565-98a8-321c4e3eef9c' | |
| } | |
| }).then((response) => response.json()).then((jsonData) => { | |
| // Do something with response data. | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment