{
  "openapi": "3.0.1",
  "info": {
    "title": "IEA Energy Data Scraper [$1.50/1K💰] | CO2 | Electricity",
    "description": "Extract free IEA energy statistics for 78 indicators and 185 countries: CO2 emissions, electricity generation, renewables, supply, consumption and prices. No API key needed.",
    "version": "1.0",
    "x-build-id": "CoyDqHvA9HwNRAQYn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ahmed_jasarevic~iea-public-energy-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ahmed_jasarevic-iea-public-energy-data",
        "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/ahmed_jasarevic~iea-public-energy-data/runs": {
      "post": {
        "operationId": "runs-sync-ahmed_jasarevic-iea-public-energy-data",
        "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/ahmed_jasarevic~iea-public-energy-data/run-sync": {
      "post": {
        "operationId": "run-sync-ahmed_jasarevic-iea-public-energy-data",
        "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": "Mode",
            "enum": [
              "data",
              "indicators",
              "countries"
            ],
            "type": "string",
            "description": "Data fetches energy statistics. Indicators and countries output the live IEA catalogs instead of statistics.",
            "default": "data"
          },
          "indicators": {
            "title": "Indicators",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Indicator IDs such as TESbySource, TotCO2, ElecGenByFuel, SDG71, or GasPrice. Use [\"all\"] for every public indicator. The indicator catalog mode lists all IDs.",
            "items": {
              "type": "string"
            },
            "default": [
              "TESbySource"
            ]
          },
          "countries": {
            "title": "Countries and regions",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "ISO 2/3 codes (DE, DEU), IEA codes (UK), country or region names (Germany, World, EU27_2020), or [\"all\"] for every country and region. Use the country catalog mode to browse options.",
            "items": {
              "type": "string"
            },
            "default": [
              "WORLD"
            ]
          },
          "startYear": {
            "title": "Start year",
            "minimum": 0,
            "maximum": 2100,
            "type": "integer",
            "description": "First year to include, inclusive. Use 0 to include the earliest year available.",
            "default": 1990
          },
          "endYear": {
            "title": "End year",
            "minimum": 0,
            "maximum": 2100,
            "type": "integer",
            "description": "Last year to include, inclusive. Use 0 to include the latest year available.",
            "default": 0
          },
          "latestOnly": {
            "title": "Latest year only",
            "type": "boolean",
            "description": "Keep only the most recent year for each indicator and country or region. Some indicators include projections, so the latest year can be in the future; set an end year to exclude them.",
            "default": false
          },
          "includeNullValues": {
            "title": "Include empty values",
            "type": "boolean",
            "description": "Keep rows where the IEA reports no numeric value. When disabled, rows with null values are omitted.",
            "default": false
          },
          "flows": {
            "title": "Flow filters",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional flow codes or labels to keep, such as ESOLARPV, EWIND, or Coal. Matches both codes and labels, case-insensitively. Leave empty for all flows.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "products": {
            "title": "Product filters",
            "uniqueItems": true,
            "type": "array",
            "description": "Optional product codes or labels to keep, such as ELECTR, TOTAL, or Electricity. Matches both codes and labels, case-insensitively. Leave empty for all products.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of simultaneous IEA API requests. Higher values finish faster but put more load on the IEA service.",
            "default": 6
          },
          "countryBatchSize": {
            "title": "Countries per request",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of countries or regions sent in each IEA API request. Larger batches use fewer requests but produce larger responses.",
            "default": 25
          },
          "maxRows": {
            "title": "Maximum rows",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many dataset rows. Use 0 for no limit. The limit applies across all indicators.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}