Skip to content

Zones API

Andrew Maclean edited this page Jun 25, 2024 · 9 revisions

This section describes the actions you can take on Zones with the Sunday Peak API.

Get Top Level Zones

Top Level Zones are any zones that do not have a parent zone. This API is meant to fetch all the zones that will display on the map when no other zones are selected. The response will be a GeoJSON object with a list of zones as features that fall into this category.

This API doesn't require an auth token because it is meant to be able to be used without logging in to either the website or the app. All data regarding any users is restricted from this call.

Endpoint

https://api.sundaypeak.com/zones/all?type=<AdventureType>

Content-Type: application/json
HTTP Method: GET

The AdventureType variable is one of enum AdventureType

Response

{
  data: {
    zones: {
      <AdventureType>: GeoJSON-Object
    }
  },
  status_code: Int
  timestamp: Int
}
Key Type Description
AdventureType GeoJSON-Object A mapping structure

Get Zones by Distance

This API gets zones ordered by distance from a specified lat and lng. In the root adventure view, the closest zones to the current of the screen will be populated with this call. The response will be a list of abridged zones that fall into this category.

This API doesn't require an auth token because it is meant to be able to be used without logging in to either the website or the app. All data regarding any users is restricted from this call.

Endpoint

https://api.sundaypeak.com/zones/distance?adventure_type=ski&coordinates_lat=<lat>&coordinates_lng=<lng>

Content-Type: application/json
HTTP Method: GET

The lat and lng variables is are both floating point numbers.

Response

{
  data: {
    zones: ShortZone[]
  },
  status_code: Int
  timestamp: Int
}
Key Type Description
zones ShortZone[] An abridged version of the zone information when many zones are provided

Get Individual Zone

An individual zone can be fetched with an id parameter. This API populates any data about a specific zone. The response will be structured as below, showing the pertinent parameters about a zone.

This API doesn't require an auth token because it is meant to be able to be used without logging in to either the website or the app. All data regarding any users is restricted from this call.

Endpoint

https://api.sundaypeak.com/zones/details?zone_id=<ZoneId>

Content-Type: application/json
HTTP Method: GET

ZoneId is the id of the zone requested

Response

{
  data: {
    zone: Zone
  },
  statusCode: Int,
  timestamp: Int
}
Key Type Description
zone Zone

Clone this wiki locally