{
  "openapi": "3.0.1",
  "info": {
    "title": "Europe Fuel Prices Scraper: Spain and Portugal Stations",
    "description": "Current fuel prices at every station in Spain and Portugal, straight from the official government sources: diesel, petrol 95 and 98, LPG and more, each with its update time. Filter by province, city or radius. No personal data, no proxies.",
    "version": "1.0",
    "x-build-id": "qulWSeDdYAOjqom6Z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rowcraft~europe-fuel-prices-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rowcraft-europe-fuel-prices-scraper",
        "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/rowcraft~europe-fuel-prices-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rowcraft-europe-fuel-prices-scraper",
        "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/rowcraft~europe-fuel-prices-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rowcraft-europe-fuel-prices-scraper",
        "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": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Which countries to read: Spain (ES) from the Ministry of Industry and Tourism, Portugal (PT) from DGEG. Pick one or both. Provinces apply to Spain and districts to Portugal; a country you select without its own filter is read in full.",
            "items": {
              "type": "string",
              "enum": [
                "ES",
                "PT"
              ],
              "enumTitles": [
                "Spain",
                "Portugal"
              ]
            },
            "default": [
              "ES"
            ]
          },
          "fuels": {
            "title": "Fuels",
            "type": "array",
            "description": "Keep only stations that sell these fuels (a price must be listed). Empty = every station, including those with no price at the moment. Every row still carries all the prices the station lists.",
            "items": {
              "type": "string",
              "enum": [
                "diesel",
                "diesel_premium",
                "diesel_coloured",
                "diesel_renewable",
                "biodiesel",
                "petrol_95",
                "petrol_95_premium",
                "petrol_95_e10",
                "petrol_95_e25",
                "petrol_98",
                "petrol_98_premium",
                "petrol_98_e10",
                "petrol_renewable",
                "petrol_two_stroke",
                "e85",
                "bioethanol",
                "lpg",
                "cng",
                "cng_m3",
                "lng",
                "biogas_cng",
                "biogas_lng",
                "hydrogen",
                "adblue",
                "methanol",
                "ammonia"
              ],
              "enumTitles": [
                "Diesel",
                "Premium diesel",
                "Coloured (agricultural) diesel",
                "Renewable diesel (HVO)",
                "Biodiesel",
                "Petrol 95 (E5)",
                "Premium petrol 95",
                "Petrol 95 E10",
                "Petrol 95 E25",
                "Petrol 98",
                "Premium petrol 98",
                "Petrol 98 E10",
                "Renewable petrol",
                "Two-stroke petrol mix",
                "E85 (bioethanol blend)",
                "Bioethanol",
                "LPG (autogas)",
                "CNG (compressed natural gas), per kg",
                "CNG (compressed natural gas), per m3",
                "LNG (liquefied natural gas)",
                "Compressed biogas",
                "Liquefied biogas",
                "Hydrogen",
                "AdBlue",
                "Methanol",
                "Ammonia"
              ]
            }
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many stations. 0 = no limit (Spain has about 11,400 stations and mainland Portugal about 3,100). With a centre point the nearest stations come first.",
            "default": 500
          },
          "provinces": {
            "title": "Provinces (Spain)",
            "type": "array",
            "description": "Spanish provinces to include, one per line: the code 01 to 52 (28 = Madrid, 02 = Albacete) or the name (Madrid, Málaga, A Coruña). Empty = all 52 provinces, which takes about a minute because the service is read one province at a time.",
            "items": {
              "type": "string"
            }
          },
          "districts": {
            "title": "Districts (Portugal)",
            "type": "array",
            "description": "Portuguese districts to include, one per line: the number 1 to 18 or the name (Lisboa, Porto, Faro, Évora). Empty = all 18 districts of the mainland.",
            "items": {
              "type": "string"
            }
          },
          "postalCodes": {
            "title": "Postal codes",
            "type": "array",
            "description": "One per line. Spain: five digits (28001; a dropped leading zero is repaired, 2001 = 02001). Portugal: 1000-001, or just the first four digits (1000) for the whole area. A Spanish postal code also selects its province, so the run reads one province, not the country.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City or municipality names, one per line. Capitals, accents and hyphens do not matter (a coruna = A Coruña). A city filter without a province reads every province, which takes about a minute.",
            "items": {
              "type": "string"
            }
          },
          "fuelsMatch": {
            "title": "Fuels must match",
            "enum": [
              "all",
              "any"
            ],
            "type": "string",
            "description": "With more than one fuel selected: a station must sell all of them (default) or at least one of them.",
            "default": "all"
          },
          "center": {
            "title": "Centre point",
            "type": "string",
            "description": "Latitude and longitude as Google Maps shows them, for example 40.4168, -3.7038. Stations within the radius below are delivered, nearest first, with their distance. Without a province or district every province is read, which takes about a minute."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 0.1,
            "maximum": 2000,
            "type": "number",
            "description": "Distance from the centre point, in kilometres, straight line. Used only when a centre point is set.",
            "default": 10
          },
          "onlyNew": {
            "title": "Only new rows since the last run",
            "type": "boolean",
            "description": "Remember the rows already delivered to you (in a key-value store in your Apify account) and deliver only rows that appeared since the last run with the same state key. The first run delivers everything that matches; later runs cost only the new rows. Ideal for schedules.",
            "default": false
          },
          "stateName": {
            "title": "State name",
            "type": "string",
            "description": "Name of the memory used by \"Only new rows\". Use a different name for each schedule or search (for example `stockholm-python`) so they do not share one memory.",
            "default": "default"
          },
          "notifyUrl": {
            "title": "Notify this URL when the run ends",
            "type": "string",
            "description": "A webhook address that receives one JSON POST with the number of new rows and links to the dataset: a Slack or Discord incoming webhook, a Make, n8n or Zapier catch hook, or your own endpoint. The message is also in the `text` (Slack) and `content` (Discord) fields."
          },
          "notifyWhenEmpty": {
            "title": "Notify also when there are no new rows",
            "type": "boolean",
            "description": "By default the notification is sent only when at least one row was delivered.",
            "default": false
          },
          "requestIntervalMs": {
            "title": "Delay between requests (ms)",
            "minimum": 500,
            "maximum": 10000,
            "type": "integer",
            "description": "Pause between two requests to the official services. Default 1000 ms (one request per second), minimum 500. A province or a district is one request.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}