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.
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/lune:lune-analytics-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
openapi: 3.2.0
info:
title: Lune Analytics API
version: '1.0'
contact:
name: Lune Support
email: support@lune.co
termsOfService: https://lune.co/terms
description: 'Operations tagged Analytics across 2 of this provider''s published API definitions: openapi.yml, lune-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.lune.co/v1
description: Lune's REST API
tags:
- name: Analytics
description: Get account analytics.
x-lune-component: Analytics
paths:
/analytics/cumulative-per-bundle:
get:
summary: Get cumulative analytics
operationId: getCumulativeAnalyticsPerBundle
security:
- BearerAuth: []
tags:
- Analytics
parameters:
- name: from
in: query
description: 'The start date of the custom date range.
Defaults to 30 days ago if not specified.'
schema:
type: string
format: date
example: '2019-01-01'
- name: through
in: query
description: 'The to (inclusive) date of the custom date range.
Defaults to the current date if not specified.'
schema:
type: string
format: date
example: '2020-01-31'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CumulativeBundleAnalytics'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.lune.co/v1
description: Lune's REST API
/analytics/metrics:
get:
summary: Get metrics
operationId: getMetrics
security:
- BearerAuth: []
tags:
- Analytics
parameters:
- name: from
in: query
description: 'The start date of the custom date range.
Defaults to 30 days ago if not specified.'
schema:
type: string
format: date
example: '2019-01-01'
- name: through
in: query
description: 'The to (inclusive) date of the custom date range.
Defaults to the current date if not specified.'
schema:
type: string
format: date
example: '2020-01-31'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AnalyticsMetrics'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.lune.co/v1
description: Lune's REST API
/analytics/aggregated-by-property:
get:
summary: Get aggregated analytics by property
operationId: getAggregatedAnalyticsByProperty
security:
- BearerAuth: []
tags:
- Analytics
parameters:
- name: from
in: query
description: 'The start date of the custom date range.
Defaults to 30 days ago if not specified.'
schema:
type: string
format: date
example: '2019-01-01'
- name: through
in: query
description: 'The to (inclusive) date of the custom date range.
Defaults to the current date if not specified.'
schema:
type: string
format: date
example: '2020-01-31'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AggregatedAnalyticsByProperty'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.lune.co/v1
description: Lune's REST API
/analytics/emission-calculations:
get:
summary: Get emission calculation metrics
operationId: getEmissionCalculationMetrics
security:
- BearerAuth: []
tags:
- Analytics
parameters:
- name: from
in: query
description: 'The start date of the custom date range.
Defaults to 30 days ago if not specified.'
schema:
type: string
format: date
example: '2019-01-01'
- name: through
in: query
description: 'The to (inclusive) date of the custom date range.
Defaults to the current date if not specified.'
schema:
type: string
format: date
example: '2020-01-31'
- name: interval
in: query
description: 'The time interval over which metrics should be aggregated.
Defaults to day if not specified.'
schema:
type: string
enum:
- day
- month
- name: all_accounts
in: query
description: '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.'
schema:
type: boolean
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/EmissionCalculationMetrics'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.lune.co/v1
description: Lune's REST API
/analytics/business:
get:
summary: Get business emissions analytics
operationId: getBusinessEmissionsAnalytics
description: 'Get business emissions analytics.
Business analytics are calculated for transactions, transaction documents, passenger transportation and activity estimates
that have their `is_transaction`, `is_transaction_document`, `is_passenger_transportation` properties set to true respectively.'
security:
- BearerAuth: []
tags:
- Analytics
parameters:
- name: from
in: query
description: 'The start date of the custom date range.
Defaults to the date of the first estimate if not specified.'
schema:
type: string
format: date
example: '2019-01-01'
- name: through
in: query
description: 'The to (inclusive) date of the custom date range.
Defaults to the current date if not specified.'
schema:
type: string
format: date
example: '2020-01-31'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/BusinessEmissionsAnalytics'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.lune.co/v1
description: Lune's REST API
components:
schemas:
EmissionCalculationMetrics:
type: object
required:
- timeseries
properties:
timeseries:
$ref: '#/components/schemas/CountTimeseries'
OffsetTypeNonNullable:
type: string
description: 'Offset type classification
'
enum:
- emissions_reduction
- carbon_removal
example: emissions_reduction
CumulativeBundleAnalytics:
type: array
description: An array of analytics by bundle objects.
items:
$ref: '#/components/schemas/AnalyticsByBundle'
QuantityAndValueTimeseries:
type: array
description: A timeseries of quantities and values.
items:
type: object
required:
- date
- quantity
- value
properties:
date:
type: string
format: date
example: '2021-09-09'
value:
type: string
example: '222.667'
pattern: ^[0-9]+(\.[0-9]+)?$
quantity:
type: string
pattern: ^[0-9]+(\.[0-9]+)?$
example: '500.50'
description: Quantity of CO2 offsets linked to this activity (tonnes CO2)
example:
- date: '2022-06-25'
value: '13.20'
quantity: '503.342'
- date: '2022-06-26'
value: '23.20'
quantity: '1503.342'
- date: '2022-06-27'
value: '64.23'
quantity: '4700.451'
BusinessEmissionsAnalytics:
type: object
required:
- mass
- number_of_estimates
- categories
properties:
mass:
$ref: '#/components/schemas/EstimateMass'
number_of_estimates:
type: number
description: The number of estimates
example: 2321
categories:
type: object
description: Emissions breakdown by business category
required:
- agriculture
- contractors
- airlines
- car_rentals
- hotels
- transportation
- utilities
- retail
- clothing
- other_shops
- business_services
- professional_services
- government
- uncategorized
properties:
agriculture:
$ref: '#/components/schemas/EstimateMass'
contractors:
$ref: '#/components/schemas/EstimateMass'
airlines:
$ref: '#/components/schemas/EstimateMass'
car_rentals:
$ref: '#/components/schemas/EstimateMass'
hotels:
$ref: '#/components/schemas/EstimateMass'
transportation:
$ref: '#/components/schemas/EstimateMass'
utilities:
$ref: '#/components/schemas/EstimateMass'
retail:
$ref: '#/components/schemas/EstimateMass'
clothing:
$ref: '#/components/schemas/EstimateMass'
other_shops:
$ref: '#/components/schemas/EstimateMass'
business_services:
$ref: '#/components/schemas/EstimateMass'
professional_services:
$ref: '#/components/schemas/EstimateMass'
government:
$ref: '#/components/schemas/EstimateMass'
uncategorized:
$ref: '#/components/schemas/EstimateMass'
example:
mass:
amount: '2688.5'
unit: t
number_of_estimates: 570
categories:
agriculture:
amount: '380.2'
unit: t
contractors:
amount: '210.8'
unit: t
airlines:
amount: '265.1'
unit: t
car_rentals:
amount: '90.3'
unit: t
hotels:
amount: '115.7'
unit: t
transportation:
amount: '155.4'
unit: t
utilities:
amount: '225.6'
unit: t
retail:
amount: '310.9'
unit: t
clothing:
amount: '75.2'
unit: t
other_shops:
amount: '55.8'
unit: t
business_services:
amount: '135.3'
unit: t
professional_services:
amount: '175.1'
unit: t
government:
amount: '38.4'
unit: t
uncategorized:
amount: '18.7'
unit: t
Error:
type: object
description: Individual error information
required:
- error_code
- message
properties:
error_code:
type: string
description: Immutable string representing a specific error.
example: account_suspended
enum:
- api_version_invalid
- account_suspended
- bundle_selection_ratios_invalid
- bundle_selection_bundle_invalid
- order_idempotency_already_exists
- order_quantity_invalid
- order_value_invalid
- bundle_id_invalid
- id_invalid
- distance_invalid
- test_account_name_update_disallowed
- validation_error
- bundle_selection_ratios_invalid_format
- address_not_found
- port_not_found
- locode_not_found
- airport_invalid
- webhook_limit_reached
- time_range_invalid
- exchange_rate_not_found
- live_account_required
- unauthorised
- estimate_not_found
- estimate_order_already_placed
- sustainability_page_slug_not_unique
- sustainability_page_exists
- pagination_limit_invalid
- unsupported_image_format
- source_location_code_invalid
- destination_location_code_invalid
- emission_factor_id_invalid
- emission_factor_unit_mismatch
- emission_factor_gated
- account_scope_incorrect
- service_unavailable
- handle_not_unique
- estimate_idempotency_already_exists
- airport_route_required
- future_departure_invalid
- transaction_document_inference_failure
- transaction_document_creation_failure
- invalid_selected_account_id
- account_idempotency_already_exists
- account_handle_idempotency_key_inconsistency
- shipment_batch_idempotency_already_exists
- route_not_found
- insufficient_credits
- client_account_mismatch
message:
type: string
description: 'Human readable error message.
This value can contain some extra information about the error in
human-readable form. Not suitable for programmatic consumption, the format
is not guaranteed to be stable.
'
AggregatedAnalyticsByProperty:
type: object
required:
- bundle
- location
- registry
- oxford_offsetting_principles
- offset_type
properties:
bundle:
type: array
description: An array of objects describing a bundle's aggregated orders.
items:
type: object
required:
- bundle_id
- bundle_name
- quantity
- value
properties:
bundle_id:
type: string
description: The bundle's unique identifier.
example: va1BEV2VZqnzPkYxJgALg0GeQDoXlWO5
bundle_name:
type: string
description: The bundle's name.
example: Latin America Forestry
quantity:
type: string
pattern: ^[0-9]+(\.[0-9]+)?$
example: '500.50'
description: Quantity of CO2 offsets linked to this activity (tonnes CO2).
value:
type: string
example: '222.667'
pattern: ^[0-9]+(\.[0-9]+)?$
description: CO2 offsets' monetary value.
location:
type: array
description: An array of objects describing a location's aggregated orders.
items:
type: object
required:
- location
- quantity
- value
properties:
location:
type: string
description: Project location (continent). If a project has yet to be assigned 'Not yet allocated' is returned instead.
example: Europe
quantity:
type: string
pattern: ^[0-9]+(\.[0-9]+)?$
example: '500.50'
description: Quantity of CO2 offsets linked to this activity (tonnes CO2).
value:
type: string
example: '222.667'
pattern: ^[0-9]+(\.[0-9]+)?$
description: CO2 offsets' monetary value
registry:
type: array
description: An array of objects describing a registry's aggregated orders.
items:
type: object
required:
- registry_name
- quantity
- value
properties:
registry_name:
oneOf:
- x-lune-name: Actual registry
$ref: '#/components/schemas/Registry'
- x-lune-name: Special value
type: string
enum:
- Not certified
- Not yet allocated
description: 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.
example: Verra
quantity:
type: string
pattern: ^[0-9]+(\.[0-9]+)?$
example: '500.50'
description: Quantity of CO2 offsets linked to this activity (tonnes CO2).
value:
type: string
example: '222.667'
pattern: ^[0-9]+(\.[0-9]+)?$
description: CO2 offsets' monetary value.
oxford_offsetting_principles:
type: array
description: An array of objects describing aggregated orders for each Oxford Offsetting Principle's type.
items:
type: object
required:
- type
- quantity
- value
properties:
type:
type: number
description: 'Oxford Offsetting Principles'' type.
https://lune.co/blog/the-oxford-offsetting-principles-a-framework-to-maximise-the-impact-of-business-carbon-offsetting/.
'
example: 5
minimum: 1
maximum: 5
quantity:
type: string
pattern: ^[0-9]+(\.[0-9]+)?$
example: '500.50'
description: Quantity of CO2 offsets linked to this activity (tonnes CO2)
value:
type: string
example: '222.667'
pattern: ^[0-9]+(\.[0-9]+)?$
description: CO2 offsets' monetary value
offset_type:
type: array
description: An array of objects describing aggregated orders by offset type.
items:
type: object
required:
- offset_type
- quantity
- value
properties:
offset_type:
$ref: '#/components/schemas/OffsetType'
quantity:
type: string
pattern: ^[0-9]+(\.[0-9]+)?$
example: '500.50'
description: Quantity of CO2 offsets linked to this activity (tonnes CO2)
value:
type: string
example: '222.667'
pattern: ^[0-9]+(\.[0-9]+)?$
description: CO2 offsets' monetary value
Registry:
type: string
description: The project's Verification Standard Entity name or equivalent organization.
example: Verra
enum:
- American Carbon Registry
- Verra
- Puro.earth
- Gold Standard
- Climate Action Reserve
- Woodland Carbon Code
- ACCU
- Carbon Future
- Isometric
- Tuv Nord
- ''
ErrorResponse:
x-lune-name: Error response
description: 'An error response containing the error details.
The `error` property provides information about the type of error that occurred.
Use this property for error handling.
The `errors` array is present for backwards compatibility purposes. It always
contains a single error element which is the same seen in the `error` property.
'
type: object
required:
- errors
- error
properties:
errors:
type: array
description: An array containing errors
items:
$ref: '#/components/schemas/Error'
error:
$ref: '#/components/schemas/Error'
OffsetType:
description: 'Offset type classification
'
oneOf:
- $ref: '#/components/schemas/OffsetTypeNonNullable'
- $ref: '#/components/schemas/NullEnum'
example: emissions_reduction
CountTimeseries:
type: array
description: A timeseries representing counters.
items:
type: object
required:
- date
- count
properties:
date:
type: string
format: date
example: '2021-09-09'
count:
type: number
example:
- date: '2022-06-25'
count: 500
- date: '2022-06-26'
count: 550
- date: '2022-06-27'
count: 800
AnalyticsMetrics:
type: object
required:
- number_of_un_sdgs
- number_of_projects
- un_sdg
properties:
number_of_un_sdgs:
type: number
description: The number of supported UN Sustainable Development Goals (SDGs).
example: 10
number_of_projects:
type: number
description: The number of supported carbon offset projects.
example: 10
un_sdg:
$ref: '#/components/schemas/SupportedUNSdg'
EstimateMassUnit:
type: string
description: Unit, `t` for tonne, `kg` for kilogram, `g` for gram, `mg` for milligram, `lbs` for pound
enum:
- mg
- g
- kg
- t
- lbs
example: t
NullEnum:
type:
- string
- 'null'
x-lune-name: 'Null'
description: The property is set to `null`.
enum:
- null
SupportedUNSdg:
type:
- array
- 'null'
description: 'The list of supported UN Sustainable Development Goals (SDGs).
The array is sorted by the goal number (the `un_sdg_number` property), ascending.
'
items:
type: object
required:
- un_sdg_number
- occurrences
properties:
un_sdg_number:
type: number
description: The number which identifies the specific UN SDG.
example: 1
occurrences:
type: number
description: The total number of projects supporting this UN SDG.
example: 5
EstimateMass:
type: object
required:
- amount
- unit
properties:
amount:
type: string
pattern: ^[0-9]+(\.[0-9]+)?$
example: '40.501'
unit:
$ref: '#/components/schemas/EstimateMassUnit'
AnalyticsByBundle:
type: object
required:
- bundle_id
- bundle_name
- timeseries
properties:
bundle_id:
type: string
description: The bundle's unique identifier
example: va1BEV2VZqnzPkYxJgALg0GeQDoXlWO5
bundle_name:
type: string
description: The bundle's name
example: Latin America Forestry
timeseries:
$ref: '#/components/schemas/QuantityAndValueTimeseries'
responses:
TooManyRequests:
description: Too many requests have been made in a short period of time
Unauthorized:
description: The API Key is missing or is invalid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
BadRequest:
description: The request is invalid. Parameters may be missing or are invalid
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
securitySchemes:
BearerAuth:
type: http
scheme: bearer
description: Authorization Bearer API Key (see <a href="#section/Authentication">Authentication</a>)
AccessToken:
type: apiKey
in: query
name: access_token
description: 'An API key used to access a resource that accepts it in the URL.
Note: Lune API keys are not URL-safe, which means that they can''t be included in URLs directly.
They need to be percent-encoded using a function like JavaScript''s [`encodeURIComponent()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) or
Python''s [`urllib.parse.quote()`](https://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote).
'
x-refined-from:
- openapi.yml
- lune-openapi.yml