openapi: 3.0.0
servers:
  - url: https://prod.api.market/api/v1/carbonsutra/carbon
info:
  title: Carbon Emission Footprint API
  description: Estimate the carbon emission footprint by organizations and
    software developers
  version: 1.0.1
components:
  securitySchemes: {}
tags:
  - name: Supplementary APIs
    description: |-
      These supplementary APIs are used internally by CarbonSutra's algorithms. We are making them available as they could be useful to developers for creating front ends of their applications.

      The APIs are:

      1. Nearest Airport - This is an advanced algorithm which takes a postal code and country code as input and returns the nearest airport its lat-long value. It is important to note that the straight line distance between the lat-long of postal code and airport is measured. The returned value is in kilometers. The source of 1.5 million postal code data is taken as it is from [https://public.opendatasoft.com/explore/dataset/geonames-postal-code/.](https://public.opendatasoft.com/explore/dataset/geonames-postal-code/.) For airports, the publicly available database of IATA codes and airport names is used.
      2. Distance between Airports - This returns the distance between two IATA airport codes in kilometers.
      3. Airports by Keyword - Returns the lists of airport names and IATA code which matches the keyword.
  - name: energy
    description: Operations related to energy
  - name: science
    description: Operations related to science
paths:
  /api/v1/nearest-airport:
    get:
      tags:
        - Supplementary APIs
      summary: Nearest Airport
      description: Nearest airport from a postal code in a country, based on shortest
        distance between geographical coordinates.
      parameters:
        - name: country_code
          in: query
          schema:
            type: string
          example: IN
        - name: postal_code
          in: query
          schema:
            type: integer
          example: "248001"
      responses:
        "200":
          description: Successful response
          content:
            application/json: {}
    parameters:
      - &a1
        description: API.market API Key
        in: header
        name: x-api-market-key
        value: Please Login/Signup to get an API Key
        required: true
        schema:
          type: string
  /api/v1/distance-between-airports:
    get:
      tags:
        - Supplementary APIs
      summary: Distance between Airports
      description: Distance in kilometers between two IATA airport codes, calculated
        based on their geographical coordinates.
      parameters:
        - name: iata_airport_from
          in: query
          schema:
            type: string
          example: LHR
        - name: iata_airport_to
          in: query
          schema:
            type: string
          example: MAA
      responses:
        "200":
          description: Successful response
          content:
            application/json: {}
    parameters:
      - *a1
  /api/v1/airports-by-keyword:
    get:
      tags:
        - Supplementary APIs
      summary: Airports by Keyword
      description: >-
        StartFragment


        Returns the lists of airport names and IATA code which matches the
        keyword.


        EndFragment
      parameters:
        - name: keyword
          in: query
          schema:
            type: string
          example: new
      responses:
        "200":
          description: Successful response
          content:
            application/json: {}
    parameters:
      - *a1
  /api/v1/flight_estimate:
    post:
      tags:
        - default
      summary: Flight Travel Estimates
      description: >-
        This calculation is used for reporting Scope 3 emissions for individuals
        flying for work purposes. The footprint of a flight travel is calculated
        based on the distance between airports and the travelling class of the
        passenger. With the origin and destination as inputs and following the
        ICAO methodology and EPA emissions factors, we apply appropriate rules
        based on research by IPCC.


        Our algorithm calculates the distance between two airports, the IATA
        codes of which have been entered. The database has approx. 9,200 global
        airports and is regularly updated. Using the principles defined in ICAO
        methodology, the guidelines from UK BEIS (Department for Business,
        Energy and Industrial Strategy) and UK DEFRA (Department for Business,
        Energy and Industrial Strategy) are then applied to arrive at the
        footprint of that journey per-passenger in a particular class.


        As the ICAO does not apply the radiative forcing (RF) multiplier
        (accounting for the wider climate effect of emissions arising from
        aircraft transport at altitude) or distance uplift factor to account for
        delays/circling and non-direct routes (i.e., not along the
        straight-line/great-circle between destinations), we have added an
        option for you to factor it in the calculation. Use the "add_rf" field
        to add this factor.


        WTT (well-to-tank) emissions consist of all processes between the source
        of the fuel (the well) through the extraction, processing (refining),
        storage and delivery phases up until the point of use (the tank) in the
        plane before take-off. Using the "include_wtt" field will add the
        upstream emission associated with this flight in the estimation.


        The following fields are ingested:


        IATA AIRPORT CODE (FROM)  

        Mandatory. This is the three-character alphanumeric geocode of the
        airport from which the flight is originating.


        IATA AIRPORT CODE (TO)  

        Mandatory. The IATA code of flight's destination airport.


        FLIGHT CLASS  

        Optional. The class in which the passenger is travelling. The values are
        Economy, Premium, Business and First. If the entered value is blank or
        different from these four, an "Average" factor will be considered.


        ROUND TRIP  

        Optional. A "Y" would mean the passenger is travelling back to the
        origin from destination, in the same class. A "N" would consider it as a
        single-way trip. Any other value other than "N" will default to this
        input being considered as a "Y".


        ADD RF  

        Optional. A "Y" would add radiative forcing multiplier factor in the
        footprint calculation, while a "N" will bypass it. Any other value other
        than "N" will default to this input being considered as a "Y".


        INCLUDE WTT  

        Optional. A "Y" would include the Well-to-Tank (WTT) factors to the
        footprint calculation, while a "N" will bypass it. Any other value other
        than "N" will default to this input being considered as a "Y".


        NUMBER OF PASSENGERS  

        Optional. Default to 1, if a blank or an invalid value is entered.


        Note: If there are two passengers in the same flight, but sitting in
        different classes then two separate API calls are suggested, one for
        each passenger.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: KrugerBrent-Jun22
                iata_airport_from: DXB
                iata_airport_to: LAX
                flight_class: Business
                round_trip: Y
                add_rf: N
                include_wtt: Y
                number_of_passengers: "1"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Fri, 04 Nov 2022 04:21:28 GMT
            Server:
              schema:
                type: string
                example: Apache
            Vary:
              schema:
                type: string
                example: Authorization
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              examples:
                example-0:
                  summary: Short One-Way (London to Edinburgh) Flight Economy Flight with no RF or
                    WTT
                  value:
                    data:
                      type: estimate-travel-flight
                      iata_airport_from: LHR
                      airport_from: London Heathrow Airport
                      iata_airport_to: EDI
                      airport_to: Edinburgh Airport
                      flight_class: Average
                      round_trip: N
                      add_rf: N
                      include_wtt: N
                      number_of_passengers: "1"
                      co2e_gm: 69372
                      co2e_kg: 69.37
                      co2e_mt: 0.07
                      co2e_lb: 152.93
                    success: true
                    status: 200
                example-1:
                  summary: Dubai to LA, Round Trip in Business without RF but with WTT
                  value:
                    data:
                      type: estimate-travel-flight
                      iata_airport_from: DXB
                      airport_from: Dubai International Airport
                      iata_airport_to: LAX
                      airport_to: Los Angeles International Airport
                      flight_class: Business
                      round_trip: Y
                      add_rf: N
                      include_wtt: Y
                      number_of_passengers: "1"
                      co2e_gm: 6974671
                      co2e_kg: 6974.67
                      co2e_mt: 6.97
                      co2e_lb: 15376.36
                    success: true
                    status: 200
                example-2:
                  summary: Dubai to LA, Round Trip in Business without RF or WTT
                  value:
                    data:
                      type: estimate-travel-flight
                      iata_airport_from: DXB
                      airport_from: Dubai International Airport
                      iata_airport_to: LAX
                      airport_to: Los Angeles International Airport
                      flight_class: Business
                      round_trip: Y
                      add_rf: N
                      include_wtt: N
                      number_of_passengers: "1"
                      co2e_gm: 5777834
                      co2e_kg: 5777.83
                      co2e_mt: 5.78
                      co2e_lb: 12737.8
                    success: true
                    status: 200
    parameters:
      - *a1
  /api/v1/hotel_estimate:
    post:
      tags:
        - default
      summary: Hotel Stay Estimates
      description: >-
        CarbonSutra's approach for calculating the carbon footprint of hotel
        stays is based on Cornell Hotel Sustainability Benchmark Index and UK
        government's GHG conversion factors published in 2022. Based on country
        and optionally entered city or region in that country along with rating
        of the hotel, the emission factor is calculated. Over 300 cities and
        regions across 38 countries are covered. The final emission is
        calculated based on number of rooms taken in the hotel and the length of
        the stay.


        The following fields are ingested:


        COUNTRY CODE  

        Mandatory. This is a ISO 3166-1 alpha-2 code, pointing to its ISO 3166-2
        article. While the list of codes is available at [Wikipedia's ISO 3166-1
        alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), we are
        listing the 38 countries and their 2 character codes below in the
        footnote. \[1\]


        CITY NAME  

        Optional. Enter the city within the country where the hotel is based.
        The algorithm will search the database for the name and if it is not
        found, it will search for any emission factors associated with the
        region in which the city is located.


        HOTEL RATING  

        Optional. The star rating of the hotel. Enter the value of "2" for a
        2-star hotel. Similarly, "3", "4" and "5" will match the corresponding
        rating of the hotel. If this is not known then leave it as blank.


        NUMBER OF NIGHTS  

        Optional. This is the length of the stay in the hotel. The default value
        is 1.


        NUMBER OF ROOMS  

        Optional. The number of rooms taken in the hotel. The default value is
        1. Note that the number of travelers staying in the same room do not
        matter.


        ---


        \[1\]: Countries and ISO codes used in this API: Australia (au), Belgium
        (be), Brazil (br), Canada (ca), Chile (cl), China (cn), Colombia (co),
        Costa Rica (cr), Egypt (eg), France (fr), Germany (de), Hong Kong (hk),
        India (in), Indonesia (id), Italy (it), Japan (jp), Jordan (jo), Korea
        (kr), Malaysia (my), Maldives (mv), Mexico (mx), Netherlands (nl), Oman
        (om), Philippines (ph),Portugal (pt),Qatar (qa), Russian Federation
        (ru), Saudi Arabia (sa), Singapore (sg), South Africa (za), Spain (es),
        Switzerland (ch), Thailand (th), Turkey (tr), United Arab Emirates (ae),
        United Kingdom (gb), United States of America (us), Vietnam (vn).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: KrugerBrent-Jun22
                country_code: AU
                city_name: Sydney
                hotel_rating: "5"
                number_of_nights: "2"
                number_of_rooms: "1"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Fri, 04 Nov 2022 05:29:03 GMT
            Server:
              schema:
                type: string
                example: Apache
            Vary:
              schema:
                type: string
                example: Authorization
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              examples:
                example-0:
                  summary: Hotel Stay in Singapore (SG), with no value in city_name
                  value:
                    data:
                      type: estimate-hotel-stay
                      country: Singapore
                      city_name: Singapore
                      hotel_rating: "5"
                      number_of_nights: "1"
                      number_of_rooms: "1"
                      co2e_gm: 39785
                      co2e_kg: 39.79
                      co2e_mt: 0.04
                      co2e_lb: 87.72
                    success: true
                    status: 200
                example-1:
                  summary: Hotel Stay Example with city_name value
                  value:
                    data:
                      type: estimate-hotel-stay
                      country: Australia
                      city_name: Sydney
                      hotel_rating: "5"
                      number_of_nights: "2"
                      number_of_rooms: "1"
                      co2e_gm: 80900
                      co2e_kg: 80.9
                      co2e_mt: 0.08
                      co2e_lb: 178.35
                    success: true
                    status: 200
    parameters:
      - *a1
  /api/v1/vehicle_estimate_by_type:
    post:
      tags:
        - default
      summary: Vehicles Estimates by Type
      description: >-
        We calculate the footprint of a passenger vehicle based on its Type and
        Size, for a specific distance. For Scope 1, this should be used to
        report travel in vehicles that are owned or controlled by the reporting
        organization. If not owned/controlled by organization, the vehicle's
        emission is reported under Scope 3.


        We use emission factors, data, guidelines from sources like UK
        Government HGH factors, US Department of Energy, US Environmental
        Protection Agency and UK Society of Motor Manufacturers and Traders.


        The API to calculate the emission is simple: it just takes the category
        of vehicle based on its type or size, the type of fuel that is used and
        the distance travelled in either miles or kilometers.


        WTT (well-to-tank) emissions consist of all processes between the source
        of the fuel (the well) through the extraction, processing (refining),
        storage and delivery phases up until the point of use (the tank) in the
        vehicle. Using the "include_wtt" field will add the associated upstream
        emission.


        The following fields are ingested for emission calculation API of
        vehicles:


        VEHICLE TYPE  

        Mandatory. The acceptable values are the following: Car-Type-Mini,
        Car-Type-Supermini, Car-Type-LowerMedium, Car-Type-UpperMedium,
        Car-Type-Executive, Car-Type-Luxury, Car-Type-Sports, Car-Type-4x4,
        Car-Type-MPV, Car-Size-Small, Car-Size-Medium, Car-Size-Large,
        Car-Size-Average, Motorbike-Size-Small, Motorbike-Size-Medium,
        Motorbike-Size-Large, Motorbike-Size-Average, Bus-LocalAverage,
        Bus-Coach, Taxi-Local, Train-National, Train-Local and Train-Tram.


        FUEL TYPE  

        Optional. There are 3 possible values here: Diesel, Petrol and Unknown.
        If in doubt, select the Unknown value, which is also the default.


        DISTANCE VALUE  

        Mandatory. The distance travelled by vehicle.


        DISTANCE UNIT  

        Mandatory. The acceptable values are "km" for kilometers and "mi" for
        miles. This will default to "km", if any other value is passed.


        INCLUDE WTT  

        Optional. As explained above. The default value is "Y".
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: VE-Oct-2022
                vehicle_type: Car-Type-Supermini
                fuel_type: petrol
                distance_value: 8800
                distance_unit: km
                include_wtt: N
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Thu, 10 Nov 2022 04:35:45 GMT
            Server:
              schema:
                type: string
                example: Apache
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  type: estimate-vehicle-usage
                  vehicle_type: Car-Type-Supermini
                  fuel_type: petrol
                  distance_value: 8800
                  distance_unit: km
                  include_wtt: N
                  co2e_gm: 1302576
                  co2e_kg: 1302.58
                  co2e_mt: 1.3
                  co2e_lb: 2871.67
                success: true
                status: 200
    parameters:
      - *a1
  /api/v1/vehicle_estimate_by_model:
    post:
      tags:
        - default
      summary: Vehicles Estimates by Model
      description: >-
        We calculate the footprint of a passenger vehicle based on its make and
        model, for a specific distance. For Scope 1, this should be used to
        report travel in vehicles that are owned or controlled by the reporting
        organization. If not owned/controlled by organization, the vehicle's
        emission is reported under Scope 3.


        We use emission factors, data, guidelines from sources like US
        Department of Energy, US Environmental Protection Agency and UK Society
        of Motor Manufacturers and Traders. To simplify the usage we have made
        two minor modifications in our algorithm: First, for dual fuel vehicles,
        the average of emissions from its conventional and alternative fuels is
        used. Second, if a model is released across multiple years by the same
        maker, then the emissions for that model are averaged.


        The API to calculate the emission is simple: it just takes the Make and
        Model of a vehicle along with the distance travelled to calculate the
        emission. But since our database contains over 140 Makes which cover
        4,500 models of vehicles, we are providing two more APIs to get these
        values.


        First, use the two GET APIs to get a list of Makes and then the specific
        Model from the selected Make.


        The following fields are ingested for emission calculation API of
        vehicles:


        VEHICLE MAKE  

        Mandatory. Name of Vehicle Make (eg, Lexus)


        VEHICLE MODEL  

        Mandatory. Name of Vehicle Model (eg, Camry) for the selected MAKE (eg,
        Toyota)


        DISTANCE VALUE  

        Mandatory. The distance travelled by vehicle.


        DISTANCE UNIT  

        Mandatory. The acceptable values are "km" for kilometers and "mi" for
        miles. This will default to "mi", if any other value is passed.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: VE-Oct-2022
                distance_unit: km
                distance_value: "11500"
                vehicle_make: Lexus
                vehicle_model: RX 300
      security:
        - bearerAuth: []
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Thu, 10 Nov 2022 04:33:45 GMT
            Server:
              schema:
                type: string
                example: Apache
            Vary:
              schema:
                type: string
                example: Authorization
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  type: estimate-vehicle
                  distance_unit: km
                  distance_value: "11500"
                  vehicle_make: Lexus
                  vehicle_model: RX 300
                  co2e_gm: 3453751
                  co2e_kg: 3453.75
                  co2e_mt: 3.45
                  co2e_lb: 7614.14
                success: true
                status: 200
    parameters:
      - *a1
  /api/v1/vehicle_makes:
    get:
      tags:
        - default
      summary: Vehicle Makes
      description: List of all Vehicle Makes
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Successful response
          content:
            application/json: {}
    parameters:
      - *a1
  /api/v1/vehicle_makes/toyota/vehicle_models:
    get:
      tags:
        - default
      summary: Vehicle Models
      description: List of Models Models for a Vehicle Make
      responses:
        "200":
          description: Successful response
          content:
            application/json: {}
    parameters:
      - *a1
  /api/v1/electricity_estimate:
    post:
      tags:
        - default
      summary: Electricity Usage Estimates
      description: >-
        This computes the emissions from electricity used by an organization at
        sites which are either owned or controlled by it, and reported as a
        Scope 2 Indirect emission. Data from nearly 90 countries between 2020-22
        from multiple sources has been compiled. The consumption of electricity
        usage can be entered in kWh or MWh.


        The following fields are ingested:


        COUNTRY NAME  

        Mandatory. The name of the country for which the emission is being
        measured. Including EU-27, we have compiled a database of 90 countries.
        To help you to pick the right name, we are listing the countries below
        in the footnote. \[1\]


        ELECTRICITY VALUE  

        Optional. This will default to 1 unit, if left blank. It is the number
        of units of electricity consumed.


        ELECTRICITY UNIT  

        Optional. The acceptable values are kWh and MWh. This will default to
        MWh, if left blank or if any other value is passed.


        ---


        \[1\]: Countries used in this API: Australia, Austria, Bangladesh,
        Belgium, Bhutan, Brunei, Bulgaria, Cambodia, Canada, China, Croatia,
        Cyprus, Czechia, Denmark, Estonia, EU-27, Finland, France, Germany,
        Greece, Hong Kong, Hungary, Iceland, India, Indonesia, Ireland, Italy,
        Japan, Laos, Latvia, Lithuania, Luxembourg, Macao, Malaysia, Maldives,
        Malta, Mongolia, Myanmar, Nepal, Netherlands, New Zealand, North Korea,
        Norway, Pakistan, Papua New Guinea, Philippines, Poland, Portugal,
        Qatar, Romania, Singapore, Slovakia, Slovenia, South Korea, Spain, Sri
        Lanka, Sweden, Taiwan, Thailand, Turkey, UK, USA and Vietnam.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: KrugerBrent-Jun22
                electricity_unit: mwh
                electricity_value: "1745"
                country_name: UK
      security:
        - bearerAuth: []
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Fri, 07 Oct 2022 05:37:22 GMT
            Server:
              schema:
                type: string
                example: Apache
            Vary:
              schema:
                type: string
                example: Authorization
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  type: estimate-electricity
                  electricity_unit: MWh
                  electricity_value: "1745"
                  country_name: UK
                  co2e_gm: 337448100
                  co2e_kg: 337448.1
                  co2e_mt: 337.45
                  co2e_lb: 743938.08
                success: true
                status: 200
    parameters:
      - *a1
  /api/v1/fuel_estimate:
    post:
      tags:
        - default
      summary: Fuel Consumption Estimates
      description: >-
        This computes the emissions from stationary combustion fuels which are
        burnt in a fixed unit or asset owned or controlled by the reporting
        organization, and usually reported as a Scope 1 direct emission \[1\].
        The source of data and methodology of emission factor calculation are
        from UK government's GHG conversion factors for company reporting and
        Ministry of Business, Innovation and Employment (MBIE)'s data of 2022
        from New Zealand. All emissions are expressed as kg of CO2 equivalent
        per unit \[2\].


        The following fields are ingested:


        FUEL USAGE  

        Mandatory. The usage of the fuel can be entered as either "commercial",
        "industrial", "transport" or "residential". If left blank, it will
        default to "commercial". Note that "commercial" is to be used for fuels
        used at sites or properties where commercial activities take place.
        "industrial" is used when combustion takes place at sites where
        industrial processes occur or within engines that support industrial
        activities. "residential" can be applied for fuel used primarily at
        residential properties. "transport" in this category is for the fuel
        used in an engine to move a vehicle.


        FUEL NAME  

        Mandatory. A blank value will result in an error. Described here are the
        fuel types (written within quotes) are to be used. They are divided into
        categories for ease of understanding:


        \*   Petrol: Two types of petrol can be used under the fuel_usage
        category of transport. They are "Premium Petrol" and "Regular Petrol".

        \*   Coal: Four ranks of coal can be used under any of the fuel_usage
        categories of commercial, industrial or residential. The values are:
        "Coal - Default", "Coal - Bituminous", "Coal - Sub-Bituminous" and "Coal
        - Lignite".

        \*   Diesel: Use "Diesel" under any of the fuel_usage categories of
        commercial, industrial or transport.

        \*   LPG: Use "LPG" under any of the fuel_usage categories of
        commercial, industrial or transport.

        \*   Fuel Oils: Two types of fuel oils can be used under the fuel_usage
        categories of commercial, industrial or transport. They are "Heavy Fuel
        Oil" and "Light Fuel Oil".

        \*   Natural Gas: Use "Natural Gas" under fuel_usage categories of
        commercial or industrial.

        \*   Aviation Fuels: Use "Aviation fuel - Kerosene" or "Aviation gas"
        under fuel_usage value of transport.


        FUEL VALUE  

        Mandatory. A blank value will result in an error. The unit of fuel_value
        is fixed for the categories of fuel as per the following rules:


        \*   Petrol: "litre"

        \*   Coal: "kg"

        \*   Diesel: "litre"

        \*   LPG: "kg"

        \*   Fuel Oils: "litre"

        \*   Natural Gas: "kWh"

        \*   Aviation Fuels: "litre"


        \[1\] These could be reported as Scope 3 indirect emissions if the
        organization does not own or control the asset (eg, a boiler) where the
        combustion takes place.


        \[2\] It should be noted that the footprint calculated here does not use
        the full fuel-cycle emission factors and hence do not incorporate the
        indirect (Scope 3) emissions associated with the extraction, production
        and transport of the fuel.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: KrugerBrent-Jun22
                fuel_usage: transport
                fuel_name: Regular Petrol
                fuel_value: "7900"
      security:
        - bearerAuth: []
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Fri, 07 Oct 2022 05:36:18 GMT
            Server:
              schema:
                type: string
                example: Apache
            Vary:
              schema:
                type: string
                example: Authorization
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  type: estimate-fuel
                  fuel_usage: transport
                  fuel_name: Regular Petrol
                  fuel_unit: litre
                  fuel_value: "7900"
                  co2e_gm: 19400623
                  co2e_kg: 19400.62
                  co2e_mt: 19.4
                  co2e_lb: 42770.61
                success: true
                status: 200
    parameters:
      - *a1
  /api/v1/freight_estimate:
    post:
      tags:
        - default
      summary: Freight Shipping Estimates
      description: >-
        The freight/shipping emission estimations are for Road, Rail, Air and
        Sea (categorized into Short Sea and Deep Sea). Recommended average
        emission factors and guidelines have been used as proposed by member
        companies of ECTA (European Chemical Transport Association) and Cefic
        which are aligned with CN's recommendations.


        Deep sea (value: DeepSea) shipping refers to the maritime transport of
        goods on intercontinental routes, crossing oceans as opposed to short
        sea (value: ShortSea) shipping over relatively short distances.


        Two additional calculations for Intermodal shipping are available: 1)
        Road with Rail and 2) Road with Short Sea. In both cases, the road
        distance is assumed to be 10% of the entire journey.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: KrugerBrent-Oct22
                transport_mode: Rail
                distance_value: "1500"
                freight_weight: "20000"
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Tue, 29 Nov 2022 09:09:17 GMT
            Server:
              schema:
                type: string
                example: Apache
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  type: estimate-freight
                  distance_value: "1500"
                  transport_mode: Rail
                  freight_weight: "2000"
                  co2e_gm: 66000
                  co2e_kg: 66
                  co2e_mt: 0.07
                  co2e_lb: 145.5
                success: true
                status: 200
    parameters:
      - *a1
  /api/v1/ecommerce_estimate:
    post:
      tags:
        - default
      summary: eCommerce Shipment Estimates
      description: >-
        StartFragment


        This is an advanced algorithm to estimate the emissions of a package's
        journey from its shipment location to the collection point. If the
        distance between two postal codes is above a threshold, we find the
        nearest airports from the origin and then from the destination location.
        The final distance of journey is then a sum of the distance between the
        origin postal code and nearest airport by land, air travel between the
        airports closest to the origin and the destination and finally, land
        travel between destination airport and postal code of collection point
        by land. The final calculation follows ECTA/Cefic and BEIS/DEFRA's
        recommended conversion factors and works on a database of over 1.5
        million postal codes across 95 countries and 9,200 global airports.


        EndFragment
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                cluster_name: KrugerBrent_Oct22
                origin_country_code: IN
                origin_postal_code: "604407"
                destination_country_code: IN
                destination_postal_code: "226017"
                package_weight: "10"
                add_rf: N
                include_wtt: N
      responses:
        "200":
          description: OK
          headers:
            Date:
              schema:
                type: string
                example: Tue, 06 Dec 2022 08:54:20 GMT
            Server:
              schema:
                type: string
                example: Apache
            Cache-Control:
              schema:
                type: string
                example: no-cache, private
            X-RateLimit-Limit:
              schema:
                type: integer
                example: "60"
            X-RateLimit-Remaining:
              schema:
                type: integer
                example: "59"
            X-XSS-Protection:
              schema:
                type: string
                example: 1; mode=block
            Strict-Transport-Security:
              schema:
                type: string
                example: max-age=31536000; includeSubDomains; preload
            X-Content-Type-Options:
              schema:
                type: string
                example: nosniff
            Content-Secure-Policy:
              schema:
                type: string
                example: default-src 'none'; script-src 'self' fonts.googleapis.com ; img-src *;
                  style-src 'self';
            Keep-Alive:
              schema:
                type: string
                example: timeout=5, max=100
            Connection:
              schema:
                type: string
                example: Keep-Alive
            Transfer-Encoding:
              schema:
                type: string
                example: chunked
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  type: estimate-ecommerce
                  origin_country_code: IN
                  origin_postal_code: "603104"
                  destination_country_code: IN
                  destination_postal_code: "226017"
                  package_weight: "15"
                  add_rf: N
                  include_wtt: N
                  co2e_gm: 242
                  co2e_kg: 0.24
                  co2e_mt: 0
                  co2e_lb: 0.53
                success: true
                status: 200
    parameters:
      - *a1
security: {}
