Request: OnTheSnow REST API

Hi all – I hope this is the right forum. Avid HA user here, not smart enough to create my own plugins. Onthesnow is a great site that tracks ski conditions around the world, and has a REST API with plenty of documentation. For those of us, could be an awesome addition for a dashboard, showing local stats on particular ski resorts.

Hoping someone finds this as awesome as I do… picturing a lovelace card similar to ‘weather’ showing ski conditions for a resort, plenty of fields available, particularly ahead of ski season!

REST API docs:
http://docs.clientservice.onthesnow.com/docs/index.html

Example fields:

  • Number of lifts open
  • Latest snowfall
  • Temperature
  • Snow depth at top/middle/base
  • Wind conditions
  • Webcams
  • Many more…

Would be a very cool addition, I wish I had the time/skills to try and figure it out myself, hoping this awesome community can pick up my slack.

@ seasideCT

Im trying to develop something based on this information.
but unfortunately it’s impossible to get access to this API.
In order to access you need create an account and generate your token.
and no one is responding there for account creation.

Have you reached them maybe?

@Medanko

Thanks for trying, unfortunately I tried reaching out a few months ago and never heard back…

I recently discovered the ‘scrape’ sensor. I am terrible at trying to solve this problem, hoping that someone can easily do it.

Is it possible to scrape onthesnow (specific mountains) using scrape sensor for specific attributes to include in my dashboard?

I am new to this and my code isn’t working – as an example, I’d like to pull the number of intermediate runs … web inspector shows the following:

36 of 36

My below code gives ‘unknown’

  - platform: scrape
    resource: https://www.onthesnow.com/colorado/copper-mountain-resort/skireport.html
    name: Copper Runs
    select: "p intermediate  value"
    index: 2

Thanks!

Did you ever make this happen?

Hi – I sort of forgot about this request and managed to make it through a few ski seasons. However, in the interim it looks like this API was built!

It looks like this might be the ticket, if we’re able to build a REST template to pull in the responses, looks cool.

I am able to successfully query the API and receive a response, see below. However, the response returns “8in” or “82in” as an example, is there a way to strip the “in” so we can get it into a proper numeric format?

- resource: https://ski-resort-forecast.p.rapidapi.com/Winter%20Park/snowConditions
  method: GET
  scan_interval: 86400
  headers:
    X-RapidAPI-Key: "MY API KEY"
    X-RapidAPI-Host: "ski-resort-forecast.p.rapidapi.com"
  params:
    units: "i"
  sensor:
    - name: "Winter Park Fresh Snow"
      value_template: "{{ value_json.freshSnowfall }}"
      #unit_of_measurement: Degrees
      unique_id: a2b80ad8-4c68-46e4-a755-fe46dfa2b930

Debug log of response:

2024-04-07 11:02:59.144 DEBUG (MainThread) [homeassistant.components.rest.data] Data fetched from resource: {"topSnowDepth":"82in","botSnowDepth":"81in","freshSnowfall":"8in","lastSnowfallDate":"6 Apr 2024","basicInfo":{"region":"USA - Colorado","name":"Winter Park","url":"https://www.snow-forecast.com/resorts/Winter-Park/6day/top","topLiftElevation":"12054ft","midLiftElevation":"10525ft","botLiftElevation":"8997ft","lat":"-105.77","lon":"39.88"}}

Round two, here is my final solution using the RapidAPI ski forecast – if someone can help me format the date of last snow into a proper date format, that would be great! The API (free) itself can be found at: Ski Resort Forecast API Documentation (joeykyber) | RapidAPI

- resource: https://ski-resort-forecast.p.rapidapi.com/Winter%20Park/snowConditions
  method: GET
  scan_interval: 43200
  headers:
    X-RapidAPI-Key: "MY API"
    X-RapidAPI-Host: "ski-resort-forecast.p.rapidapi.com"
  params:
    units: "i"
  sensor:
    - name: "Winter Park Fresh Snow"
      value_template: "{{ value_json.freshSnowfall | replace('in', '') }}"
      unit_of_measurement: "in"
      unique_id: a2b80ad8-4c68-46e4-a755-fe46dfa2b830

    - name: "Winter Park Base"
      value_template: "{{ value_json.topSnowDepth | replace('in', '') }}"
      unit_of_measurement: "in"
      unique_id: f1f9747f-27ee-4833-bb33-6530b1c4464b

    - name: "Winter Park Last Snow"
      value_template: "{{ value_json.lastSnowfallDate }}"
      unique_id: 11b85c2b-3723-478b-a32e-03f71e39dbb8

Pulls in date as “6 Apr 2024” if it’s possible to format that value into a proper date value for HA, that would be great.

I might just write it backing Library and then it can go into core… unless there already is a python lib out there

I’ve got one more trip before I close out the session :slight_smile:

Nice – I was able to get in 18 days this year, not bad for me will count that as a win. Looks like the API I am pulling references https://www.snow-forecast.com as the source if you’re curious. Would be cool to get something like this built in.