Skip to main content

Create a shipping emission estimate

Parameters
shipment

Either a mass given in kilograms or tonnes (mass) or the number of Twenty-foot Equivalent Units (TEUs) (with their cargo type, optionally). Note that providing mass will result in more accurate estimates for methods other than container_ship. Estimates using container_ship are more precise when the shipment is given in TEUs.


route

Either the shipping distance or the start/destination address pair.

Note that for sea transport the source/destination pair should be as close to locations of existing and well-known ports as possible. Coordinates or addresses that lie far from the shore line or coordinates deep into the sea or ocean will result in inaccurate calculations.

When transporting goods over unusual routes or between unusual points it's better to provide us the distance directly to ensure better calculations.


method

country_codestring

The three-letter code of the country where the shipping takes place, if applicable.

Providing this value will improve the estimation process. If the shipping spans multiple countries you can either make multiple per-country estimations or choose the country with the largest share of the route.


namestring

A name to reference this calculation.


bundle_selectionarray of object

Bundle selection percentages.

The sum of all percentages must equal 100.

If not specified, the preconfigured allocation ratios are going to be used.

If, for each selection, percentage is not provided, the selection is divided equally (best effort) between bundles. percentage must be provided for all or none of the bundles.


quantity_truncenum

Unit, t for tonne, kg for kilogram, g for gram

Enum:
  • g
  • kg
  • t
Returns
massobject

distanceobject

methodologyarray of enumrequired

Summary of the methodology used to calculate emissions or any value which is a prerequisite.

imo_unavailable_container_ship_fallback: the vessel IMO was not found, therefore a generic container ship emission factor has been used.


idstringrequired

The emission calculation unique identifier


quote

requestobject

Parameters for estimating shipping emissions

  • POST /estimates/shipping
  • curl 'https://api.lune.co/v1/estimates/shipping' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X POST \
      -d '{
        "shipment": {
          "mass": {
            "amount": "40.501",
            "unit": "t"
          }
        },
        "route": {
          "amount": "40.501",
          "unit": "km"
        },
        "method": "inland_waterway_motor_vessel_small"
      }'
      
  • Response
  • {
      "mass": {
        "amount": "40.501",
        "unit": "t"
      },
      "distance": {
        "amount": "40.501",
        "unit": "km"
      },
      "methodology": [
        "imo_unavailable_container_ship_fallback"
      ],
      "id": "90ng23MKvLqbkpMwMw7yMBD4wJQrV6O6",
      "quote": {
        "errors": [
          {
            "error_code": "account_suspended",
            "message": "message"
          }
        ]
      },
      "request": {
        "shipment": {
          "mass": {
            "amount": "40.501",
            "unit": "t"
          }
        },
        "route": {
          "amount": "40.501",
          "unit": "km"
        },
        "method": "inland_waterway_motor_vessel_small",
        "country_code": "PRT",
        "name": "name",
        "bundle_selection": [
          {
            "bundle_id": "BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3",
            "percentage": 34
          },
          {
            "bundle_id": "VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B",
            "percentage": 66
          }
        ],
        "quantity_trunc": "t"
      }
    }