{
  "openapi": "3.0.1",
  "info": {
    "title": "Carbon Footprint Calculator API: Emission Factors and CO2e",
    "description": "Search emission factors by activity, region, year and source, then calculate kg CO2e for electricity, fuel, travel, materials and spend, Scope 3.1 procurement and intermodal freight through the Climatiq API. Every row cites its emission factor source. Bring your own key.",
    "version": "0.1",
    "x-build-id": "lK9uED1MvwCj6wEp3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~carbon-footprint-emission-factor-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-carbon-footprint-emission-factor-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~carbon-footprint-emission-factor-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-carbon-footprint-emission-factor-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~carbon-footprint-emission-factor-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-carbon-footprint-emission-factor-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to do",
            "enum": [
              "searchFactors",
              "estimate",
              "procurement",
              "freight",
              "unitTypes",
              "dataVersions"
            ],
            "type": "string",
            "description": "Emission factor search finds factors by text and filters (source, region, year, unit type, scope). Activity emissions estimate calculates kg CO2e for activities such as electricity, fuel, distance, weight or money spent. Spend based procurement estimate calculates purchased goods and services emissions from spend with EXIOBASE margins and inflation. Intermodal freight emissions calculates a shipment by road, rail, sea, air or inland waterway. Unit types and latest data version are reference lookups.",
            "default": "searchFactors"
          },
          "query": {
            "title": "Search text",
            "type": "string",
            "description": "Free text matched fuzzily against emission factor IDs, names and descriptions, such as electricity grid, diesel, steel or hotel stay. Results come best match first."
          },
          "activityId": {
            "title": "Activity ID",
            "type": "string",
            "description": "Only factors for this activity ID, such as electricity-supply_grid-source_residual_mix. End it with * as a wildcard, such as electricity-supply_grid*."
          },
          "factorId": {
            "title": "Emission factor ID",
            "type": "string",
            "description": "One specific emission factor by its unique ID. Returns at most one factor."
          },
          "region": {
            "title": "Region",
            "type": "string",
            "description": "Region code the factor applies to, such as US, DE, GB or GLOBAL. End it with * to include sub regions, such as US*."
          },
          "year": {
            "title": "Year",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Only factors considered most relevant for this year, according to the source."
          },
          "source": {
            "title": "Source",
            "type": "string",
            "description": "Data source that published the factor, such as EPA, BEIS, EXIOBASE, IEA or GLEC."
          },
          "sourceDataset": {
            "title": "Source dataset",
            "type": "string",
            "description": "Dataset within the source, such as 2021 GHG Emission Factors Hub."
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Factor category, such as Electricity, Fuel, Vehicles or Metals."
          },
          "sector": {
            "title": "Sector",
            "type": "string",
            "description": "Factor sector, such as Energy, Transport or Materials and Manufacturing."
          },
          "scope": {
            "title": "GHG Protocol scope",
            "type": "string",
            "description": "Scope such as 1, 2, 3 (all Scope 3 categories) or 3.1."
          },
          "unitType": {
            "title": "Unit type",
            "type": "string",
            "description": "Unit type the factor accepts, such as Energy, Weight, Distance, Volume or Money. The unit types mode lists them all."
          },
          "sourceLcaActivity": {
            "title": "LCA activity",
            "type": "string",
            "description": "Life cycle stage of the factor, such as cradle_to_gate, fuel_combustion or electricity_generation."
          },
          "calculationMethod": {
            "title": "Calculation method",
            "enum": [
              "ar4",
              "ar5",
              "ar6"
            ],
            "type": "string",
            "description": "IPCC assessment report used for CO2e. Empty uses the latest the source supports."
          },
          "accessType": {
            "title": "Access type",
            "enum": [
              "public",
              "premium",
              "private"
            ],
            "type": "string",
            "description": "Public factors are open to all, premium factors need a separate license, private factors are your own."
          },
          "allowedDataQualityFlags": {
            "title": "Allowed data quality flags",
            "type": "array",
            "description": "Optional. Data quality flags you accept, one per line, such as partial_factor or notable_methodological_variance. Use none to allow only factors without detected quality issues.",
            "items": {
              "type": "string"
            }
          },
          "estimates": {
            "title": "Activities to estimate",
            "type": "array",
            "description": "Activity emissions estimate mode. A JSON array of estimate requests, each with an emission_factor selector (activity_id plus optional region, year, source, region_fallback, year_fallback; or a unique id) and parameters for the factor's unit type, such as {\"energy\": 100, \"energy_unit\": \"kWh\"}, {\"distance\": 50, \"distance_unit\": \"km\"}, {\"weight\": 2, \"weight_unit\": \"t\"} or {\"money\": 500, \"money_unit\": \"usd\"}. Optional apply_inflation_adjustment takes the spend year. Sent 100 per batch call."
          },
          "spendItems": {
            "title": "Spend items",
            "type": "array",
            "description": "Spend based procurement mode. A JSON array of purchases, each with an activity (classification_code and classification_type of nace2, isic4, naics2017, mcc or unspsc; or an EXIOBASE activity_id), spend_year, spend_region (country code), money and money_unit, plus optional tax_margin, trade_margin and transport_margin. Sent 100 per batch call."
          },
          "shipments": {
            "title": "Freight shipments",
            "type": "array",
            "description": "Intermodal freight mode. A JSON array of shipments, each with a route (locations and legs in turn, a leg naming transport_mode road, rail, sea, air or inland_waterways with optional leg_details) and cargo (weight and weight_unit). One API call per shipment."
          },
          "dataVersion": {
            "title": "Data version",
            "type": "string",
            "description": "Search and activity estimate modes. Climatiq data release, such as ^38 for the latest compatible version or 38 for a fixed one. Empty asks the API for the latest release. A selector's own data_version wins."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for: factors in the search, or estimates in the calculation modes.",
            "default": 100
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "Pacing for calls to Climatiq. Throttled calls are retried after a pause. Each batch element counts as one call against your Climatiq quota.",
            "default": 120
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your Climatiq API key, from API Toolkit, API Keys in your Climatiq account. Stored as a secret, sent only to api.climatiq.io and never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}