{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Fuel Prices - Cheapest Petrol Stations (MITECO data)",
    "description": "Live prices of every Spanish petrol station from the Ministry's open data, filtered by province, municipality, postal code or radius, sorted by cheapest or nearest. Clean numbers, area average and saving per station.",
    "version": "1.0",
    "x-build-id": "2xcduGVtC4dNhHoYM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hydramill~fuel-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hydramill-fuel-prices",
        "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/hydramill~fuel-prices/runs": {
      "post": {
        "operationId": "runs-sync-hydramill-fuel-prices",
        "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/hydramill~fuel-prices/run-sync": {
      "post": {
        "operationId": "run-sync-hydramill-fuel-prices",
        "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": {
          "province": {
            "title": "Province",
            "type": "string",
            "description": "Province name (Barcelona, València, A Coruña, Illes Balears...) or its 2-digit INE code (08, 46, 15...). Accents and case are ignored."
          },
          "municipality": {
            "title": "Municipality",
            "type": "string",
            "description": "Municipality name, e.g. \"L'Hospitalet de Llobregat\" or \"Hospitalet de Llobregat (L')\". Needs Province or Postal code, since names repeat across provinces. Digits are taken as the Ministry municipality id (Barcelona = 881, not the INE code)."
          },
          "postalCode": {
            "title": "Postal code",
            "pattern": "^\\d{1,5}$",
            "type": "string",
            "description": "5 digits = exact match (08005). Fewer digits = prefix (080 = Barcelona city, 08 = Barcelona province). The first two digits also pick the province to download."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "WGS84 latitude of the search point, e.g. 41.387 (Plaça de Catalunya, Barcelona)."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "WGS84 longitude of the search point, e.g. 2.17."
          },
          "radiusKm": {
            "title": "Radius",
            "minimum": 0.1,
            "maximum": 1000,
            "type": "number",
            "description": "Keep only stations within this distance of the point (needs latitude and longitude)."
          },
          "fuelTypes": {
            "title": "Fuel types",
            "uniqueItems": true,
            "type": "array",
            "description": "Keep stations that sell at least one of these. The FIRST one drives price sorting and the price / unit / areaAveragePrice / savingVsAverage columns. Empty = every station, with every fuel it sells in prices.",
            "items": {
              "type": "string",
              "enum": [
                "g95e5",
                "g95e5Premium",
                "g95e10",
                "g95e25",
                "g95e85",
                "g98e5",
                "g98e10",
                "gasolineRenewable",
                "dieselA",
                "dieselPremium",
                "dieselB",
                "dieselRenewable",
                "biodiesel",
                "bioethanol",
                "lpg",
                "cng",
                "lng",
                "bioCng",
                "bioLng",
                "hydrogen",
                "methanol",
                "ammonia",
                "adblue"
              ],
              "enumTitles": [
                "Gasolina 95 E5 - unleaded 95 (g95e5, €/l)",
                "Gasolina 95 E5 Premium (g95e5Premium, €/l)",
                "Gasolina 95 E10 (g95e10, €/l)",
                "Gasolina 95 E25 (g95e25, €/l)",
                "Gasolina 95 E85 (g95e85, €/l)",
                "Gasolina 98 E5 - unleaded 98 (g98e5, €/l)",
                "Gasolina 98 E10 (g98e10, €/l)",
                "Gasolina Renovable (gasolineRenewable, €/l)",
                "Gasóleo A - diesel (dieselA, €/l)",
                "Gasoleo Premium (dieselPremium, €/l)",
                "Gasoleo B (dieselB, €/l)",
                "Diésel Renovable (dieselRenewable, €/l)",
                "Biodiesel (biodiesel, €/l)",
                "Bioetanol (bioethanol, €/l)",
                "GLP / autogas - LPG (lpg, €/l)",
                "GNC - CNG (cng, €/kg)",
                "GNL - LNG (lng, €/kg)",
                "Biogas Natural Comprimido (bioCng, €/kg)",
                "Biogas Natural Licuado (bioLng, €/kg)",
                "Hidrogeno (hydrogen, €/kg)",
                "Metanol (methanol, €/l)",
                "Amoniaco (ammonia, €/l)",
                "Adblue (adblue, €/l)"
              ]
            }
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "cheapest",
              "nearest"
            ],
            "type": "string",
            "description": "cheapest = by the price of the first fuel type (needs a fuel type). nearest = by distance to the point (needs latitude/longitude). Default: cheapest when a fuel type is given, else nearest when a point is given, else by station id."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum stations returned (and charged). Area averages are still computed over every match.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}