List the activities of a trip
Read every activity of a stored trip, with its traveler and the calculations SQUAKE stored for it.
Returns every activity of one trip in ingestion order. Each activity carries its traveler and one calculation per methodology configured for its type. This is where you read the results of additional methodologies, because the items array of a submission only reports the primary methodology of each activity.
A trip is a single booking, so the list is short and comes back in full. The endpoint isn't paginated.
Request
GET /v2/travel-data/trips/{trip_id}/activities
trip_idstringrequiredThe trip's SQUAKE id (a UUID) or your own trip_reference.
GET /v2/travel-data/trips/{trip_id}/activities in the API referencecurl "https://api.sandbox.squake.earth/v2/travel-data/trips/TRIP-EXAMPLE-002/activities" \
--header "Authorization: Bearer $SQUAKE_API_KEY"Response
The body is a JSON array of activities. The example shows two of the trip's four activities.
[
{
"id": "2b4d6f81-9c3e-4a57-b0d2-6e1f8a4c7b93",
"type": "flight",
"trip_id": "7c9e6f2a-4b81-4d3e-9a52-1f0c8b3d5e47",
"client_id": "4fb3ec7a-92cb-471f-b75f-c3fe7c2a34d5",
"external_reference": "ACTIVITY-FLIGHT-OUTBOUND",
"origin": "BER",
"destination": "LHR",
"traveler": {
"name": "Jane Doe",
"email": "jane.doe@example.com",
"traveler_type": "employee"
},
"calculations": [
{
"id": "3f2a1c8e-5d47-4b91-a0c3-1e8b7d6f4a20",
"methodology": "TIM",
"methodology_version": "3.0.0",
"co2_in_grams": 142600.0,
"audit": { "id": "0194d6b4-8711-7873-899d-c8133cd742f8" }
}
]
},
{
"id": "5e1a9c34-7d62-4f08-b3a1-9c4e2d7f6b58",
"type": "hotel",
"trip_id": "7c9e6f2a-4b81-4d3e-9a52-1f0c8b3d5e47",
"client_id": "4fb3ec7a-92cb-471f-b75f-c3fe7c2a34d5",
"external_reference": "ACTIVITY-HOTEL-001",
"traveler": {
"name": "Jane Doe",
"email": "jane.doe@example.com",
"traveler_type": "employee"
},
"calculations": [
{
"id": "8b6d4f20-9a17-4c53-b8e1-3d7a5c2f9e14",
"methodology": "DEFRA",
"methodology_version": "2026",
"co2_in_grams": 36800.0,
"audit": null
}
]
}
]The hotel stay has no origin or destination key. The next section explains why.
Keys that depend on the activity type
SQUAKE only stores a route and a fuel for the activity types that have them. A key that a type can't have is left out of the response instead of being returned as null:
| Type | origin and destination | fuel_type |
|---|---|---|
flight | Yes | No |
car | Yes | Yes |
train | Yes | Yes |
hotel | No | No |
Read type before you read the route. traveler is present on every activity, and it's null when the activity was submitted without a traveler. That's common for rows from CSV imports and TMC integrations.
Calculations
Each entry in calculations is the result of one methodology, oldest first:
co2_in_gramsis in grams of COâ‚‚ equivalent.methodology_versionisnullfor methodologies that aren't versioned.auditholds the ID of the audit log the calculation produced, ornullwhen the activity was submitted without audit mode. To read the full log, see Retrieve an audit log.- An empty
calculationsarray means SQUAKE stored no calculation for the activity.
Note the unit
co2_in_grams is in grams. The calculation endpoints and the items array of POST /v2/travel-data report kilograms by default.
For every field of an activity, see Activity fields.
Routed flights
A flight submitted with routing, such as BER-FRA-JFK, is one activity that carries the total of the itinerary. Its legs aren't listed here, and they don't appear in the trip's activity_ids either.
Errors
| Status | Code | Meaning |
|---|---|---|
401 | The API key is missing or invalid. | |
404 | travel_data_not_found | No trip has this ID or reference, or the trip belongs to a client you can't access. |
Related
- Retrieve an activity
- Retrieve a trip
- List the Activities of a Travel Data Trip in the API reference