Lune Docs Logo

Analytics

Get analytics for shipping estimates

HTTP GET to /v1/analytics/shipping/public/{account_id}
  • Public endpoint
  • Query parameters

    The account identifier the analytics belongs to.

    The start date of the custom date range. Defaults to 30 days ago if not specified.

    The to (inclusive) date of the custom date range. Defaults to the current date if not specified.

    The time interval over which metrics should be aggregated. Defaults to day if not specified.

    day
    month
    Response

    Timeseries containing the total emissions (tCO₂e) for the various shipping methods. Each element refers to a particular timeframe as seen on date.

    Timeseries containing the mean value of the carbon intensities (gCO₂e/tkm) for shipping estimates. The value represents the emission per tonnes transported per kilometer traveled.

    Total carbon intensity for the returned timeframe.

    Information about the account the analytics are associated with.

    The account's name.

    The account's type.

    live
    test

    The account's logo URL.

    Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found

    Get cumulative analytics

    HTTP GET to /v1/analytics/cumulative-per-bundle
    Query parameters

    The start date of the custom date range. Defaults to 30 days ago if not specified.

    The to (inclusive) date of the custom date range. Defaults to the current date if not specified.

    Response

    An array of analytics by bundle objects.

    An array of analytics by bundle objects.

    The bundle's unique identifier

    The bundle's name

    A timeseries of quantities and values.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Quantity of CO2 offsets linked to this activity (tonnes CO2)

    Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found

    Get emission calculation metrics

    HTTP GET to /v1/analytics/emission-calculations
    Query parameters

    The start date of the custom date range. Defaults to 30 days ago if not specified.

    The to (inclusive) date of the custom date range. Defaults to the current date if not specified.

    The time interval over which metrics should be aggregated. Defaults to day if not specified.

    day
    month

    When true, metrics will include data from all accounts in the organisation. When false, metrics will only include data from the API Key's default account. Defaults to false.

    Response

    A timeseries representing counters.

    Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found

    Get metrics

    HTTP GET to /v1/analytics/metrics
    Query parameters

    The start date of the custom date range. Defaults to 30 days ago if not specified.

    The to (inclusive) date of the custom date range. Defaults to the current date if not specified.

    Response

    The number of supported UN Sustainable Development Goals (SDGs).

    The number of supported carbon offset projects.

    The list of supported UN Sustainable Development Goals (SDGs).

    The array is sorted by the goal number (the un_sdg_number field), ascending.

    The number which identifies the specific UN SDG.

    The total number of projects supporting this UN SDG.

    Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found

    Get aggregated analytics by property

    HTTP GET to /v1/analytics/aggregated-by-property
    Query parameters

    The start date of the custom date range. Defaults to 30 days ago if not specified.

    The to (inclusive) date of the custom date range. Defaults to the current date if not specified.

    Response

    An array of objects describing a bundle's aggregated orders.

    The bundle's unique identifier.

    The bundle's name.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Quantity of CO2 offsets linked to this activity (tonnes CO2).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    CO2 offsets' monetary value.

    An array of objects describing a location's aggregated orders.

    Project location (continent). If a project has yet to be assigned 'Not yet allocated' is returned instead.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Quantity of CO2 offsets linked to this activity (tonnes CO2).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    CO2 offsets' monetary value

    An array of objects describing a registry's aggregated orders.

    The project's Verification Standard Entity name or equivalent organization. If a project has no registry, 'Not certified' is returned. If a project has yet to be assigned, 'Not yet allocated' is returned.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Quantity of CO2 offsets linked to this activity (tonnes CO2).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    CO2 offsets' monetary value.

    An array of objects describing aggregated orders for each Oxford Offsetting Principle's type.

    Oxford Offsetting Principles' type.

    https://lune.co/blog/the-oxford-offsetting-principles-a-framework-to-maximise-the-impact-of-business-carbon-offsetting/.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Quantity of CO2 offsets linked to this activity (tonnes CO2)

    Pattern: ^[0-9]+(\.[0-9]+)?$

    CO2 offsets' monetary value

    An array of objects describing aggregated orders by offset type.

    Offset type classification

    emissions_reduction
    carbon_removal

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Quantity of CO2 offsets linked to this activity (tonnes CO2)

    Pattern: ^[0-9]+(\.[0-9]+)?$

    CO2 offsets' monetary value

    Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found