Carbonara CO2 Recommend API

The Recommend API from Carbonara CO2 — 1 operation(s) for recommend.

Operations 1

POST /v1/recommend Route changes that lower emissions, for up to 1,000 shipments #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/carbonara-co2-org:carbonara-co2-org-recommend-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

carbonara-co2-org-recommend-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sootcase Recommend API
  version: 0.1.0
  description: Freight emissions calculator following the GLEC Framework / ISO 14083 approach. Emissions are in kg CO2e. TTW = tank-to-wheel, WTW = well-to-wheel.
  license:
    name: PolyForm Noncommercial 1.0.0
    identifier: PolyForm-Noncommercial-1.0.0
servers:
- url: https://sootcase.org
  description: 'Free test service; send your API key as ''Authorization: Bearer <key>'' (get one at https://sootcase.org)'
- url: http://localhost:8080
  description: sootcase serve
tags:
- name: Recommend
paths:
  /v1/recommend:
    post:
      summary: Route changes that lower emissions, for up to 1,000 shipments
      description: 'For each shipment, calculates alternatives with the same method: road legs to rail, inland waterway or short sea; air legs to sea or rail; other sea ports; fuller loads (when a load is given). Lists those lower than now, best first, with totals per kind and per lane, the sources of the rules, and what isn''t taken into account (limitations). Defaults: road legs over 300 km (EU Transport White Paper 2011); rail, waterway or sea part over 100 km in a straight line, road to a waterway or sea port within 150 km of it, road to the nearest rail terminal (Directive 92/106/EEC, Art. 1). Results are scenarios, not reported emissions. Send JSON, or a shipments CSV (text/csv) with the settings as JSON in the settings query parameter.'
      parameters:
      - name: settings
        in: query
        schema:
          type: string
        description: With a text/csv body, the settings as JSON (optional).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - shipments
              properties:
                settings:
                  $ref: '#/components/schemas/RecommendSettings'
                shipments:
                  type: array
                  items:
                    $ref: '#/components/schemas/Shipment'
          text/csv:
            schema:
              type: string
      responses:
        '200':
          description: Alternatives
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendResult'
        '400':
          $ref: '#/components/responses/Error'
        '413':
          $ref: '#/components/responses/Error'
        '503':
          $ref: '#/components/responses/Busy'
        '504':
          $ref: '#/components/responses/Error'
      tags:
      - Recommend
      operationId: postV1Recommend
      x-operation-id-source: derived
