Thrust Carbon

Segment: List

GET
/projects/{projectId}/segments

Gets a list of all segments belonging to a project.

Want access to emissions data without a Thrust Calculator subscription? You should use our emissions API instead, which is a cheaper, non-persistent way to access emissions.

AuthorizationBearer <token>

Your API Key must be provided as a bearer token. To do this, create an 'Authorization' header with a value of 'Bearer {your-api-key}' (e.g. "Authorization: Bearer xcvboy23idvh").

In: header

Path Parameters

projectId*string
Formatuuid

Query Parameters

page?integer
created_on_or_after?string

Optionally only request segments created on the Thrust Carbon system on or after the given datetime.

Formatdate-time
created_before?string

Optionally only request segments created on the Thrust Carbon system before the given datetime.

Formatdate-time
grouping_type?string

If you would like to filter the statistics calculation by a grouping, then enter the grouping type you would like to include.

grouping?string

The name of the grouping that you would like to include in the statistics calculation.

grouping_include_sub_groups?boolean

If you have a hierarchy of groupings, should we include data belonging to groupings that sit under the current grouping?

Response Body

application/json

curl -X GET "https://example.com/projects/497f6eca-6276-4993-bfeb-53cbbbba6f08/segments"
{  "to": 0,  "from": 0,  "path": "http://example.com",  "prev_page_url": "http://example.com",  "next_page_url": "http://example.com",  "last_page_url": "http://example.com",  "first_page_url": "http://example.com",  "last_page": 0,  "current_page": 0,  "per_page": 0,  "total": 0,  "data": [    {      "id": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "tonnes_of_emissions": 0,      "type": "air",      "grouping": {        "{grouping-type-slug}": [          "string"        ]      },      "emitted_at": "2021-01-09",      "traveller_ref": "string",      "metadata": {        "key": "string"      },      "price": 0,      "price_currency": "USD,GBP",      "origin": {        "iata": "LHR"      },      "destination": {        "iata": "JFK"      },      "passengers": 1,      "travel_class": "economy",      "carrier": "BA",      "aircraft_type": "788",      "flight_number": "BA 112"    }  ]}