Flowcarbon Docs
Search
⌃K
Comment on page

CO2 Calculator

​

CO2 Calculator API

Summary

The API can be used to estimate the annual carbon emissions footprint of a single person by taking different emission-generating areas of living into account. It is organized around REST, uses standard HTTP response codes, and returns JSON-encoded responses.

Base URL

https://backend.flowcaboom.com/api/v1/co2-calculator

Overview

URL
method
description
/ping
GET
for monitoring purposes
/countries
GET
get a list of all supported countries
/config
GET
get the default measurement units for a country
/footprint
GET
get the average carbon footprint of a person living in a country
/flight
GET
get the carbon emissions produced by flight behavior
/diet
GET
get the average carbon footprint of a diet
/car
GET
get the carbon emissions produced by distance driven by car or rail usage
/clothes
GET
get the carbon emissions produced by shopping behavior
/energy
GET
get the carbon emissions produced by electricity and heating
No authentication is required.

Errors

The API responses with conventional HTTP codes to indicate success or failure of a request. In general:
  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate an error that failed given the provided information. The error is briefly explained.
  • Codes in the 5xx range indicate a server error.

HTTP status codes

code
meaning
description
200
OK
Everything worked as expected.
400
Bad Request
The request was unacceptable, often due to a wrong or missing parameter.
401
Unauthorized
No valid API key provided.
402
Request Failed
The parameters were valid but the request failed.
403
Forbidden
The API key doesn't have permissions to perform the request.
404
Not Found
The requested resource doesn't exist often because of not accepted path parameters.
429
Too Many Requests
Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
500, 502, 503, 504
Server Errors
Something went wrong on our side. We are sorry.

Ping

Endpoint: /ping

Successful response

{
"message": "pong"
}

Countries list

Endpoint: /countries

Returns

If the request succeeded, a list of all supported countries and their basic information are returned. Otherwise, this call returns an error.
Fields
field
data type
description
countries
Array of Dictionaries
array of all supported countries and their information, alphabetically ordered by their names
country_code
String
the ISO 3166-1 alpha-3 country code
country_name
String
the name of the country
sub_region
String
the sub region of the country
region
String
the region of the country
measurement_system
String
the most widely used measurement system of the country

Example

