{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Fuel Prices - gasolineras, gasolina, diesel y combustible",
    "description": "Official prices of every petrol station in Spain (~11,500): daily history, price deltas, cheapest-N by zone, radius search and alerts. Precios de gasolineras y estaciones de servicio: gasolina 95/98, diesel, gasoleo, GLP y combustibles por provincia, municipio y codigo postal.",
    "version": "1.0",
    "x-build-id": "VYcI7vAHfxPlv6E4z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/opendata_es~spain-fuel-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-opendata_es-spain-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/opendata_es~spain-fuel-prices/runs": {
      "post": {
        "operationId": "runs-sync-opendata_es-spain-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/opendata_es~spain-fuel-prices/run-sync": {
      "post": {
        "operationId": "run-sync-opendata_es-spain-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": {
          "fuel": {
            "title": "Fuel / Carburante",
            "enum": [
              "gasolina_95_e5",
              "gasolina_95_e5_premium",
              "gasolina_95_e10",
              "gasolina_98_e5",
              "gasolina_98_e10",
              "gasoleo_a",
              "gasoleo_premium",
              "gasoleo_b",
              "gases_licuados_del_petroleo",
              "gas_natural_comprimido",
              "gas_natural_licuado",
              "biodiesel",
              "bioetanol",
              "hidrogeno",
              "adblue"
            ],
            "type": "string",
            "description": "Product to report. Accepts friendly aliases (diesel, sp95, glp...) or the official name.",
            "default": "gasolina_95_e5"
          },
          "provinces": {
            "title": "Provinces / Provincias",
            "type": "array",
            "description": "Filter by province name, accent-insensitive partial match. Empty = all Spain.",
            "items": {
              "type": "string"
            }
          },
          "municipalities": {
            "title": "Municipalities / Municipios",
            "type": "array",
            "description": "Filter by municipality or town name (partial match).",
            "items": {
              "type": "string"
            }
          },
          "postalCodes": {
            "title": "Postal codes / Codigos postales",
            "type": "array",
            "description": "Exact 5-digit postal codes.",
            "items": {
              "type": "string"
            }
          },
          "brands": {
            "title": "Brands / Rotulos",
            "type": "array",
            "description": "Filter by brand, e.g. REPSOL, CEPSA, BALLENOIL, CARREFOUR.",
            "items": {
              "type": "string"
            }
          },
          "latitude": {
            "title": "Latitude / Latitud",
            "type": "number",
            "description": "Centre point for the radius search (WGS84)."
          },
          "longitude": {
            "title": "Longitude / Longitud",
            "type": "number",
            "description": "Centre point for the radius search (WGS84)."
          },
          "radiusKm": {
            "title": "Radius in km / Radio en km",
            "minimum": 0.1,
            "type": "number",
            "description": "Only stations within this distance of latitude/longitude."
          },
          "maxPrice": {
            "title": "Price alert threshold / Umbral de alerta",
            "type": "number",
            "description": "Stations at or below this EUR/litre are flagged belowThreshold and trigger the alert webhook."
          },
          "topN": {
            "title": "Cheapest N per zone / N mas baratas por zona",
            "minimum": 0,
            "type": "integer",
            "description": "0 = every match. Otherwise keep only the N cheapest per the zone chosen in rankBy.",
            "default": 0
          },
          "rankBy": {
            "title": "Ranking scope / Ambito del ranking",
            "enum": [
              "province",
              "municipality",
              "overall",
              "none"
            ],
            "type": "string",
            "description": "Where the cheapest-N ranking is computed: inside each province, inside each municipality, nationwide, or no ranking at all.",
            "default": "province"
          },
          "openNow": {
            "title": "Only open right now / Solo abiertas ahora",
            "type": "boolean",
            "description": "Parses the official opening-hours string. Stations with an unreadable schedule are kept.",
            "default": false
          },
          "publicOnly": {
            "title": "Public stations only / Solo venta al publico",
            "type": "boolean",
            "description": "Drops restricted-sale stations (co-ops, fleets).",
            "default": true
          },
          "includeAllFuels": {
            "title": "Include every fuel price / Incluir todos los precios",
            "type": "boolean",
            "description": "Adds the full prices{} object per station, not only the selected fuel.",
            "default": true
          },
          "storeHistory": {
            "title": "Build daily history / Guardar historico diario",
            "type": "boolean",
            "description": "Appends one row per station/day to the named dataset and computes priceChange vs the previous run.",
            "default": true
          },
          "alertWebhookUrl": {
            "title": "Alert webhook URL",
            "type": "string",
            "description": "Optional. Receives a POST with the stations below maxPrice."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on dataset rows. 0 = no cap.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}