· View as Markdown

Collections

Returns a list of collections

GET /api/v1/collections.json

Returns a paginated list of collections for the authenticated user.

Supports filtering by name and visibility.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • page integer query
    Page number for pagination
  • page_size integer query
    Number of items per page (20-200)
  • name string query
    Filter by name (partial match)
  • visibility string query
    Filter by visibility
    One of: public, followers_only, mutual_followers_only, private

Response 200

  • collections array of objects
    10 fields
    • id integer
    • user_id integer
    • url string
    • html_url string
    • visibility string
    • name string or null
    • description string or null
    • cover string or null
    • created_at date-time
    • updated_at date-time

Errors

  • 401 Unauthorized
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  https://ridewithgps.com/api/v1/collections.json
Response 200
{
  "collections": [
    {
      "id": 123,
      "user_id": 123,
      "url": "https://ridewithgps.com/api/v1/collections/123.json",
      "html_url": "https://ridewithgps.com/collections/123",
      "visibility": "public",
      "name": "Portland favorites",
      "description": "Our best rides around Portland",
      "cover": null,
      "created_at": "2000-01-01T12:00:00Z",
      "updated_at": "2000-01-01T12:00:00Z"
    }
  ]
}

Returns the specified collection

GET /api/v1/collections/{id}.json

Returns detailed information about a specific collection

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • id integer path required
    Collection ID
  • privacy_code string query
    Privacy code for the non public asset

Response 200

  • collection object
    12 fields
    • id integer
    • user_id integer
    • url string
    • html_url string
    • visibility string
    • name string or null
    • description string or null
    • cover string or null
    • created_at date-time
    • updated_at date-time
    • routes array of objects
      29 fields
      • id integer
      • user_id integer
      • url string
      • html_url string
      • visibility string
      • name string
      • description string or null
      • locality string or null
      • administrative_area string or null
      • country_code string or null
      • distance number
        Distance in meters
      • elevation_gain number
        Elevation gain in meters
      • elevation_loss number
        Elevation loss in meters
      • first_lat number
      • first_lng number
      • last_lat number
      • last_lng number
      • sw_lat number
        Southwest bounding box latitude
      • sw_lng number
        Southwest bounding box longitude
      • ne_lat number
        Northeast bounding box latitude
      • ne_lng number
        Northeast bounding box longitude
      • track_type string or null
      • terrain string or null
      • difficulty string or null
      • unpaved_pct number or null
      • surface string or null
      • archived boolean or null
        null for non owned routes
      • created_at date-time
      • updated_at date-time
    • trips array of objects
      47 fields
      • id integer
      • user_id integer
      • url string
      • html_url string
      • visibility string
      • name string
      • description string or null
      • departed_at date-time or null
      • time_zone string or null
      • locality string or null
      • administrative_area string or null
      • country_code string or null
      • activity_type string or null
      • fit_sport integer or null
      • fit_sub_sport integer or null
      • stationary boolean
      • distance number
        Distance in meters
      • duration number
        Duration in seconds
      • moving_time number
        Moving time in seconds
      • elevation_gain number
        Elevation gain in meters
      • elevation_loss number
        Elevation loss in meters
      • first_lat number or null
      • first_lng number or null
      • last_lat number or null
      • last_lng number or null
      • sw_lat number or null
      • sw_lng number or null
      • ne_lat number or null
      • ne_lng number or null
      • track_type string or null
      • terrain string or null
      • difficulty string or null
      • avg_speed number or null
        Average speed in kilometers per hour
      • max_speed number or null
        Maximum speed in kilometers per hour
      • avg_cad number or null
        Average cadence in rounds per minute
      • min_cad number or null
        Minimum cadence in rounds per minute
      • max_cad number or null
        Maximum cadence in rounds per minute
      • avg_hr number or null
        Average heart rate in beats per minute
      • min_hr number or null
        Minimum heart rate in beats per minute
      • max_hr number or null
        Maximum heart rate in beats per minute
      • avg_watts number or null
        Average power in watts
      • min_watts number or null
        Minimum power in watts
      • max_watts number or null
        Maximum power in watts
      • calories number or null
        Calories burned
      • device string or null
      • created_at date-time
      • updated_at date-time