components:
  responses:
    Busy:
      description: Too many requests in progress; retry after the given seconds
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    Error:
      description: Error
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
  schemas:
    Location:
      type: object
      description: Coordinates, or a code instead of them.
      properties:
        name:
          type: string
        code:
          type: string
          description: UN/LOCODE (NLRTM) or IATA airport code (CPH), used when lat and lon are not given. Find codes with GET /v1/places.
          example: NLRTM
        lat:
          type: number
        lon:
          type: number
    Shipment:
      type: object
      required:
      - legs
      description: Give weight_kg, or teu with teu_net_tonnes or container_load; teu alone uses the dataset's "average" profile (GLEC, 10 t per TEU).
      properties:
        id:
          type: string
        weight_kg:
          type: number
          exclusiveMinimum: 0
        teu:
          type: number
          exclusiveMinimum: 0
        teu_net_tonnes:
          type: number
          description: Net cargo tonnes per TEU
        container_load:
          type: string
          description: Profile name from the dataset's container_loads
        cargo_type:
          type: string
          description: Optional GLEC cargo or load category from the dataset's cargo_types (container, temperature_controlled, light, heavy, European rail commodities); picks GLEC's value for it where the leg's vehicle has one
        legs:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Leg'
        hubs:
          type: array
          items:
            $ref: '#/components/schemas/HubStop'
        add_road_legs:
          type: boolean
          default: true
          description: 'Add road legs where the trip doesn''t join up: across a gap of more than 5 km between one leg''s end and the next leg''s start, and to or from a port or rail terminal when a sea, rail or inland waterway leg starts or ends off its network (the leg is moved there). Added and moved legs are marked in the result. When false, gaps and inland sea ends are only warnings.

            '
    HubStop:
      type: object
      required:
      - hub_type
      properties:
        id:
          type: string
        hub_type:
          type: string
          example: transshipment
          description: 'GLEC v3.3 Table 3 hub types: transshipment, storage_transshipment, warehouse, liquid_bulk_terminal (add _mixed for ambient and temperature-controlled sites; per tonne), intermodal_terminal, intermodal_terminal_temperature_controlled (per container)'
        containers:
          type: number
          description: Containers handled, for per-container hub types (intermodal terminals)
    DistanceType:
      type: string
      enum:
      - sfd
      - gcd
      - actual
      description: Shortest feasible, great-circle, or actually travelled distance (GLEC / ISO 14083)
    RecommendSettings:
      type: object
      properties:
        kinds:
          type: array
          items:
            type: string
            enum:
            - road_to_rail
            - road_to_waterway
            - road_to_short_sea
            - air_to_sea
            - air_to_rail
            - other_port
            - fuller_loads
            - larger_truck
            - electric_truck
            - bio_lng_truck
          description: Kinds to try; empty means all (fuller_loads only with a load)
        min_road_km:
          type: number
          description: Road legs longer than this are tried on rail, waterway and short sea (default 300)
        min_main_km:
          type: number
          description: The rail, waterway or sea part must be longer than this in a straight line (default 100)
        max_port_road_km:
          type: number
          description: Road to and from a waterway or sea port within this of it in a straight line (default 150)
        terminal:
          type: string
          enum:
          - nearest
          - best_trip
        rail_vehicle:
          type: string
          description: default freight_train
        waterway_vehicle:
          type: string
          description: default container_barge
        short_sea_vehicle:
          type: string
          description: default roro
        sea_vehicle:
          type: string
          description: default container_ship (air to sea)
        port_radius_km:
          type: number
          description: Other ports within this of the port used now (default 800)
        max_ports:
          type: integer
          description: Other ports to try per port (default 4)
        load_tonnes:
          type: number
        load_factor:
          type: number
        empty_trip_factor:
          type: number
        load_vehicle:
          type: string
        source:
          type: string
          description: Where the load values come from
    RecommendResult:
      type: object
      properties:
        label:
          type: string
        settings:
          $ref: '#/components/schemas/RecommendSettings'
        skipped:
          type: object
          additionalProperties:
            type: string
        now:
          $ref: '#/components/schemas/ScenarioTotals'
        best:
          $ref: '#/components/schemas/ScenarioTotals'
        saved_kg:
          type: number
        saved_pct:
          type: number
        kinds:
          type: array
          items:
            type: object
          description: 'Per kind: shipments, saved_kg, best_for and its GLEC reduction area'
        areas:
          type: array
          items:
            type: object
          description: GLEC v3.3's five reduction areas (id, name, kinds tried in each)
        lanes:
          type: array
          items:
            type: object
        sources:
          type: array
          items:
            type: string
        limitations:
          type: array
          items:
            type: string
        failed:
          type: integer
        shipments:
          type: array
          items:
            type: object
            properties:
              shipment_id:
                type: string
              lane:
                type: string
              weight_kg:
                type: number
              now:
                $ref: '#/components/schemas/RecommendRoute'
              legs:
                type: array
                items:
                  type: object
                description: The shipment's own legs
              options:
                type: array
                items:
                  allOf:
                  - $ref: '#/components/schemas/RecommendRoute'
                  - type: object
                    properties:
                      kind:
                        type: string
                      summary:
                        type: string
                      saved_kg:
                        type: number
                      saved_pct:
                        type: number
                      extra_km_pct:
                        type: number
                      legs:
                        type: array
                        items:
                          type: object
              notes:
                type: array
                items:
                  type: string
              error:
                type: string
              retryable:
                type: boolean
                description: 'The error is temporary (a routing service that didn''t answer): try again later'
    ScenarioTotals:
      type: object
      properties:
        ttw_kg:
          type: number
        biogenic_co2_kg:
          type: number
          description: Biogenic CO2, reported separately and not included in the totals (GLEC v3.3 p. 64)
        wtt_kg:
          type: number
        wtw_kg:
          type: number
    FuelUse:
      type: object
      required:
      - fuel
      - amount
      properties:
        fuel:
          type: string
          example: diesel
        amount:
          type: number
          description: In the fuel factor's unit
        vehicle_tonne_km:
          type: number
          description: Total tonne-km on the vehicle trip, for allocation. 0 or absent = whole trip.
        factor:
          type: object
          description: The fuel supplier's or your own emission factor, used instead of the dataset's (fuel is then just its name).
          required:
          - unit
          - wtw_kg_per_unit
          - source
          properties:
            unit:
              type: string
              example: l
            wtw_kg_per_unit:
              type: number
              exclusiveMinimum: 0
              description: Well-to-wheel kg CO2e per unit
            ttw_kg_per_unit:
              type: number
              minimum: 0
              description: Tank-to-wheel kg CO2e per unit
              part of WTW: null
            source:
              type: string
              description: Who gives the factor
              and for what: null
            biogenic_co2_kg_per_unit:
              type: number
              minimum: 0
              description: Reported apart
              not in WTW: null
    Mode:
      type: string
      enum:
      - road
      - rail
      - sea
      - air
      - inland_waterway
    OwnFactor:
      type: object
      description: The carrier's or your own intensity for a leg (primary data, ISO 14083 7.2.3), used instead of a default value.
      required:
      - wtw_g_per_tkm
      - source
      properties:
        wtw_g_per_tkm:
          type: number
          exclusiveMinimum: 0
        ttw_g_per_tkm:
          type: number
          minimum: 0
          description: Part of WTW; the rest is WTT
        source:
          type: string
          description: Who measured it
          and for what (e.g. the carrier's TOC report and year): null
        distance_basis:
          type: string
          enum:
          - sfd
          - gcd
          - actual
          description: Distance type the intensity is per tonne-km of. Absent = the leg's own distance type, so no DAF.
    RecommendRoute:
      type: object
      properties:
        ttw_kg:
          type: number
        wtt_kg:
          type: number
        wtw_kg:
          type: number
        biogenic_co2_kg:
          type: number
        distance_km:
          type: number
        transfers:
          type: integer
          description: Changes of mode along the route
        modes:
          type: array
          items:
            type: string
        steps:
          type: array
          items:
            type: object
        terminals:
          type: array
          description: 'Alternatives only: the terminal handlings the alternative adds to now (GLEC v3.3 intermodal terminal, per container; included in the totals). Same fields as a result''s hubs.'
          items:
            type: object
    Leg:
      type: object
      required:
      - mode
      properties:
        id:
          type: string
        mode:
          $ref: '#/components/schemas/Mode'
        cargo_type:
          type: string
          description: Overrides the shipment's cargo_type for this leg
        vehicle_type:
          type: string
          example: hgv
          description: Must exist in the loaded dataset; list them with GET /v1/factors
        from:
          $ref: '#/components/schemas/Location'
        to:
          $ref: '#/components/schemas/Location'
        distance_km:
          type: number
          description: Overrides computed distance when > 0
        distance_type:
          $ref: '#/components/schemas/DistanceType'
        fuel:
          $ref: '#/components/schemas/FuelUse'
        load_factor:
          type: number
          exclusiveMinimum: 0
          maximum: 1
          description: 'Load as a share of the load model''s payload (DESNZ''s average full load, e.g. 17.9 t for an artic over 33 t), not of the truck''s rated payload; switches the leg to the dataset''s load model. Give this or load_tonnes. In GLEC and EcoTransIT a load factor is a share of the rated payload, so the same value means more tonnes there: to compare, or when the weight is known, give load_tonnes.

            '
        load_tonnes:
          type: number
          exclusiveMinimum: 0
          description: 'Tonnes on the truck (all cargo, average over the loaded km); switches the leg to the load model. Up to 1.6 × the model''s payload: above its payload the model is extended linearly.

            '
        empty_trip_factor:
          type: number
          minimum: 0
          description: Empty km per loaded km (needs load_factor or load_tonnes)
        repositioning_km:
          type: number
          minimum: 0
          description: 'Trucks: km driven empty for this trip (to the pickup, or back after delivery), shared over the truck''s load like empty running (added to the empty trip factor as km per actual loaded km). Without a load, the shipment is taken as the truck''s whole load.

            '
        energy_kwh_per_tkm:
          type: number
          exclusiveMinimum: 0
          description: Electricity per tonne-km; with country, switches the leg to the energy method
        country:
          type: string
          description: ISO 3166-1 alpha-3 country whose grid powers the leg, e.g. DNK
        own_factor:
          $ref: '#/components/schemas/OwnFactor'