SQUAKE API Documentation

Introduction

Trusted technology to achieve your carbon targets.

The SQUAKE Solution Suite is live with industry leaders from several travel and logistics segments and performs accurate carbon calculations for all types of activities (e.g. flights, road, accommodation amongst others) according to national and international standards. It automates carbon reductions and/or compensations along the supply chain, from supplier selection (SAF, DAC, ecological restoration) to inventory management, invoicing and credit retirement.

Customer Support

For any issues or inquiries, you can reach our dedicated customer support team through our Support Page. This is the best place to ask questions, report incidents, or get assistance with integrating or using SQUAKE's solutions.

Contact Forms

Our contact forms are designed to help you communicate with us effectively. Whether you want to get in contact with our support team or need to report an incident, we've got you covered. Please use the appropriate form below:

  • Contact Form: Get in contact with our customer support team or share your thoughts and suggestions about our services and processes.
  • Incident Form: Report any issues or incidents you've encountered, and our support team will respond as soon as possible.

Authentication

SQUAKE uses API keys to authenticate requests. You can create and revoke API keys in the Dashboard, which you can access by contacting us under product@squake.earth. You should securely store your API keys; and encrypt them on rest if possible. Be aware that each API key is shown exactly once in the UI during creation. SQUAKE advises rotating API keys on a regular basis.

To use the sandbox environment, a separate API key must be created. Switch to sandbox mode in the dashboard, then create an API key.

All requests must be authenticated and made over HTTPS. SQUAKE supports TLS 1.2 - TLS 1.3. Requests without authentication or via plain HTTP result in an error.

When using HTTP Basic Auth, the API key is the username; leave the password blank. For bearer auth, pass the API key as the token.

Example using HTTP Basic Auth (note: there is no password, but a colon is still required):

curl https://api.squake.earth/v2/pricing -u <YOUR_API_KEY>

Example using bearer auth:

curl https://api.squake.earth/v2/pricing -H "Authorization: Bearer <YOUR_API_KEY>"

Request ID

SQUAKE associates each API request with a unique identifier. Find this value in the SQUAKE-Request-Id header. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

Uptime Monitoring

Please visit status.squake.earth to check our uptime monitor. You can subscribe to events to stay informed of any service disruption. We will also publish a post-mortem about any incident should one occur.

You can programmatically check if servers are reachable. Read the documentation of the Health Check endpoints for details. The health check endpoints are the only endpoints that do not require authentication.

Sandbox

There is a sandbox server available for testing at

https://api.sandbox.squake.earth

Sandbox and production are separate systems and share no data. Sandbox uses less computing power and may be slower than production. Both sandbox and production environments run the same version of the API; thus, they share the same feature set.

To use the sandbox environment, a separate API key must be created. Switch to sandbox mode in the dashboard, then create an API key.

Static IP Addresses

All outgoing traffic originates from one of the following static IP addresses. SQUAKE owns these IP addresses and never shares them for any other traffic.

EnvironmentIP AddressGeo Region
Production52.59.66.213Europa/Germany
Production52.7.39.159USA
Sandbox18.197.251.125Europa/Germany

Getting Started with SQUAKE API

This guide will help you make requests to the SQUAKE API in order to calculate emissions for a travel journey.

Choose a group of Endpoints

SQUAKE API has the following group of endpoints:

  • Calculations - Calculates carbon emissions for various activities in a low-latency process.
  • Pricing - Returns pricing for a given product and carbon quantity, valid for two weeks by default.
  • Combined Calculation & Pricing - Performs carbon calculation and pricing in a single call for convenience.
  • Carbon Comparison - Compares carbon quantities to recognizable items like cars or light bulbs.
  • Purchases - Registers a purchase to compensate for carbon emissions, requiring a prior pricing quote.
  • Products - Lists purchasable compensation options, including single climate projects and bundles.
  • Files - Manages file attachments related to purchases, such as compensation confirmations.
  • Webhooks - Allows you to receive notifications about events happening in SQUAKE.
  • Audits - Provides a list of audits or a specific audit for calculations.
  • Health Check - Verifies if SQUAKE's server is reachable.