Errors

  • 401 Unauthorized
  • 403 Forbidden - Collection not visible to user
  • 404 Not Found - Collection not found
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  https://ridewithgps.com/api/v1/collections/123.json
Response 200
{
  "collection": {
    "id": 123,
    "user_id": 123,
    "url": "https://ridewithgps.com/api/v1/collections/123.json",
    "html_url": "https://ridewithgps.com/collections/123",
    "visibility": "public",
    "name": "Portland favorites",
    "description": "Our best rides around Portland",
    "cover": null,
    "created_at": "2000-01-01T12:00:00Z",
    "updated_at": "2000-01-01T12:00:00Z",
    "routes": [
      {
        "id": 123,
        "user_id": 123,
        "url": "https://ridewithgps.com/api/v1/routes/123.json",
        "html_url": "https://ridewithgps.com/routes/123",
        "visibility": "public",
        "name": "Forest Park loop",
        "description": "Morning ride through Forest Park",
        "locality": "Portland",
        "administrative_area": "OR",
        "country_code": "US",
        "distance": 40237,
        "elevation_gain": 457,
        "elevation_loss": 461,
        "first_lat": 45.521529,
        "first_lng": -122.691804,
        "last_lat": 45.521529,
        "last_lng": -122.691804,
        "sw_lat": 45.432536,
        "sw_lng": -122.836749,
        "ne_lat": 45.652881,
        "ne_lng": -122.471777,
        "track_type": "loop",
        "terrain": "rolling",
        "difficulty": "moderate",
        "unpaved_pct": 12,
        "surface": "mostly_paved",
        "archived": false,
        "created_at": "2000-01-01T12:00:00Z",
        "updated_at": "2000-01-01T12:00:00Z"
      }
    ],
    "trips": [
      {
        "id": 123,
        "user_id": 123,
        "url": "https://ridewithgps.com/api/v1/trips/123.json",
        "html_url": "https://ridewithgps.com/trips/123",
        "visibility": "public",
        "name": "Forest Park loop",
        "description": "Morning ride through Forest Park",
        "departed_at": "2000-01-01T08:00:00-08:00",
        "time_zone": "America/Los_Angeles",
        "locality": "Portland",
        "administrative_area": "OR",
        "country_code": "US",
        "activity_type": "cycling:road",
        "fit_sport": 2,
        "fit_sub_sport": 7,
        "stationary": false,
        "distance": 40237,
        "duration": 7856,
        "moving_time": 7204,
        "elevation_gain": 457,
        "elevation_loss": 461,
        "first_lat": 45.521529,
        "first_lng": -122.691804,
        "last_lat": 45.521529,
        "last_lng": -122.691804,
        "sw_lat": 45.432536,
        "sw_lng": -122.836749,
        "ne_lat": 45.652881,
        "ne_lng": -122.471777,
        "track_type": "loop",
        "terrain": "rolling",
        "difficulty": "moderate",
        "avg_speed": 20.1,
        "max_speed": 52.3,
        "avg_cad": 87,
        "min_cad": 0,
        "max_cad": 119,
        "avg_hr": 143,
        "min_hr": 87,
        "max_hr": 177,
        "avg_watts": 183,
        "min_watts": 0,
        "max_watts": 627,
        "calories": 1318,
        "device": "Garmin Edge 840",
        "created_at": "2000-01-01T12:00:00Z",
        "updated_at": "2000-01-01T12:00:00Z"
      }
    ]
  }
}

Returns the user's pinned collection

GET /api/v1/collections/pinned.json

Returns the authenticated user's pinned collection

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Response 200

  • collection object
    12 fields
    • id integer
    • user_id integer
    • url string
    • html_url string
    • visibility string
    • name string or null
    • description string or null
    • cover string or null
    • created_at date-time
    • updated_at date-time
    • routes array of objects
      29 fields
      • id integer
      • user_id integer
      • url string
      • html_url string
      • visibility string
      • name string
      • description string or null
      • locality string or null
      • administrative_area string or null
      • country_code string or null
      • distance number
        Distance in meters
      • elevation_gain number
        Elevation gain in meters
      • elevation_loss number
        Elevation loss in meters
      • first_lat number
      • first_lng number
      • last_lat number
      • last_lng number
      • sw_lat number
        Southwest bounding box latitude
      • sw_lng number
        Southwest bounding box longitude
      • ne_lat number
        Northeast bounding box latitude
      • ne_lng number
        Northeast bounding box longitude
      • track_type string or null
      • terrain string or null
      • difficulty string or null
      • unpaved_pct number or null
      • surface string or null
      • archived boolean or null
        null for non owned routes
      • created_at date-time
      • updated_at date-time
    • trips array of objects
      47 fields
      • id integer
      • user_id integer
      • url string
      • html_url string
      • visibility string
      • name string
      • description string or null
      • departed_at date-time or null
      • time_zone string or null
      • locality string or null
      • administrative_area string or null
      • country_code string or null
      • activity_type string or null
      • fit_sport integer or null
      • fit_sub_sport integer or null
      • stationary boolean
      • distance number
        Distance in meters
      • duration number
        Duration in seconds
      • moving_time number
        Moving time in seconds
      • elevation_gain number
        Elevation gain in meters
      • elevation_loss number
        Elevation loss in meters
      • first_lat number or null
      • first_lng number or null
      • last_lat number or null
      • last_lng number or null
      • sw_lat number or null
      • sw_lng number or null
      • ne_lat number or null
      • ne_lng number or null
      • track_type string or null
      • terrain string or null
      • difficulty string or null
      • avg_speed number or null
        Average speed in kilometers per hour
      • max_speed number or null
        Maximum speed in kilometers per hour
      • avg_cad number or null
        Average cadence in rounds per minute
      • min_cad number or null
        Minimum cadence in rounds per minute
      • max_cad number or null
        Maximum cadence in rounds per minute
      • avg_hr number or null
        Average heart rate in beats per minute
      • min_hr number or null
        Minimum heart rate in beats per minute
      • max_hr number or null
        Maximum heart rate in beats per minute
      • avg_watts number or null
        Average power in watts
      • min_watts number or null
        Minimum power in watts
      • max_watts number or null
        Maximum power in watts
      • calories number or null
        Calories burned
      • device string or null
      • created_at date-time
      • updated_at date-time

