# Logistics

The logistics sector plays a crucial role in the movement of goods and materials worldwide. However, the transportation and delivery of products often come with a significant carbon footprint. Whether it's road freight, shipping, or air cargo, logistics activities contribute to global greenhouse gas emissions, making it essential to calculate and mitigate their impact. By understanding the emissions produced by various logistics activities, companies can make informed decisions to improve their sustainability and reduce their environmental impact.

Calculating the carbon emissions for logistics activities requires considering factors such as the type of transportation, distance traveled, and fuel type. Accurate measurement enables businesses to identify carbon reduction opportunities, optimize their supply chain, and contribute to global carbon reduction efforts.

## Perform a Calculation

### POST /v2/calculations

> Bearer auth

The calculations endpoint can calculate carbon emissions for one or multiple activities. The carbon footprint of your logistics operations, such as multiple freight journeys or combined land and sea shipments, can be computed all at once by passing all relevant activities in the "items" array. Include the string literal "items" in the "expand" array to retrieve values for each item separately in addition to the total carbon quantity.

This is a low-latency endpoint. SQUAKE does not provide you with a unique identifier for any calculation results. You must quote a price on the pricing endpoint to purchase compensation for your carbon emissions.

Some data sets are extensive and thus documented separately here.

### application/json

**Body**

* `expand` array\[string]: If you choose to expand on e.g., "items", SQUAKE returns emissions for each item separately (in addition to a total value).
  * Value is `items`.
* `carbon_unit` string: SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".
  * Values are `tonne`, `kilogram`, or `gram`.
* `distance_unit` string: SQUAKE uses common distance units.
  * Values are `meter`, `kilometer`, `feet`, `mile`, or `nautical_mile`. Default value is `kilometer`.

## Generic API Request Sample:

```json
{
  "expand": [
    "items"
  ],
  "carbon_unit": "tonne",
  "distance_unit": "kilometer",
  "items": [
    {
      "type": "road_freight",
      "external_reference": "Truck",
      "origin": "Magdeburg, Germany",
      "destination": "DEHAM",
      "weight_in_tonnes": 0.75,
      "fuel_type": "diesel",
      "energy_scope": "wtw",
      "truck_type": "rigid_truck_under_26_gvw",
      "temperature_controlled_freight": true,
      "methodology": "GLEC"
    },
    {
      "type": "logistics_site",
      "external_reference": "Hub",
      "weight_in_tonnes": 0.75,
      "logistics_site_type": "transhipment_site",
      "methodology": "GLEC"
    },
    {
      "type": "sea_freight",
      "external_reference": "Sea",
      "origin": "DEHAM",
      "destination": "NLAMS",
      "weight_in_tonnes": 0.75,
      "cargo_type": "dry",
      "energy_scope": "wtw",
      "methodology": "CLEAN-CARGO"
    },
    {
      "type": "logistics_site",
      "external_reference": "Hub",
      "weight_in_tonnes": 0.75,
      "logistics_site_type": "storage_and_transhipment",
      "methodology": "GLEC"
    },
    {
      "type": "air_freight",
      "external_reference": "Air",
      "origin": "AMS",
      "destination": "JFK",
      "weight_in_tonnes": 0.75,
      "plane_type": "belly_freighter",
      "energy_scope": "wtw",
      "methodology": "GLEC"
    },
    {
      "type": "logistics_site",
      "external_reference": "Hub",
      "weight_in_tonnes": 0.75,
      "logistics_site_type": "warehouse",
      "methodology": "GLEC"
    },
    {
      "type": "road_freight",
      "external_reference": "Truck",
      "origin": "JFK",
      "destination": "Scranton, United States",
      "weight_in_tonnes": 0.75,
      "fuel_type": "diesel",
      "energy_scope": "wtw",
      "truck_type": "van_under_3.5_t",
      "temperature_controlled_freight": true,
      "methodology": "GLEC"
    }
  ]
}
```

## Generic API Response Sample:

