{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Electricity & Gas Tariffs Scraper (CNMC) + PVPC Prices",
    "description": "Scrape every electricity and gas tariff in Spain from the official CNMC comparator: prices, bill estimates by postcode, hourly PVPC prices. JSON, CSV, Excel.",
    "version": "0.1",
    "x-build-id": "33N3Thluh5cqY2XTF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~cnmc-energy-comparator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-cnmc-energy-comparator",
        "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/rastriq~cnmc-energy-comparator/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-cnmc-energy-comparator",
        "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/rastriq~cnmc-energy-comparator/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-cnmc-energy-comparator",
        "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": {
          "datasets": {
            "title": "What do you want to get?",
            "type": "array",
            "description": "Pick one or more. Each one is a separate table in the results.",
            "items": {
              "type": "string",
              "enum": [
                "comparison",
                "offers_catalog",
                "pvpc_prices",
                "pvpc_bill",
                "regulated_parameters",
                "reference_data"
              ],
              "enumTitles": [
                "💡 Cheapest offers for my home or business, with the estimated bill",
                "📚 Every electricity and gas tariff on the market today",
                "⏱️ Hourly price of the regulated electricity tariff (PVPC)",
                "🧾 Check a bill on the regulated tariff (PVPC)",
                "🧮 Official regulated prices and taxes (for experts)",
                "🗺️ List of provinces and consumption profiles (for experts)"
              ]
            },
            "default": [
              "offers_catalog",
              "comparison",
              "pvpc_prices"
            ]
          },
          "postalCodes": {
            "title": "Postcode(s)",
            "type": "array",
            "description": "Your 5-digit Spanish postcode, e.g. <code>28001</code>. Prices and taxes change with the place (Peninsula, Balearic Islands, Canary Islands, Ceuta, Melilla). Add several to compare places.",
            "default": [
              "28001"
            ],
            "items": {
              "type": "string"
            }
          },
          "supplyTypes": {
            "title": "Electricity, gas or both?",
            "type": "array",
            "description": "What you want to compare. \"Electricity + gas together\" shows offers that bundle both in one contract.",
            "items": {
              "type": "string",
              "enum": [
                "electricity",
                "gas",
                "combined"
              ],
              "enumTitles": [
                "Electricity",
                "Natural gas",
                "Electricity + gas together"
              ]
            },
            "default": [
              "electricity"
            ]
          },
          "consumerProfile": {
            "title": "Which one looks most like you?",
            "enum": [
              "small_home",
              "average_home",
              "large_home",
              "all_electric_home",
              "small_business",
              "medium_business",
              "custom"
            ],
            "type": "string",
            "description": "We fill in typical power and consumption for you. If you know your real numbers (they are on your bill), choose <b>I'll enter my own numbers</b> and fill in the next section."
          },
          "gasUse": {
            "title": "What do you use gas for?",
            "enum": [
              "hot_water_cooking",
              "flat_heating",
              "house_heating",
              "large_house_heating",
              "custom"
            ],
            "type": "string",
            "description": "Only used when comparing gas. Sets a typical yearly gas consumption."
          },
          "maxOffersPerScenario": {
            "title": "How many offers to show",
            "minimum": 0,
            "type": "integer",
            "description": "The cheapest N offers for each place and supply. The regulated tariff (PVPC for electricity, TUR for gas) is always added as a reference. 0 = all (about 70 electricity or 60 gas offers).",
            "default": 0
          },
          "maxItems": {
            "title": "Maximum results (spending limit)",
            "minimum": 0,
            "type": "integer",
            "description": "The run stops after this many rows in total, so you never pay more than expected. 0 = no limit.",
            "default": 0
          },
          "contractedPowerKw": {
            "title": "Contracted power (kW)",
            "minimum": 0.1,
            "maximum": 450,
            "type": "number",
            "description": "On your electricity bill as <i>Potencia contratada</i> (if it shows two values, use the first, <i>punta</i>). Most Spanish homes have 3.45, 4.6 or 5.75 kW. Leave empty to use the profile above. Above 15 kW the business tariff (3.0TD) applies."
          },
          "annualElectricityKwh": {
            "title": "Electricity used per year (kWh)",
            "minimum": 0,
            "type": "integer",
            "description": "On your bill as <i>Consumo anual</i> or in your supplier's app. If you only know one month, multiply by 12. Leave empty to use the profile."
          },
          "annualGasKwh": {
            "title": "Gas used per year (kWh)",
            "minimum": 0,
            "type": "integer",
            "description": "On your gas bill in kWh (not m³). Leave empty to use the gas option above."
          },
          "usagePattern": {
            "title": "When do you use most electricity?",
            "enum": [
              "standard",
              "evenings_nights_weekends",
              "daytime"
            ],
            "type": "string",
            "description": "Electricity is cheaper at night and at weekends with many tariffs. This changes which offers come out cheapest.",
            "default": "standard"
          },
          "consumptionCurveUrl": {
            "title": "Hourly consumption file from your distributor (URL)",
            "type": "string",
            "description": "Most accurate option. Download the CSV of your hourly consumption from your distributor's website (i-DE, e-distribución, UFD…; <a href='https://comparador.cnmc.gob.es/ejemplo.csv' target='_blank'>example</a>) and paste a link to it. Offers are then compared with your real consumption. Your supply number (CUPS) is never written to the results."
          },
          "consumptionCurveCsv": {
            "title": "…or paste the content of that file",
            "type": "string",
            "description": "Alternative to the link above: open the CSV and paste its content here."
          },
          "greenEnergyOnly": {
            "title": "Only 100% renewable energy offers",
            "type": "boolean",
            "description": "Show only offers with certified green electricity.",
            "default": false
          },
          "excludePermanence": {
            "title": "Hide offers with a minimum stay (permanencia)",
            "type": "boolean",
            "description": "Hide offers that charge you if you leave before a given date.",
            "default": false
          },
          "excludeAdditionalServices": {
            "title": "Hide offers bundled with extra services",
            "type": "boolean",
            "description": "Hide offers that include maintenance, insurance or similar extras in the price.",
            "default": false
          },
          "priceTypes": {
            "title": "Type of price",
            "type": "array",
            "description": "Empty = all. <b>Same price all day</b> is the simplest. <b>Cheaper at some hours</b> rewards using electricity at night or weekends. <b>Free / cheap hours you choose</b> lets you pick your hours. <b>Follows the market</b> changes with wholesale prices.",
            "items": {
              "type": "string",
              "enum": [
                "single_price",
                "multi_period",
                "flexible_hours",
                "indexed"
              ],
              "enumTitles": [
                "Same price all day",
                "Cheaper at some hours",
                "Free / cheap hours you choose",
                "Follows the market (indexed)"
              ]
            }
          },
          "companies": {
            "title": "Only these suppliers",
            "type": "array",
            "description": "Optional. Part of the supplier name, e.g. <code>iberdrola</code>, <code>endesa</code>, <code>octopus</code>.",
            "items": {
              "type": "string"
            }
          },
          "includeOfferDetails": {
            "title": "Include bill breakdown and contact details",
            "type": "boolean",
            "description": "For each offer: how the bill is calculated (power, energy, taxes, meter, VAT), customer-service phone and e-mail, and conditions.",
            "default": true
          },
          "saveRankingReports": {
            "title": "Save the CNMC's official report (PDF + Excel)",
            "type": "boolean",
            "description": "Saves the official CNMC comparison report of each search. Each row gets a download link.",
            "default": false
          },
          "saveOfferPdfs": {
            "title": "Save the official PDF of each offer",
            "type": "boolean",
            "description": "Saves the CNMC sheet of each offer (estimated bill and conditions). Each row gets a download link.",
            "default": false
          },
          "periodStart": {
            "title": "From date",
            "type": "string",
            "description": "Leave both dates empty to compare a full year (recommended). To compare one bill, enter its start and end dates."
          },
          "periodEnd": {
            "title": "To date",
            "type": "string",
            "description": "Empty = today."
          },
          "mode": {
            "title": "Only show what changed since my last run?",
            "enum": [
              "snapshot",
              "delta"
            ],
            "type": "string",
            "description": "<b>No</b>: the full list every time. <b>Yes</b>: the first run returns everything; next runs only new, changed and withdrawn tariffs. Schedule it daily to be alerted of price changes.",
            "default": "snapshot"
          },
          "catalogOfferTypes": {
            "title": "Which tariffs",
            "type": "array",
            "description": "Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "electricity",
                "gas",
                "combined"
              ],
              "enumTitles": [
                "Electricity",
                "Gas",
                "Electricity + gas together"
              ]
            }
          },
          "catalogDate": {
            "title": "Tariffs available on",
            "type": "string",
            "description": "Empty = today."
          },
          "catalogDates": {
            "title": "Past dates (history)",
            "type": "array",
            "description": "Optional. Get the tariffs as they were on each date (YYYY-MM-DD, back to 2021), e.g. to see how prices evolved. Only with \"full list every time\".",
            "items": {
              "type": "string"
            }
          },
          "enrichCatalogCompanies": {
            "title": "Add the supplier name",
            "type": "boolean",
            "description": "The official list does not include the supplier name; we add it for about 80% of tariffs (free, takes a few seconds more).",
            "default": true
          },
          "stateKey": {
            "title": "Name for change tracking",
            "type": "string",
            "description": "Optional. Use a different name to keep separate change alerts (e.g. one per client)."
          },
          "pvpcDateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Empty = today. Prices are available from mid-2024."
          },
          "pvpcDateTo": {
            "title": "To date",
            "type": "string",
            "description": "Empty = latest published day (tomorrow after 20:30)."
          },
          "pvpcZones": {
            "title": "Where",
            "type": "array",
            "description": "Prices differ by area because of taxes.",
            "items": {
              "type": "string",
              "enum": [
                "peninsula_baleares",
                "canarias",
                "ceuta_melilla"
              ],
              "enumTitles": [
                "Mainland Spain and Balearic Islands",
                "Canary Islands",
                "Ceuta and Melilla"
              ]
            },
            "default": [
              "peninsula_baleares"
            ]
          },
          "pvpcTaxes": {
            "title": "Taxes",
            "enum": [
              "with_taxes",
              "without_taxes",
              "both"
            ],
            "type": "string",
            "description": "With taxes = what you actually pay per kWh.",
            "default": "with_taxes"
          },
          "billPeriodStart": {
            "title": "Bill from date",
            "type": "string",
            "description": "As on your bill. Empty = first day of last month."
          },
          "billPeriodEnd": {
            "title": "Bill to date",
            "type": "string",
            "description": "Empty = last day of last month."
          },
          "billMeterType": {
            "title": "Type of meter",
            "enum": [
              "auto",
              "traditional",
              "smart"
            ],
            "type": "string",
            "description": "Almost all homes have a smart meter, but the simple option only needs the three numbers from your bill. If you gave an hourly consumption file above, it is used automatically.",
            "default": "auto"
          },
          "billPostalCode": {
            "title": "Postcode of the bill",
            "type": "string",
            "description": "Empty = first postcode above."
          },
          "billPowerP1Kw": {
            "title": "Contracted power – peak (kW)",
            "minimum": 0.1,
            "maximum": 10,
            "type": "number",
            "description": "<i>Potencia punta</i> on your bill. Empty = your contracted power or profile."
          },
          "billPowerP2Kw": {
            "title": "Contracted power – off-peak (kW)",
            "minimum": 0.1,
            "maximum": 10,
            "type": "number",
            "description": "<i>Potencia valle</i> on your bill. Usually the same as peak."
          },
          "billConsumptionP1Kwh": {
            "title": "Consumption – peak (kWh)",
            "minimum": 0,
            "type": "integer",
            "description": "<i>Consumo punta</i> on your bill. Leave the three consumption fields empty to estimate them from your profile."
          },
          "billConsumptionP2Kwh": {
            "title": "Consumption – flat (kWh)",
            "minimum": 0,
            "type": "integer",
            "description": "<i>Consumo llano</i> on your bill."
          },
          "billConsumptionP3Kwh": {
            "title": "Consumption – off-peak (kWh)",
            "minimum": 0,
            "type": "integer",
            "description": "<i>Consumo valle</i> on your bill."
          },
          "socialBonus": {
            "title": "Do you have the social bonus (bono social)?",
            "enum": [
              "none",
              "vulnerable",
              "vulnerable_severe",
              "low_income"
            ],
            "type": "string",
            "description": "Discount for vulnerable households. If you don't know, leave \"No\".",
            "default": "none"
          },
          "socialBonusCategory": {
            "title": "Household type (for the social bonus)",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "1 = one person or no children, 2 = one child, 3 = two children, 4 = large family, 5 = pensioner with minimum pension.",
            "default": 1
          },
          "threePhaseMeter": {
            "title": "Three-phase meter",
            "type": "boolean",
            "description": "Only if your bill says <i>trifásico</i>. Most homes are single-phase.",
            "default": false
          },
          "billSimulatePowersKw": {
            "title": "What if I contracted a different power?",
            "type": "array",
            "description": "Optional. Powers to try, e.g. <code>[2.3, 4.6]</code>: the bill is recalculated with each one so you can see if lowering your power saves money."
          },
          "contractedPowerValleKw": {
            "title": "Off-peak power (kW)",
            "minimum": 0.1,
            "maximum": 450,
            "type": "number",
            "description": "Only if your bill shows a different <i>potencia valle</i>. Defaults to the contracted power."
          },
          "contractedPowersKw": {
            "title": "Six powers P1–P6 (businesses, kW)",
            "type": "array",
            "description": "For businesses above 15 kW with six contracted powers, e.g. <code>[20, 20, 20, 20, 20, 25]</code>."
          },
          "electricityConsumptionSplitPct": {
            "title": "Consumption split by period (%)",
            "type": "array",
            "description": "Exact share of consumption in peak / flat / off-peak hours (P1–P3; P1–P6 for businesses), e.g. <code>[30, 25, 45]</code>. Overrides \"When do you use most electricity?\"."
          },
          "household": {
            "title": "Domestic consumer",
            "type": "boolean",
            "description": "Some offers are only for homes, others only for businesses. Set automatically from the profile."
          },
          "selfConsumption": {
            "title": "I have solar panels",
            "type": "boolean",
            "description": "Marks offers that pay for surplus solar energy. The CNMC does not include the surplus in the bill estimate.",
            "default": false
          },
          "scenarios": {
            "title": "Many profiles at once (JSON)",
            "type": "array",
            "description": "Replaces the postcode × supply grid. Each object may set: <code>id</code>, <code>label</code>, <code>supply</code> (electricity | gas | combined), <code>postalCode</code>, <code>consumerProfile</code>, <code>gasUse</code>, <code>usagePattern</code>, <code>contractedPowerKw</code>, <code>contractedPowerValleKw</code>, <code>contractedPowersKw</code>, <code>annualElectricityKwh</code>, <code>electricityKwhPeriod</code>, <code>electricityConsumptionSplitPct</code>, <code>annualGasKwh</code>, <code>periodStart</code>, <code>periodEnd</code>, <code>household</code>, <code>excludeAdditionalServices</code>, <code>excludePermanence</code>, <code>selfConsumption</code>, <code>useConsumptionCurve</code>. Missing fields take the values above. Max 300."
          },
          "billSimulations": {
            "title": "Several bills at once (JSON)",
            "type": "array",
            "description": "List of objects with any of the bill fields above (<code>label</code>, <code>billPeriodStart</code>, <code>billPeriodEnd</code>, <code>billPostalCode</code>, <code>billPowerP1Kw</code>, <code>billConsumptionP1Kwh</code>…, <code>socialBonus</code>, <code>socialBonusCategory</code>, <code>billMeterType</code>)."
          },
          "parametersDate": {
            "title": "Date of the regulated prices",
            "type": "string",
            "description": "For \"Official regulated prices and taxes\". Empty = today."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}