Trips

OW
Last updated 13 days ago

The Get Trips API lets you fetch the trips data of all active ongoing and completed trips for your users. The Get trips route API lets you fetch the trip's route specific data for the completed trip.

get
Get Trips List API

https://api.geospark.co/v1
/api/trip/
This API gives you the list of all trips (both active and ended) of an user. You can view trip summary for the users. It will help you track your user's completed and ongoing trips. You will get a concise information like trip start time, end time, start location, end location, Trip duration and distance covered.
Request
Response
Headers
Api-Key
required
string
33223kjhdcscijhb5sdbsdmjsdcbj5f
Content-Type
required
string
application/json
Query Parameters
user_id
required
string
Returns the trips of the user identified by this parameter. Input Data: 5bd3086002a89b26a5d2a1d2
app_id
required
string
app_id to identify the device_platform of the given user. Input Data: 5bc83d7f02a89b01450c5a6c_1
200: OK
JSON
{
"status": true,
"msg": "Success.",
"code": 200,
"data": {
"next_page": null,
"pages": 1,
"prev_page": null,
"trips": [
{
"trip_id": "5c40560ea1426005bd908213",
"description": "Evans house",
"trip_started_at": "2019-01-17T10:16:45.000",
"trip_ended_at": "2019-01-17T10:17:00.000",
"start_address": "160 hsr layout near BDA Complex, Bengaluru,Karnataka 560102, India",
"end_address": "160 hsr layout near BDA Complex, Bengaluru,Karnataka 560102, India",
"distance_covered": 3.75,
"duration": 15
},
{
"trip_id": "5c4354dca142600f546975b7",
"description": "House of commons",
"trip_started_at": "2019-01-19T16:48:26.000",
"trip_ended_at": "2019-01-19T19:15:28.000",
"start_address": "773, Srinivagilu Main Rd, Koramangala 4thBlock, Koramangala, Bengaluru, Karnataka 560034, India",
"end_address": "#95, B.D.A Complex, Above Post office, HSRLayout, Bengaluru, Karnataka 560102, India",
"distance_covered": 3768.72,
"duration": 8822
},
{
"trip_id": "5c48318ca1426051057cbbdf",
"description": "Kormangla",
"trip_started_at": "2019-01-23T09:19:06.000",
"start_address": "#163, 9th Main road, 6th Sector, HSR Layout,Bengaluru, Karnataka 560102, India"
}
]
}
}

Metrics:

  • Distance covered is calculated in meters.

  • Duration is calculated in minutes.

  • This API return the list of ended trips of a user on a given date, with short summary of each trip.

Sample Call

cURL
JavaScript
Python
Java
Swift
Go
curl -X GET \
'https://api.geospark.co/v1/api/trip/?
user_id=5bd3086002a89b26a5d2a1d2&app_id=5bc83d7f02a89b01450c5a6c_1' \
-H 'Api-key: ad0b961be07b4b0c94f6b59df489edc1'

get
Get Trips Route API

https://api.geospark.co/v1
/api/trip/
This API gives the locations covered within a trip by a user.
Request
Response
Headers
Api-Key
required
string
33223kjhdcscijhb5sdbsdmjsdcbj5f
Content-Type
required
string
application/json
Query Parameters
trip_id
required
string
Response contains the locations identified by this field. Input Data: 5bd3095502a89b2949e7f82b
app_id
required
string
app_id to identify the device_platform of the given user. Input Data: 5bc83d7f02a89b01450c5a6c_1
200: OK
JSON
{
"status": true,
"msg": "Success.",
"code": 200,
"data": [
{
"coordinates": [
79.48695,
12.98266
],
"altitude": 23.33,
"activity": "WALK",
"recorded_at": "2018-12-15T11:44:00.270"
},
{
"coordinates": [
79.44593,
12.96793
],
"altitude": 23.33,
"activity": "STOP",
"started_at": "2018-12-15T13:00:18.295"
},
{
"coordinates": [
79.47593,
12.92793
],
"altitude": 23.33,
"activity": "DRIVE",
"recorded_at": "2018-12-15T13:23:18.295"
},
{
"coordinates": [
79.47513,
12.92733
],
"altitude": 22.33,
"activity": "BICYCLE",
"recorded_at": "2018-12-15T14:23:18.295"
},
{
"coordinates": [
79.47519,
12.92735
],
"altitude": 24.33,
"activity": "BICYCLE",
"recorded_at": "2018-12-15T14:23:18.295"
},
{
"coordinates": [
79.47413,
12.92133
],
"altitude": 23.33,
"activity": "BICYCLE",
"recorded_at": "2018-12-15T14:23:18.295"
}
]
}

Sample Call

cURL
JavaScript
Python
Java
Swift
Go
curl -X GET \
'https://api.geospark.co/v1/api/trip/route/?trip_id=5bd3095502a89b2949e7f82b&app_id=5bc83d7f02a89b01450c5a6c_1' \
-H 'Api-key: ad0b961be07b4b0c94f6b59df489edc1'