{
  "openapi": "3.0.1",
  "info": {
    "title": "France Electricity Mix & CO2 (RTE eco2mix) - Live and History",
    "description": "French electricity in near real time and history: consumption, nuclear, wind, solar, hydro, gas, coal, oil, bioenergy, exchanges and CO2 g/kWh, national and 12 regions, plus min/max/mean summaries. RTE eco2mix open data, unofficial tool, no personal data.",
    "version": "0.1",
    "x-build-id": "IyDDC9CdfsR7aTAco"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/shadow-tools~france-electricity-mix-eco2mix/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-shadow-tools-france-electricity-mix-eco2mix",
        "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/shadow-tools~france-electricity-mix-eco2mix/runs": {
      "post": {
        "operationId": "runs-sync-shadow-tools-france-electricity-mix-eco2mix",
        "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/shadow-tools~france-electricity-mix-eco2mix/run-sync": {
      "post": {
        "operationId": "run-sync-shadow-tools-france-electricity-mix-eco2mix",
        "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": [
              "latest",
              "range",
              "summary"
            ],
            "type": "string",
            "description": "Pick one. \"latest\" = use to get the most recent measured quarter-hours (consumption, generation per source, exchanges, CO2 rate), newest first; ignores from, to and lastDays. \"range\" = use when you need the time series of a period: set from and to (or lastDays), oldest first. \"summary\" = use to get min, max and mean per energy source (one record per metric and period) over a period instead of every quarter-hour; set from and to (or lastDays, default 7). Allowed values: latest, range, summary. Default: latest.",
            "default": "latest"
          },
          "perimeter": {
            "title": "Perimeter",
            "enum": [
              "national",
              "regional"
            ],
            "type": "string",
            "description": "Geographic scope. \"national\" = whole of mainland France, with forecasts, gas / coal / oil detail, commercial exchanges per border and the CO2 rate (g/kWh). \"regional\" = the 12 mainland regions (Corsica is not in the source), with thermal generation as one figure, no forecasts and no CO2 rate. Allowed values: national, regional. Default: national, or regional when regions is set."
          },
          "regions": {
            "title": "Regions",
            "maxItems": 12,
            "type": "array",
            "description": "Regions to keep, as INSEE codes or names, e.g. [\"11\", \"Bretagne\"]. Names: Île-de-France (11), Centre-Val de Loire (24), Bourgogne-Franche-Comté (27), Normandie (28), Hauts-de-France (32), Grand Est (44), Pays de la Loire (52), Bretagne (53), Nouvelle-Aquitaine (75), Occitanie (76), Auvergne-Rhône-Alpes (84), Provence-Alpes-Côte d'Azur (93). Any of them matches (OR). Setting regions switches the perimeter to regional; empty with perimeter regional = all 12.",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "title": "Data source",
            "enum": [
              "auto",
              "realtime",
              "consolidated"
            ],
            "type": "string",
            "description": "Which eco2mix dataset to read. \"auto\" = consolidated/definitive data where they exist, real-time data for the most recent period (recommended). \"realtime\" = only the real-time dataset (about the last 2 months, estimates). \"consolidated\" = only consolidated and definitive data (history since 2012 nationally, consolidated up to about the end of the previous month). Allowed values: auto, realtime, consolidated. Default: auto.",
            "default": "auto"
          },
          "lastDays": {
            "title": "Last N days",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "For range and summary: period = the last N days up to now, e.g. 7. Used only when from is empty. Default: 1 for range, 7 for summary. Not used by mode latest."
          },
          "from": {
            "title": "From (date)",
            "type": "string",
            "description": "Start of the period for range and summary, format YYYY-MM-DD (from 00:00 Paris time) or YYYY-MM-DDTHH:mm (Paris time unless Z or +hh:mm is given), e.g. 2026-11-01. History starts on 2012-01-01 (national) and 2013-01-01 (regional). Empty = use lastDays."
          },
          "to": {
            "title": "To (date)",
            "type": "string",
            "description": "End of the period, format YYYY-MM-DD (the whole day is included) or YYYY-MM-DDTHH:mm, e.g. 2026-11-07. Empty = now."
          },
          "resolutionMinutes": {
            "title": "Time step (minutes)",
            "minimum": 15,
            "maximum": 60,
            "type": "integer",
            "description": "Keep only timestamps on this grid: 15, 30 or 60 minutes (e.g. 60 = one record per hour, 4 times cheaper than 15). Rows are only selected, never averaged or interpolated. Real-time data are quarter-hourly, consolidated data half-hourly. Default: 15 for latest and range, 30 for summary (so that real-time and consolidated rows weigh the same)."
          },
          "summaryBy": {
            "title": "Summary grouping",
            "enum": [
              "period",
              "day",
              "month"
            ],
            "type": "string",
            "description": "For summary only: \"period\" = one set of metrics for the whole period, \"day\" = per Paris calendar day, \"month\" = per Paris calendar month, e.g. day gives 11 metric records per day (national). Allowed values: period, day, month. Default: period.",
            "default": "period"
          },
          "order": {
            "title": "Sort order",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Order of records by time for latest and range: \"desc\" = newest first, \"asc\" = oldest first. Allowed values: desc, asc. Default: desc for latest, asc for range. When maxResults cuts the period, the first records in this order are kept."
          },
          "includeUnmeasured": {
            "title": "Include timestamps without measures",
            "type": "boolean",
            "description": "By default only timestamps with measured consumption or generation are returned. Set true to also get rows that hold only forecasts (the real-time dataset lists the rest of the day and the next day with forecasts and empty measures). Default: false.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of records delivered (and billed), e.g. 20. One record = one timestamp (and region) in latest and range, one metric of one period in summary. 20 national quarter-hours = 5 hours. The run also stops when the run cost cap is reached.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}