Request
GET https://backend.flowcaboom.com/api/v1/co2-calculator/countries
Successful response
Content (click to expand)
[
{
"country_code":"AFG",
"country_name":"Afghanistan",
"sub_region":"Southern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"ALA",
"country_name":"Ã…land Islands",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"ALB",
"country_name":"Albania",
"sub_region":"Southern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"DZA",
"country_name":"Algeria",
"sub_region":"Northern Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"ASM",
"country_name":"American Samoa",
"sub_region":"Polynesia",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"AND",
"country_name":"Andorra",
"sub_region":"Southern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"AGO",
"country_name":"Angola",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"AIA",
"country_name":"Anguilla",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"ATG",
"country_name":"Antigua and Barbuda",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"ARG",
"country_name":"Argentina",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"ARM",
"country_name":"Armenia",
"sub_region":"Western Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"ABW",
"country_name":"Aruba",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"AUS",
"country_name":"Australia",
"sub_region":"Australia and New Zealand",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"AUT",
"country_name":"Austria",
"sub_region":"Western Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"AZE",
"country_name":"Azerbaijan",
"sub_region":"Western Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"BHS",
"country_name":"Bahamas",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"BHR",
"country_name":"Bahrain",
"sub_region":"Western Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"BGD",
"country_name":"Bangladesh",
"sub_region":"Southern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"BRB",
"country_name":"Barbados",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"BLR",
"country_name":"Belarus",
"sub_region":"Eastern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"BEL",
"country_name":"Belgium",
"sub_region":"Western Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"BLZ",
"country_name":"Belize",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"BEN",
"country_name":"Benin",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"BMU",
"country_name":"Bermuda",
"sub_region":"Northern America",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"BTN",
"country_name":"Bhutan",
"sub_region":"Southern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"BOL",
"country_name":"Bolivia",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"BES",
"country_name":"Bonaire, Sint Eustatius and Saba",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"BIH",
"country_name":"Bosnia And Herzegovina",
"sub_region":"Southern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"BWA",
"country_name":"Botswana",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"BVT",
"country_name":"Bouvet Island",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"BRA",
"country_name":"Brazil",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"IOT",
"country_name":"British Indian Ocean Territory",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"BRN",
"country_name":"Brunei Darussalam",
"sub_region":"South-eastern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"BGR",
"country_name":"Bulgaria",
"sub_region":"Eastern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"BFA",
"country_name":"Burkina Faso",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"BDI",
"country_name":"Burundi",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"CPV",
"country_name":"Cabo Verde",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"KHM",
"country_name":"Cambodia",
"sub_region":"South-eastern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"CMR",
"country_name":"Cameroon",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"CAN",
"country_name":"Canada",
"sub_region":"Northern America",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"CYM",
"country_name":"Cayman Islands",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"CAF",
"country_name":"Central African Republic",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"TCD",
"country_name":"Chad",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"CHL",
"country_name":"Chile",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"CHN",
"country_name":"China",
"sub_region":"Eastern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"CXR",
"country_name":"Christmas Island",
"sub_region":"Australia and New Zealand",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"CCK",
"country_name":"Cocos (Keeling) Islands",
"sub_region":"Australia and New Zealand",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"COL",
"country_name":"Colombia",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"COM",
"country_name":"Comoros",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"COG",
"country_name":"Congo",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"COD",
"country_name":"Congo (Democratic Republic Of The)",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"COK",
"country_name":"Cook Islands",
"sub_region":"Polynesia",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"CRI",
"country_name":"Costa Rica",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"CIV",
"country_name":"Côte D'Ivoire",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"HRV",
"country_name":"Croatia",
"sub_region":"Southern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"CUB",
"country_name":"Cuba",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"POL",
"country_name":"Poland",
"sub_region":"Eastern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"CUW",
"country_name":"Curaçao",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"CYP",
"country_name":"Cyprus",
"sub_region":"Western Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"CZE",
"country_name":"Czech Republic",
"sub_region":"Eastern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"DNK",
"country_name":"Denmark",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"DJI",
"country_name":"Djibouti",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"DMA",
"country_name":"Dominica",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"DOM",
"country_name":"Dominican Republic",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"ECU",
"country_name":"Ecuador",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"EGY",
"country_name":"Egypt",
"sub_region":"Northern Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"SLV",
"country_name":"El Salvador",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"GNQ",
"country_name":"Equatorial Guinea",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"ERI",
"country_name":"Eritrea",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"EST",
"country_name":"Estonia",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"SWZ",
"country_name":"Eswatini",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"ETH",
"country_name":"Ethiopia",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"FLK",
"country_name":"Falkland Islands (Malvinas)",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"FRO",
"country_name":"Faroe Islands",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"FJI",
"country_name":"Fiji",
"sub_region":"Melanesia",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"FIN",
"country_name":"Finland",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"FRA",
"country_name":"France",
"sub_region":"Western Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"GUF",
"country_name":"French Guiana",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"PYF",
"country_name":"French Polynesia",
"sub_region":"Polynesia",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"ATF",
"country_name":"French Southern Territories",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"GAB",
"country_name":"Gabon",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"GMB",
"country_name":"Gambia",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"GEO",
"country_name":"Georgia",
"sub_region":"Western Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"DEU",
"country_name":"Germany",
"sub_region":"Western Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"GHA",
"country_name":"Ghana",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"GIB",
"country_name":"Gibraltar",
"sub_region":"Southern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"GRC",
"country_name":"Greece",
"sub_region":"Southern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"GRL",
"country_name":"Greenland",
"sub_region":"Northern America",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"GRD",
"country_name":"Grenada",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"GLP",
"country_name":"Guadeloupe",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"GUM",
"country_name":"Guam",
"sub_region":"Micronesia",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"GTM",
"country_name":"Guatemala",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"GGY",
"country_name":"Guernsey",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"GIN",
"country_name":"Guinea",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"GNB",
"country_name":"Guinea Bissau",
"sub_region":"Sub-Saharan Africa",
"region":"Africa",
"measurement_system":"metric"
},
{
"country_code":"GUY",
"country_name":"Guyana",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"HTI",
"country_name":"Haiti",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"HMD",
"country_name":"Heard Island and McDonald Islands",
"sub_region":"Australia and New Zealand",
"region":"Oceania",
"measurement_system":"metric"
},
{
"country_code":"HND",
"country_name":"Honduras",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"
},
{
"country_code":"HKG",
"country_name":"Hong Kong",
"sub_region":"Eastern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"HUN",
"country_name":"Hungary",
"sub_region":"Eastern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"ISL",
"country_name":"Iceland",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"IND",
"country_name":"India",
"sub_region":"Southern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"IDN",
"country_name":"Indonesia",
"sub_region":"South-eastern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"IRN",
"country_name":"Iran",
"sub_region":"Southern Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"IRQ",
"country_name":"Iraq",
"sub_region":"Western Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"IRL",
"country_name":"Ireland",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"IMN",
"country_name":"Isle of Man",
"sub_region":"Northern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"ISR",
"country_name":"Israel",
"sub_region":"Western Asia",
"region":"Asia",
"measurement_system":"metric"
},
{
"country_code":"ITA",
"country_name":"Italy",
"sub_region":"Southern Europe",
"region":"Europe",
"measurement_system":"metric"
},
{
"country_code":"JAM",
"country_name":"Jamaica",
"sub_region":"Latin America and the Caribbean",
"region":"Americas",
"measurement_system":"metric"<