Download OpenAPI specification:Download
The Greenly Carbon Analytics API is a set of RESTful services which enable the enrichment of bank transactions with carbon footprint analytics.
All request and response payloads, including errors, use the JSON naming convention.
2 API environments are available: a sandbox environment used to test the API capacities and your integration with these services and the production environment.
To have access to these environments, you will need to obtain API keys by contacting us at contact@greenly.earth.
The 2 environments are available at the following URL:
You can download our sample Postman requests at the following URL: http://offspend.github.io/PostmanRequests.zip
You then need to add your API key in the Greenly Sandbox API environment. After that, you should be able to create a user. Executing this Postman request will automatically set the latest created userId as a global env in your Postman environment. So after creating this user, you can directly try all the other requests including the Calculate Carbon Footprints one which will show you the carbon footprint analysis for a lot of different transactions.
The algorithm classifies transactions to providers and purchase categories so as to measure their carbon footprint based on their labels. In the best case, this label would consist only of the name of the recipient of the payment. Yet, in general, raw label contain overhead information, related in particular to the type of payment and the date of the transaction.
In the case where a cleaning of the overhead is done on the bank side, only the cleaned label should be transmitted to the API. If no cleaning is done or the cleaning is deemed to be too noisy or unreliable, raw labels can be also transmitted to the API.
Indeed, when a label is received, the classification algorithm looks for all common overhead patterns, such as “CB XXXXX”, “paiement par carte”, or “01/06/2020”, among many other overhead patterns.The classification algorithm removes all such patterns used by all banks that it was possible to enumerate during the R&D process. Yet, it is always possible that some patterns could not be found, or that the format evolves at some time. In that case, the cleaning of the pattern should either be done at the user side, or the user should contact the Greenly support team to ensure proper cleaning of the raw label and hence proper classification and estimation of the carbon footprint.
As a toy example, let us consider the following raw label to illustrate the allowed format: “paiement par carte super u 35 st jacques de 05/07”. Providing the “cleaned label” would be “super u 35 st jacques de“ or variations thereof, and as it can be observed the cleaned label does not need to be perfectly informative nor cleaned. As mentioned above, it is also possible to simply provide the raw label and the API will take care of removing the date and the overhead linked to card payment. Yet, it is not desired to provide both cleaned and raw labels using a separator (e.g. a new line ‘ ’ separator or other variations) as this would lead to degraded performances.
Retrieve the details of all low-carbon alternatives, either advices or low-carbon provider.
[- {
- "recommendedProviders": [
- {
- "logoUrl": "string",
- "url": "string",
- "name": "string"
}
], - "ratioEstimatedReduction": 0,
- "sources": [
- "string"
], - "description": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "geographicalRestriction": "GB",
- "isProviderAlternative": true,
- "id": "string"
}
]
Retrieve the details of one low-carbon alternative, either advice or low-carbon provider.
id required | string |
{- "recommendedProviders": [
- {
- "logoUrl": "string",
- "url": "string",
- "name": "string"
}
], - "ratioEstimatedReduction": 0,
- "sources": [
- "string"
], - "description": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "geographicalRestriction": "GB",
- "isProviderAlternative": true,
- "id": "string"
}
[- {
- "remainingOffsetInTCO2eq": 0,
- "totalOffsetInTCO2eq": 0,
- "priceInEuroPerTCO2eq": 0,
- "certificationsLogoURL": [
- "string"
], - "certifications": [
- "string"
], - "partnerLogoURL": "string",
- "partner": "string",
- "longDescription": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "shortHandDescription": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "location": "string",
- "name": "string",
- "id": "string"
}
]
Retrieve the details of one offset project.
offsetProjectId required | string |
{- "remainingOffsetInTCO2eq": 0,
- "totalOffsetInTCO2eq": 0,
- "priceInEuroPerTCO2eq": 0,
- "certificationsLogoURL": [
- "string"
], - "certifications": [
- "string"
], - "partnerLogoURL": "string",
- "partner": "string",
- "longDescription": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "shortHandDescription": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "location": "string",
- "name": "string",
- "id": "string"
}
Booking a quantity of CO2 equivalent to offset from an offset project
string (Optional) Email of the user carrying out the booking | |
bookedOffsetInTCO2eq required | number <double> Quantity of offsetting being booked (in TCO2eq) |
offsetProjectId required | string Unique identifier of the chosen project |
{- "email": "string",
- "bookedOffsetInTCO2eq": 0,
- "offsetProjectId": "string"
}
{- "totalPrice": 0,
- "bookingSuccessful": true
}
Retrieve the details of all purchase categories.
countryId | string |
[- {
- "possibleTags": [
- {
- "translations": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "enumValues": [
- {
- "translations": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "id": "string"
}
], - "type": "boolean",
- "id": "string"
}
], - "translations": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "parentPurchaseCategory": "Transport",
- "methodology": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "id": "string"
}
]
Retrieve the details of one purchase category.
purchaseCategoryId required | string |
countryId | string |
{- "possibleTags": [
- {
- "translations": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "enumValues": [
- {
- "translations": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "id": "string"
}
], - "type": "boolean",
- "id": "string"
}
], - "translations": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "parentPurchaseCategory": "Transport",
- "methodology": {
- "en": "string",
- "fr": "string",
- "es": "string",
- "it": "string",
- "de": "string",
- "da": "string",
- "fi": "string",
- "nl": "string",
- "pl": "string",
- "pt": "string",
- "sv": "string"
}, - "id": "string"
}
Calculate the emissions in kg for each category based on a completed survey.
yearlyIncome required | integer <int32> >= 0 Annual income in Euros |
diet required | string (AcceptedDietAnswer) Enum: "vegan" "vegetarian" "average" "whiteMeat" "redMeat" "normal" "meatLover" "noBeef" |
numberOfShortFlightsLastYear required | integer <int32> >= 0 Number of flights in the last year that were shorter than three hours |
numberOfLongFlightsLastYear required | integer <int32> >= 0 Number of flights taken in the last year that were longer than three hours |
transportationMode required | string (AcceptedVehicleAnswer) Enum: "thermalCar" "hybridCar" "electricCar" "motorcycle" "bike" "electricMotorcycle" "bus" "train" "onFoot" "car" "none" |
transportationDuration required | integer <int32> >= 0 Average daily travel time (Round trip in min) |
hasGasHeating required | boolean Uses gas heating |
hasGreenElectricitySupplier required | boolean Has a green electricity provider |
surfaceAreaOfHousing required | integer <int32> >= 0 Surface area of the home (in m2) |
numberOfPeopleLivingInHousing required | integer <int32> >= 0 Count of people living in the home |
countryCode required | string (SurveyCountryCode) Enum: "FR" "GB" "SE" |
{- "yearlyIncome": 40000,
- "diet": "vegan",
- "numberOfShortFlightsLastYear": 3,
- "numberOfLongFlightsLastYear": 1,
- "transportationMode": "thermalCar",
- "transportationDuration": 60,
- "hasGasHeating": true,
- "hasGreenElectricitySupplier": true,
- "surfaceAreaOfHousing": 60,
- "numberOfPeopleLivingInHousing": 2,
- "countryCode": "FR"
}
{- "totalEmissionsInKg": 0,
- "uncategorizedEmissionsInKg": 0,
- "housingEmissionsInKg": 0,
- "servicesEmissionsInKg": 0,
- "shoppingEmissionsInKg": 0,
- "foodEmissionsInKg": 0,
- "transportEmissionsInKg": 0
}
Updates a user profile based on the survey responses and returns its yearly emissions.
userId required | string |
yearlyIncome required | integer <int32> >= 0 Annual income in Euros |
diet required | string (AcceptedDietAnswer) Enum: "vegan" "vegetarian" "average" "whiteMeat" "redMeat" "normal" "meatLover" "noBeef" |
numberOfShortFlightsLastYear required | integer <int32> >= 0 Number of flights in the last year that were shorter than three hours |
numberOfLongFlightsLastYear required | integer <int32> >= 0 Number of flights taken in the last year that were longer than three hours |
transportationMode required | string (AcceptedVehicleAnswer) Enum: "thermalCar" "hybridCar" "electricCar" "motorcycle" "bike" "electricMotorcycle" "bus" "train" "onFoot" "car" "none" |
transportationDuration required | integer <int32> >= 0 Average daily travel time (Round trip in min) |
hasGasHeating required | boolean Uses gas heating |
hasGreenElectricitySupplier required | boolean Has a green electricity provider |
surfaceAreaOfHousing required | integer <int32> >= 0 Surface area of the home (in m2) |
numberOfPeopleLivingInHousing required | integer <int32> >= 0 Count of people living in the home |
countryCode required | string (SurveyCountryCode) Enum: "FR" "GB" "SE" |
{- "yearlyIncome": 40000,
- "diet": "vegan",
- "numberOfShortFlightsLastYear": 3,
- "numberOfLongFlightsLastYear": 1,
- "transportationMode": "thermalCar",
- "transportationDuration": 60,
- "hasGasHeating": true,
- "hasGreenElectricitySupplier": true,
- "surfaceAreaOfHousing": 60,
- "numberOfPeopleLivingInHousing": 2,
- "countryCode": "FR"
}
Calculate the carbon footprints of the input transactions
languages | Array of strings (Language) languages requested for the methodologies. If no language is provided we use a default language based on the countryId of the transaction. |
required | Array of objects (InputTransaction) List of the user transactions. |
userId | string (Required) Id of the user owning the transactions. This field is mandatory in most cases. |
{- "languages": [
- "en"
], - "transactions": [
- {
- "countryCode": "string",
- "tagValues": [
- {
- "value": "string",
- "tagId": "string"
}
], - "purchaseCategoryId": "string",
- "mccCode": "string",
- "amount": 0,
- "type": "CREDIT",
- "label": "string",
- "amountInEur": 0,
- "id": "string"
}
], - "userId": "string"
}
[ ]
Update a user with new default tag values. All previous tag values are replaced (the two objects are not merged) so you must provide all tag values that apply to the user during each call.
userId required | string |
required | Array of objects (TagValue) |
{- "defaultTagValues": [
- {
- "value": "string",
- "tagId": "string"
}
]
}
{- "defaultTagValues": [
- {
- "value": "string",
- "tagId": "string"
}
], - "userId": "string"
}