```json
{
    "carbon_quantity": 4.570352,
    "carbon_unit": "tonne",
    "items": [
        {
            "carbon_quantity": 0.026645,
            "carbon_unit": "tonne",
            "external_reference": "Truck",
            "type": "road_freight",
            "methodology": "GLEC",
            "distance": 244.0,
            "distance_unit": "kilometer",
            "algorithm_specifics": {
                "algorithm_type": "glec",
                "data": {
                    "co2e_in_g": 26645,
                    "co2e_emissions_wtw_in_g": 26645,
                    "co2e_per_tonne_km_in_g": 130,
                    "tonne_km": 183,
                    "reporting_year": 2024,
                    "transportation_mode": "road_transportation"
                }
            }
        },
        {
            "carbon_quantity": 0.00165,
            "carbon_unit": "tonne",
            "external_reference": "Hub",
            "type": "logistics_site",
            "methodology": "GLEC",
            "algorithm_specifics": {
                "algorithm_type": "glec",
                "data": {
                    "co2e_in_g": 1650.0,
                    "co2e_per_tonne_in_g": 2200,
                    "reporting_year": 2024,
                    "transportation_mode": "logistics_site"
                }
            }
        },
        {
            "carbon_quantity": 0.004885,
            "carbon_unit": "tonne",
            "external_reference": "Sea",
            "type": "sea_freight",
            "methodology": "CLEAN-CARGO",
            "distance": 368.0,
            "distance_unit": "kilometer",
            "algorithm_specifics": {
                "algorithm_type": "clean_cargo",
                "data": {
                    "co2e_in_g": 4885,
                    "co2e_emissions_wtw_in_g": 4885,
                    "co2e_per_tonne_km_in_g": 17.7,
                    "tonne_km": 276,
                    "reporting_year": 2024,
                    "transportation_mode": "sea_transportation"
                }
            }
        },
        {
            "carbon_quantity": 0.003,
            "carbon_unit": "tonne",
            "external_reference": "Hub",
            "type": "logistics_site",
            "methodology": "GLEC",
            "algorithm_specifics": {
                "algorithm_type": "glec",
                "data": {
                    "co2e_in_g": 3000.0,
                    "co2e_per_tonne_in_g": 4000,
                    "reporting_year": 2024,
                    "transportation_mode": "logistics_site"
                }
            }
        },
        {
            "carbon_quantity": 4.353479,
            "carbon_unit": "tonne",
            "external_reference": "Air",
            "type": "air_freight",
            "methodology": "GLEC",
            "distance": 5978.0,
            "distance_unit": "kilometer",
            "algorithm_specifics": {
                "algorithm_type": "glec",
                "data": {
                    "co2e_in_g": 4353479,
                    "co2e_emissions_wtw_in_g": 4353479,
                    "co2e_per_tonne_km_in_g": 971,
                    "tonne_km": 4484,
                    "reporting_year": 2024,
                    "transportation_mode": "air_transportation"
                }
            }
        },
        {
            "carbon_quantity": 0.02475,
            "carbon_unit": "tonne",
            "external_reference": "Hub",
            "type": "logistics_site",
            "methodology": "GLEC",
            "algorithm_specifics": {
                "algorithm_type": "glec",
                "data": {
                    "co2e_in_g": 24750.0,
                    "co2e_per_tonne_in_g": 33000,
                    "reporting_year": 2024,
                    "transportation_mode": "logistics_site"
                }
            }
        },
        {
            "carbon_quantity": 0.155943,
            "carbon_unit": "tonne",
            "external_reference": "Truck",
            "type": "road_freight",
            "methodology": "GLEC",
            "distance": 228.0,
            "distance_unit": "kilometer",
            "algorithm_specifics": {
                "algorithm_type": "glec",
                "data": {
                    "co2e_in_g": 155943,
                    "co2e_emissions_wtw_in_g": 155943,
                    "co2e_per_tonne_km_in_g": 793,
                    "tonne_km": 171,
                    "reporting_year": 2024,
                    "transportation_mode": "road_transportation"
                }
            }
        }
    ]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-integration.squake.earth/api-calculations-request-response/logistics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
