A trip is a recorded ride. Upload a GPX, TCX, KML or FIT file to create trips: the upload runs in the background and returns a task.
See also: Routes and trips, Track points, Activity types.
How to authenticate · OpenAPI spec for these endpoints
/api/v1/trips.json
Returns a list of trips
/api/v1/trips/{id}.json
Returns the specified trip
/api/v1/trips/{id}/polyline.json
Returns the polyline for the specified trip
/api/v1/trips/{id}.{format}
Downloads the specified trip as a GPS file
/api/v1/trips.json
Uploads a file to create trips
/api/v1/trips/{id}/copy.json
Copies the specified trip into your routes
/api/v1/trips/{id}.json
Updates the specified trip
/api/v1/trips/{id}.json
Deletes the specified trip
/api/v1/trips.json
Returns a paginated list of trips for the authenticated user.
Supports filtering by name, visibility, distance_min, distance_max, elevation_gain_min, elevation_gain_max and stationary.
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
page
integer
query
page_size
integer
query
name
string
query
visibility
string
query
public, followers_only, mutual_followers_only, private
distance_min
integer
query
distance_max
integer
query
elevation_gain_min
integer
query
elevation_gain_max
integer
query
stationary
string
query
true, false
trips
array of objects
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
duration
number
moving_time
number
elevation_gain
number
elevation_loss
number
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
max_speed
number
or null
avg_cad
number
or null
min_cad
number
or null
max_cad
number
or null
avg_hr
number
or null
min_hr
number
or null
max_hr
number
or null
avg_watts
number
or null
min_watts
number
or null
max_watts
number
or null
calories
number
or null
device
string
or null
created_at
date-time
updated_at
date-time
meta
object
pagination
object
record_count
integer
page_count
integer
page_size
integer
next_page_url
string
or null
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
https://ridewithgps.com/api/v1/trips.json
{
"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"
}
],
"meta": {
"pagination": {
"record_count": 45,
"page_count": 3,
"page_size": 20,
"next_page_url": "https://ridewithgps.com/api/v1/trips.json?page=2"
}
}
}
/api/v1/trips/{id}.json
Returns detailed information about a specific trip
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
id
integer
path
required
privacy_code
string
query
trip
object
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
duration
number
moving_time
number
elevation_gain
number
elevation_loss
number
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
max_speed
number
or null
avg_cad
number
or null
min_cad
number
or null
max_cad
number
or null
avg_hr
number
or null
min_hr
number
or null
max_hr
number
or null
avg_watts
number
or null
min_watts
number
or null
max_watts
number
or null
calories
number
or null
device
string
or null
created_at
date-time
updated_at
date-time
track_points
array of objects
x
number
y
number
d
number
e
integer
t
integer
s
number
T
integer
h
integer
c
integer
p
integer
pb
integer
lap
boolean
k
boolean
m
boolean
gear
object
id
integer
make
string
or null
model
string
or null
description
string
or null
exclude_from_totals
boolean
created_at
date-time
photos
array of objects
id
integer
url
string
highlighted
boolean
caption
string
or null
lat
number
or null
lng
number
or null
elevation
integer
or null
location
string
or null
locality
string
or null
administrative_area
string
or null
country_code
string
or null
created_at
date-time
collections
array of objects
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
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
https://ridewithgps.com/api/v1/trips/123.json
{
"trip": {
"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",
"track_points": [
{
"x": -122.691804,
"y": 45.521529,
"d": 12487.3,
"e": 154,
"t": 946744650,
"s": 24.6,
"T": 8,
"h": 145,
"c": 88,
"p": 195,
"pb": 51,
"lap": false,
"k": false,
"m": false
}
],
"gear": {
"id": 123,
"make": "Specialized",
"model": "Diverge",
"description": "Gravel bike",
"exclude_from_totals": false,
"created_at": "2000-01-01T12:00:00Z"
},
"photos": [
{
"id": 123,
"url": "https://ridewithgps.com/api/v1/photos/123/8275d8de285be31d7b2437bc3ae69756.jpg",
"highlighted": false,
"caption": "View from Pittock Mansion",
"lat": 45.521529,
"lng": -122.691804,
"elevation": 290,
"location": "Pittock Mansion",
"locality": "Portland",
"administrative_area": "OR",
"country_code": "US",
"created_at": "2000-01-01T12:00:00Z"
}
],
"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"
}
]
}
}
/api/v1/trips/{id}/polyline.json
Returns a simplified polyline of the trip geometry, suitable for displaying on a map.
The data field is a Google Encoded Polyline.
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
id
integer
path
required
privacy_code
string
query
polyline
object
parent_type
string
parent_id
integer
data
string
or null
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
https://ridewithgps.com/api/v1/trips/123/polyline.json
{
"polyline": {
"parent_type": "route",
"parent_id": 123,
"data": "en`sFbhlaSiAoDlCaBa@mAWi@sBwC"
}
}
/api/v1/trips/{id}.{format}
Returns the trip as a GPS file, ready to load on a GPS device or into another application. The extension picks the format:
| Extension | Content type | File |
|---|---|---|
gpx |
application/gpx+xml |
GPX 1.1 track at full resolution |
tcx |
application/tcx+xml |
TCX activity history with heart rate, cadence and power when recorded |
fit |
application/vnd.ant.fit |
FIT activity |
kml |
application/vnd.google-earth.kml+xml |
Google Earth track |
When the trip was uploaded as a FIT file and has not been edited since, the FIT download returns the original file as recorded by the device.
Track points are exported as the authenticated user is allowed to see them: points inside a privacy zone are only present for the trip owner, or when a valid privacy_code is given.
The file is sent as an attachment with a filename derived from the trip name. Visibility rules are the same as for the JSON record: a non public trip needs a privacy_code unless it belongs to the authenticated user.
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
id
integer
path
required
format
string
path
required
gpx, tcx, fit, kml
privacy_code
string
query
GPS file
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
https://ridewithgps.com/api/v1/trips/123.gpx
// GPS file
/api/v1/trips.json
Creates one or more trips from an uploaded GPS file. Accepted formats are GPX, TCX, KML and FIT.
Multipart uploads: This endpoint accepts only Content-Type: multipart/form-data. Send the
following fields:
- file - GPS file (binary), required
- name - Name for the created trip, otherwise taken from the file
- description - Description for the created trip
- gear_id - Gear to assign, must belong to the authenticated user
Processing happens in the background. The response is a task with status: "pending",
and its Location header points at the task. Poll that url until status becomes
completed, then read the items array for the trips that were created and the
errors array for anything that failed.
A trip needs timestamps on its track points. A file without them, such as a planned
route, cannot be imported here and is reported with the time_data_missing error code.
Re-uploading a ride that already exists is reported with the duplicate error code, and
the error carries a reference to the existing trip.
Trip visibility always follows the account's default privacy setting for trips and cannot be set through this endpoint.
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
file
file
required
name
string
description
string
gear_id
integer
task
object
id
integer
user_id
integer
url
string
type
string
gps_file_upload for uploads, experience_package for experience packagesstatus
string
pending until the task has run, then completedcreated_at
date-time
updated_at
date-time
items
array of objects
item_type
string
route or trip for uploads, experience_package for experience packagesitem_id
integer
item_url
string
or null
errors
array of objects
code
string
duplicate, time_data_missing, no_tracks, empty_file, parse_failed, failed_to_process, weigh_in_failed, build_failed, errormessage
string
item_type
string
or null
item_id
integer
or null
item_url
string
or null
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
-X POST \
-F file=@route.gpx \
-F name="Forest Park loop" \
-F description="Morning ride through Forest Park" \
-F gear_id="123" \
https://ridewithgps.com/api/v1/trips.json
{
"task": {
"id": 123,
"user_id": 123,
"url": "https://ridewithgps.com/api/v1/tasks/123.json",
"type": "gps_file_upload",
"status": "completed",
"created_at": "2000-01-01T12:00:00Z",
"updated_at": "2000-01-01T12:00:00Z",
"items": [
{
"item_type": "route",
"item_id": 123,
"item_url": "https://ridewithgps.com/api/v1/routes/123.json"
}
],
"errors": [
{
"code": "duplicate",
"message": "This route already exists",
"item_type": "route",
"item_id": 123,
"item_url": "https://ridewithgps.com/api/v1/routes/123.json"
}
]
}
}
/api/v1/trips/{id}/copy.json
Makes a route from a trip the authenticated user can see, in their own routes. The route follows the trip's track, without its privacy zones, timestamps or sensor data. Organizations can turn copying off for their trips.
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
id
integer
path
required
privacy_code
string
query
route
object
name
string
visibility
string
private, or managers_only for an organization.
User-owned: public, followers_only, mutual_followers_only or private.
Organization-owned: public, members_only or managers_only. See Visibilities.route
object
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
elevation_gain
number
elevation_loss
number
first_lat
number
first_lng
number
last_lat
number
last_lng
number
sw_lat
number
sw_lng
number
ne_lat
number
ne_lng
number
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
created_at
date-time
updated_at
date-time
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"route": {
"name": "Forest Park loop",
"visibility": "private"
}
}' \
https://ridewithgps.com/api/v1/trips/123/copy.json
{
"route": {
"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"
}
}
/api/v1/trips/{id}.json
Updates details of a trip owned by the authenticated user. Only the fields sent are changed. The track cannot be changed.
Any invalid value returns a 422 and nothing is saved. Values of the wrong type, such as an
object for name, may be ignored.
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
id
integer
path
required
trip
object
required
name
string
or null
description
string
or null
visibility
string
public, followers_only, mutual_followers_only or private.
Organization-owned: public, members_only or managers_only. See Visibilities.activity_type
string
other:generic, cycling:generic, cycling:road, cycling:gravel, cycling:cyclocross, cycling:mountain, cycling:recumbent, cycling:hand_cycling, cycling:commute, cycling:indoor, cycling:virtual, e_biking:generic, e_biking:road, e_biking:mountain, running:generic, running:road, running:trail, running:indoor, walking:generic, walking:hiking, walking:indoor, walking:speed, swimming:generic, swimming:lap, swimming:open_water, snow:generic, snow:alpine_skiing, snow:cross_country_skiing, snow:snowboarding, snow:snowshoeing, driving:generic, motorcycling:generic, motorcycling:atv, motorcycling:motocross, training:generic, training:strength, training:cardio, training:breathing, training:yoga, training:hiit
trip
object
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
duration
number
moving_time
number
elevation_gain
number
elevation_loss
number
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
max_speed
number
or null
avg_cad
number
or null
min_cad
number
or null
max_cad
number
or null
avg_hr
number
or null
min_hr
number
or null
max_hr
number
or null
avg_watts
number
or null
min_watts
number
or null
max_watts
number
or null
calories
number
or null
device
string
or null
created_at
date-time
updated_at
date-time
track_points
array of objects
x
number
y
number
d
number
e
integer
t
integer
s
number
T
integer
h
integer
c
integer
p
integer
pb
integer
lap
boolean
k
boolean
m
boolean
gear
object
id
integer
make
string
or null
model
string
or null
description
string
or null
exclude_from_totals
boolean
created_at
date-time
photos
array of objects
id
integer
url
string
highlighted
boolean
caption
string
or null
lat
number
or null
lng
number
or null
elevation
integer
or null
location
string
or null
locality
string
or null
administrative_area
string
or null
country_code
string
or null
created_at
date-time
collections
array of objects
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
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
-X PUT \
-H "Content-Type: application/json" \
-d '{
"trip": {
"name": "Forest Park loop",
"description": "Morning ride through Forest Park",
"visibility": "public",
"activity_type": "cycling:road"
}
}' \
https://ridewithgps.com/api/v1/trips/123.json
{
"trip": {
"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",
"track_points": [
{
"x": -122.691804,
"y": 45.521529,
"d": 12487.3,
"e": 154,
"t": 946744650,
"s": 24.6,
"T": 8,
"h": 145,
"c": 88,
"p": 195,
"pb": 51,
"lap": false,
"k": false,
"m": false
}
],
"gear": {
"id": 123,
"make": "Specialized",
"model": "Diverge",
"description": "Gravel bike",
"exclude_from_totals": false,
"created_at": "2000-01-01T12:00:00Z"
},
"photos": [
{
"id": 123,
"url": "https://ridewithgps.com/api/v1/photos/123/8275d8de285be31d7b2437bc3ae69756.jpg",
"highlighted": false,
"caption": "View from Pittock Mansion",
"lat": 45.521529,
"lng": -122.691804,
"elevation": 290,
"location": "Pittock Mansion",
"locality": "Portland",
"administrative_area": "OR",
"country_code": "US",
"created_at": "2000-01-01T12:00:00Z"
}
],
"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"
}
]
}
}
/api/v1/trips/{id}.json
Deletes a trip owned by the authenticated user
x-rwgps-api-key
string
required
x-rwgps-auth-token
string
required
id
integer
path
required
Trip deleted successfully
curl \
-H "x-rwgps-api-key: $API_KEY" \
-H "x-rwgps-auth-token: $AUTH_TOKEN" \
-X DELETE \
https://ridewithgps.com/api/v1/trips/123.json
// Trip deleted successfully