Precision of Calculations

Bus Databases

If you want operator-specific calculations for buses, then use the following dataset supported by SQUAKE's methodology.

Car Databases

If you have specific information about car models, then use one of the following methodologies: ADEME (France), US-EPA (USA) and EU-EEA (EU).

Hotel Databases

Use the HCMI and SQUAKE methodologies database to obtain more accurate emissions. If you know an eco-label, use SQUAKE's eco-label dataset.

GLEC Databases

For road and sea logistics activities according to GLEC, use the GLEC dataset.

Train Databases

For operator-specific calculations for trains, use the train dataset.

Van Databases

For van calculations, use the EU-EEA supported dataset.

Carbon Comparison

Compare carbon quantities to more recognizable items like cars or kettles. View accepted units in this comparison database.


Download OpenAPI description
Languages
Servers
Production

https://api.squake.earth/

Sandbox

https://api.sandbox.squake.earth/

Calculations

Operations

Pricing

Operations

Combined Calculation & Pricing

Operations

Perform a Calculation including a Price Quote

Request

Convenience all-in-one endpoint to perform carbon calculation and pricing. A purchase can be performed via API or SQUAKE's checkout page using the returned payment_link.

All features supported by either the /calculations or /pricing endpoint are equally valid for this combined endpoint. Please read the respective descriptions for details.

If you need only either pricing or carbon emissions, SQUAKE advises using the specific endpoints for lower latency and reduced implementation complexity.'

Security
Bearer-Auth
Bodyapplication/json
expandArray of strings

If you choose to expand on e.g. "items", SQUAKE returns emissions per each item separately (in addition to a total value). If you include items.pricing a pricing token will be returned for each item.

Items Enum"items""product""price""items.pricing"
itemsArray of (Accommodation (Specified interval (object) or Specified number of nights (object))) or Air Freight (object) or Bus (object) or Car (object) or Coffee Production (object) or Event (object) or (Expenditure ((With merchant_category (With country code (object) or Without country code (object))) or With merchant_category_code (object))) or Ferry (object) or Flight (object) or Hotel (object) or Inland Waterways (object) or Logistics Site (object) or Logistics (object) or Private Jet (object) or Rail Freight (object) or Restaurant (object) or Road Freight (object) or Sea Freight (object) or Train (object) or Van (object)(Carbon Emission Calculation Types)required
Any of:

Accommodation considers only activities related to short-term rentals, lodging, sublets, etc.

SQUAKE has country-specific values for most parameters. If the country is omitted, default values will apply.

Any of:

Accommodation considers only activities related to short-term rentals, lodging, sublets, etc.

SQUAKE has country-specific values for most parameters. If the country is omitted, default values will apply.

items[].​auditboolean(Audit mode)

SQUAKE provides you the option to create audit records for your calculations requests.

Note: to use this feature you need to have it enabled for your account, please contact us for more information.

Default false
items[].​typeanyrequired
Value "accommodation"
items[].​methodologyanyrequired
Default "SQUAKE"
Value "SQUAKE"
items[].​external_referencestring(external_reference)<= 128 characters

A unique identifier that helps you link the resulting emissions to the requested item. Especially useful if multiple items are requested since SQUAKE cannot guarantee to keep the same order. The maximum length is 128 characters.

items[].​number_of_nightsinteger(int32)>= 1

Required if start and end dates are omitted; else this is ignored.

items[].​starts_onstring(date)required

The format is ISO 8601 Date, YYYY-MM-DD. Required if season-specific methodology shall be used, or number of nights is omitted.

items[].​ends_onstring(date)required

The format is ISO 8601 Date, YYYY-MM-DD. Required if season-specific methodology shall be used, or number of nights is omitted.

items[].​countrystring(country)[ 2 .. 3 ] characters^[A-Z]{2,3}$

Two-letter or three-letter code as defined in ISO 3166-1 alpha-2 and alpha-3 respectively.

items[].​number_of_travelersinteger>= 1required