Errors

  • 404 Pinned collection not found
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  https://ridewithgps.com/api/v1/collections/pinned.json
Response 200
{
  "collection": {
    "id": 123,
    "user_id": 123,
    "url": "https://ridewithgps.com/api/v1/collections/123.json",
    "html_url": "https://ridewithgps.com/collections/123",
    "visibility": "public",
    "name": "Portland favorites",
    "description": "Our best rides around Portland",
    "cover": null,
    "created_at": "2000-01-01T12:00:00Z",
    "updated_at": "2000-01-01T12:00:00Z",
    "routes": [
      {
        "id": 123,
        "user_id": 123,
        "url": "https://ridewithgps.com/api/v1/routes/123.json",
        "html_url": "https://ridewithgps.com/routes/123",
        "visibility": "public",
        "name": "Forest Park loop",
        "description": "Morning ride through Forest Park",
        "locality": "Portland",
        "administrative_area": "OR",
        "country_code": "US",
        "distance": 40237,
        "elevation_gain": 457,
        "elevation_loss": 461,
        "first_lat": 45.521529,
        "first_lng": -122.691804,
        "last_lat": 45.521529,
        "last_lng": -122.691804,
        "sw_lat": 45.432536,
        "sw_lng": -122.836749,
        "ne_lat": 45.652881,
        "ne_lng": -122.471777,
        "track_type": "loop",
        "terrain": "rolling",
        "difficulty": "moderate",
        "unpaved_pct": 12,
        "surface": "mostly_paved",
        "archived": false,
        "created_at": "2000-01-01T12:00:00Z",
        "updated_at": "2000-01-01T12:00:00Z"
      }
    ],
    "trips": [
      {
        "id": 123,
        "user_id": 123,
        "url": "https://ridewithgps.com/api/v1/trips/123.json",
        "html_url": "https://ridewithgps.com/trips/123",
        "visibility": "public",
        "name": "Forest Park loop",
        "description": "Morning ride through Forest Park",
        "departed_at": "2000-01-01T08:00:00-08:00",
        "time_zone": "America/Los_Angeles",
        "locality": "Portland",
        "administrative_area": "OR",
        "country_code": "US",
        "activity_type": "cycling:road",
        "fit_sport": 2,
        "fit_sub_sport": 7,
        "stationary": false,
        "distance": 40237,
        "duration": 7856,
        "moving_time": 7204,
        "elevation_gain": 457,
        "elevation_loss": 461,
        "first_lat": 45.521529,
        "first_lng": -122.691804,
        "last_lat": 45.521529,
        "last_lng": -122.691804,
        "sw_lat": 45.432536,
        "sw_lng": -122.836749,
        "ne_lat": 45.652881,
        "ne_lng": -122.471777,
        "track_type": "loop",
        "terrain": "rolling",
        "difficulty": "moderate",
        "avg_speed": 20.1,
        "max_speed": 52.3,
        "avg_cad": 87,
        "min_cad": 0,
        "max_cad": 119,
        "avg_hr": 143,
        "min_hr": 87,
        "max_hr": 177,
        "avg_watts": 183,
        "min_watts": 0,
        "max_watts": 627,
        "calories": 1318,
        "device": "Garmin Edge 840",
        "created_at": "2000-01-01T12:00:00Z",
        "updated_at": "2000-01-01T12:00:00Z"
      }
    ]
  }
}