Skip to content

Adventures API

Andrew Maclean edited this page Jun 26, 2024 · 15 revisions

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

Get Top Level Adventures

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

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

Endpoint

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

Content-Type: application/json
HTTP Method: GET

The <AdventureType> variable is one of enum AdventureType

Response

{
  data: {
    adventures: {
      <AdventureType>: {
        lines: GeoJSON-Object
        points: GeoJSON-Object
      }
    }
  },
  status_code: Int
  timestamp: Int
}
Key Type Description
lines GeoJSON-Object all the features in the adventures collection who's geo data consists of a path
points GeoJSON-Object all the features who's geo data are just a coordinate pair

Get Adventures by Distance

This API gets adventures ordered by distance from a specified lat and lng. In the root adventure view, the closest adventures to the current center point of the screen will be populated with this call. The response will be a list of abridged adventures 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/adventures/distance?adventure_type=<AdventureType>&coordinates_lat=<Lat>&coordinates_lng=<Lng>&count=<Count>

Content-Type: application/json
HTTP Method: GET

The <AdventureType> variable is one of enum AdventureType
The <Lat> variable is a floating point number representing coordinate latitude
The <Lng> variable is a floating point number representing coordinate longitude
The <Count> variable is an Int determining the amount of adventures returned

Response

{
  data: {
    adventures: ShortAdventure[]
  },
  status_code: Int
  timestamp: Int
}
Key Type Description
adventures ShortAdventure an abridged version of the adventure object for when many adventures are requested

Get Individual Adventure

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

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

Endpoint

https://api.sundaypeak.com/adventures/details?id=<AdventureId>&type=<AdventureType>

Content-Type: application/json
HTTP Method: GET

AdventureId is the id of the adventure requested
AdventureType is the type of the adventure requested. Type AdventureType

Response

{
  data: {
    adventure: Adventure
  },
  status_code: Int
  timestamp: Int
}
Key Type Description
adventure Adventure A full adventure description

Clone this wiki locally