The default value depends on the country.

items[].​square_metersnumber(double)>= 1required

The default value depends on the country.

items[].​saunaboolean
Default false
items[].​parkingboolean
Default true
items[].​swimming_poolboolean
Default false
items[].​air_conditionerboolean
Default false
items[].​garageboolean
Default false
productstringproduct_[A-Za-z0-9]*required
payment_link_return_urlstring

If the customer does not exit the browser after the purchase, on success, SQUAKE will redirect the customer to this link.

currencystring(currency)= 3 characters^[A-Z]{3}$

3-letter ISO 4217 alpha code of the currency.

Enum"AED""AMD""ARS""AUD""AZN""BAM""BGN""BHD""BRL""CAD"
carbon_unitstring(carbon_unit)

SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".

Enum"tonne""kilogram""gram"
distance_unitstring(distance_unit)

SQUAKE uses common distance units

Enum"meter""kilometer""feet""mile""nautical_mile"
payment_methodstring(payment_method)

Controls the way you want to process the purchase.

If stripe is used then you''ll receive a payment_link in response.

If batch_settlement is used, then you''ll have to use /purchases endpoint to finalise the purchase.

Enum"stripe""batch_settlement"
curl -i -X POST \
  https://api.squake.earth/v2/calculations-with-pricing \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "expand": [
      "items"
    ],
    "items": [
      {
        "audit": false,
        "type": "accommodation",
        "methodology": "SQUAKE",
        "external_reference": "string",
        "number_of_nights": 2,
        "starts_on": "2020-01-01",
        "ends_on": "2020-01-01",
        "country": "DE",
        "number_of_travelers": 1,
        "square_meters": 50,
        "sauna": false,
        "parking": true,
        "swimming_pool": false,
        "air_conditioner": false,
        "garage": false
      }
    ],
    "product": "product_afg3465afg3",
    "payment_link_return_url": "string",
    "currency": "EUR",
    "carbon_unit": "tonne",
    "distance_unit": "kilometer",
    "payment_method": "stripe"
  }'

Responses

OK

Headers
SQUAKE-Request-Idany(SQUAKE-Request-Id)

Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

Bodyapplication/json
idstringrequired

A token encoding the pricing. Used to make a purchase.

carbon_quantitynumberrequired
carbon_unitstring(carbon_unit)required

SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".

Enum"tonne""kilogram""gram"
payment_linkstring
pricestring or Price (object)required
One of:

ID of a price.

stringprice_[A-Za-z0-9]*

ID of a price.

productstring or Product (object)required
Any of:

ID of a product.

stringproduct_[A-Za-z0-9]*

ID of a product.

valid_fromstring(date)(iso_8601_date)^\d{4}-\d{2}-\d{2}$required

Date in ISO 8601 notation.

valid_untilstring(date)(iso_8601_date)^\d{4}-\d{2}-\d{2}$required

Date in ISO 8601 notation.

currencystring(currency)= 3 characters^[A-Z]{3}$required

3-letter ISO 4217 alpha code of the currency.

Enum"AED""AMD""ARS""AUD""AZN""BAM""BGN""BHD""BRL""CAD"
totalintegerrequired

The total amount in the lower denomination of the currency; e.g. 12.34 USD would be 1234.

itemsArray of objects

Expand items to receive emissions per item. By default, this is not included.

Response
application/json
{ "id": "string", "carbon_quantity": 0, "carbon_unit": "tonne", "payment_link": "string", "price": "price_1MMroL2eZvKYlo2CxbxAACvb", "product": "product_01fa2d8f04e424", "valid_from": "2023-01-28", "valid_until": "2023-01-28", "currency": "EUR", "total": 0, "items": [ {} ] }

Carbon Comparison

Operations

Purchases

Operations

Products

Operations

Files

Operations

Webhooks

Operations

Audits

Audit logs are created when enabled on calculation requests.

ℹ️ To use this feature you need to have it enabled for your account, please contact us for more information.
Operations

Health Check

Check if SQUAKE's server can be reached.

Operations