Ski Resort Forecast

FREE
By Joey Kyber | Updated vor einem Monat | Weather
Popularity

9.5 / 10

Latency

954ms

Service Level

90%

Health Check

N/A

Back to All Discussions

Data not consistent

Rapid account: Alastairfarman
alastairfarman
vor einem Jahr

Hey, the hourly and snow condition APIs were working, and then gave this data for both:

{
“topSnowDepth”: “0in”,
“botSnowDepth”: “0in”,
“freshSnowfall”: null,
“lastSnowfallDate”: “—”,
“basicInfo”: {
“region”: “USA - Wyoming”,
“name”: “Jackson Hole”,
“url”: “https://www.snow-forecast.com/resorts/Jackson-Hole/6day/top”,
“topLiftElevation”: “10447ft”,
“midLiftElevation”: “8380ft”,
“botLiftElevation”: “6309ft”,
“lat”: “-110.85”,
“lon”: “43.60”
}
}

it happened once which confused me, but then it started working again. This is the second time in maybe 3 hours that it has worked and then not worked (with no changes my end). This is in my code and in the rapid API test.

Nice API by the way! Great for my little interactive piste map

Thanks

Rapid account: Joeykyber
joeykyber Commented vor 7 Monaten

@SJVARIJAO You’re welcome! And yes, that’s basically all it does. The client sends a resort name to the API, then the API scrapes Google to find the correct snow-forecast.com URL (this method allows most resorts to be found even with incorrect spelling, which means it’d work great in sites that have the user searching for resorts themselves). If a URL is found, it will then scrape that page and send the data back to the client in an organized object. You can include the optional query parameters in the fetch request, which will result in a smaller response object. The more optional parameters you use, the quicker the response will be. Also, the results are cached for a certain amount of time, so if you search for the same resort like 10 times in a row, the last 9 responses will be basically instantaneous.

Rapid account: SJVARIJAO
SJVARIJAO Commented vor 7 Monaten

Hey for some reason the website won’t let me create a new post so I am seeing if I can tag onto this one

Hey, Thank you so much for making this. I am fairly new to software development so I am hoping to use this API in one of my projects. My question is with regards to the API itself. I see that the URL you are getting the info from is snow-forecast.com. Does your API just scrape the info from the website and deliver it back to the User in a code-readable way? Or is there something else that I am missing.

Rapid account: Joeykyber
joeykyber Commented vor einem Jahr

Woah that’s really cool man! Is that your local mountain? This API was actually supposed to initially just be a portfolio piece as well! And no problem

Hmm, that’s odd. I’ll do some more testing and see if I can recreate the error. Is it still the same issue, or is it something else? I don’t think refreshing the page over and over would overload the server. Sending a bunch of requests in parallel might do it, but even then it wouldn’t lead to inconsistent results. It would likely just tank the system and you’d get an error.

Rapid account: Alastairfarman
alastairfarman Commented vor einem Jahr

hey Joey, it’s not finished yet but its in an OK state at the moment:

https://alastairfarman.github.io/piste/

still seeing some data come through inconsistently BUT I wonder if in production I’m accidentally making way too many requests as a result of refreshing/live updates (I’m new to development so I’m still navigating correct practices with these things) - however it works more often than not and is a huge help for my little project! This is a portfolio piece so having any data in the first place is a blessing. thanks again

Rapid account: Alastairfarman
alastairfarman Commented vor einem Jahr

Amazing, wasn’t expecting such a fast response! Will definitely link when I’ve finished

appreciate it

Rapid account: Joeykyber
joeykyber Commented vor einem Jahr

I’ve fixed the issue. Thanks again and please let me know if you notice any other problems!

Rapid account: Joeykyber
joeykyber Commented vor einem Jahr

Hey! Thank you for bringing this to my attention. I was able to recreate this error by sending a request to the current snow conditions endpoint and then sending a request to the hourly endpoint with the same resort and the same optional parameters.

It looks like when the resort and the optional parameters are exactly the same as a recent request, it returns the cached result for that previous request, even if the endpoints were different.

I will try to get this issue resolved by tomorrow and will let you know when I do.

And thank you! I’d love to check out your web app/site if it’s hosted somewhere. I like seeing the different ways people are using the API!

Join in the discussion - add comment below:

Login / Signup to post new comments