swrobel / meta-surf-forecast

🌊 Modern swell buoy charts + Aggregated surf forecast from Surfline & Spitcast APIs
https://metasurfforecast.com
MIT License
308 stars 60 forks source link

Quick question #39

Closed ryan-neil closed 3 years ago

ryan-neil commented 3 years ago

Hey Stefan!

This isn't necessarily an issue but I was wondering if you could help me with something. So I'm just messing around with Surfline's API and I was wondering if it was possible to access all their surf spots through the API.

I guess more specifically, is it possible to loop through all the surf spots by name and not some long id number?

For example, I'm able to access all the spots in the region of Oahu with:

const res = await fetch("https://services.surfline.com/kbyg/spots/nearby?spotId=5842041f4e65fad6a7708df5");

const data = await res.json();

const oahuSpots = data.data.spots;
console.log(oahuSpots);

How would I go about accessing all the spots in the world? Is this possible for the public?

Thanks in advance!

swrobel commented 3 years ago

I know others have mapped out the full v2 API, or at least the parts of it that list all of the spots. I believe that capability may exist, but I haven't used it. Try searching github for services.surfline.com to look for other repos. Good luck!