{
  "openapi": "3.0.1",
  "info": {
    "title": "Italy Fuel Prices – Real-time Petrol, Diesel, LPG & CNG (MIMIT)",
    "description": "Live prices of 20,000+ Italian petrol stations from official MIMIT data. Search by region, town, GPS radius or station ID; rankings, averages, price monitoring. This is not personalized advice. Material created also with the use of AI tools.",
    "version": "1.0",
    "x-build-id": "TUygPSp0yFu4q585z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mikestart~italy-fuel-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mikestart-italy-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/mikestart~italy-fuel-prices/runs": {
      "post": {
        "operationId": "runs-sync-mikestart-italy-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/mikestart~italy-fuel-prices/run-sync": {
      "post": {
        "operationId": "run-sync-mikestart-italy-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Search mode",
            "enum": [
              "area",
              "nearby",
              "stations"
            ],
            "type": "string",
            "description": "<b>area</b> = by region / province / town; <b>nearby</b> = within a radius around coordinates; <b>stations</b> = specific station IDs (best for monitoring).",
            "default": "area"
          },
          "areas": {
            "title": "Areas (mode = area)",
            "type": "array",
            "description": "List of objects: {\"region\": \"Lombardia\"} or {\"province\": \"MI\"} or {\"province\": \"MI\", \"town\": \"Milano\"}. Optional \"label\". Province accepts code (MI) or name (Milano)."
          },
          "points": {
            "title": "Points (mode = nearby)",
            "type": "array",
            "description": "List of {\"lat\": 45.4642, \"lng\": 9.19, \"label\": \"Milano Duomo\"}. Each point is searched separately."
          },
          "radiusKm": {
            "title": "Radius in km (mode = nearby)",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Search radius around each point, 1–10 km (limit of the official service).",
            "default": 5
          },
          "stationIds": {
            "title": "Station IDs (mode = stations)",
            "type": "array",
            "description": "MIMIT station IDs (the 'stationId' field of any previous result).",
            "items": {
              "type": "string"
            }
          },
          "fuelTypes": {
            "title": "Fuel types",
            "type": "array",
            "description": "Which fuels to return. Use 'all' for every fuel incl. premium products.",
            "items": {
              "type": "string",
              "enum": [
                "benzina",
                "gasolio",
                "gpl",
                "metano",
                "l-gnc",
                "gnl",
                "benzina-premium",
                "gasolio-premium",
                "altro",
                "all"
              ],
              "enumTitles": [
                "Benzina (petrol)",
                "Gasolio (diesel)",
                "GPL (LPG)",
                "Metano (CNG)",
                "L-GNC",
                "GNL (LNG)",
                "Premium petrol",
                "Premium diesel / HVO",
                "Other",
                "All fuels"
              ]
            },
            "default": [
              "benzina",
              "gasolio"
            ]
          },
          "serviceType": {
            "title": "Service type",
            "enum": [
              "any",
              "self",
              "servito"
            ],
            "type": "string",
            "description": "self = self-service price, servito = attended service price.",
            "default": "any"
          },
          "maxPriceAgeDays": {
            "title": "Max price age (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip prices not updated by the station in the last N days. 0 = keep all (rows still carry 'priceAgeHours' and 'isStale').",
            "default": 0
          },
          "includeStationDetails": {
            "title": "Include station details",
            "type": "boolean",
            "description": "Fetch address (missing in nearby mode), services, opening hours and website. One extra request per station – slower. Phone, e-mail and operator name are never collected.",
            "default": false
          },
          "maxResults": {
            "title": "Max price rows",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of rows (station × fuel × service) to output. 0 = no limit.",
            "default": 1000
          },
          "monitorKey": {
            "title": "Monitoring key",
            "type": "string",
            "description": "Any name (e.g. 'my-fleet-milano'). When set, prices are compared with the previous run that used the same key and rows get previousPrice / priceChange / changeStatus (NEW, UP, DOWN, SAME)."
          },
          "onlyChanges": {
            "title": "Output only changed prices",
            "type": "boolean",
            "description": "With a monitoring key, output only NEW/UP/DOWN rows (the first run returns everything as a baseline). Great for scheduled runs and alerts.",
            "default": false
          },
          "dataSource": {
            "title": "Data source",
            "enum": [
              "auto",
              "api",
              "csv"
            ],
            "type": "string",
            "description": "Where prices come from. Every output row has a `dataSource` field: `api-live` or `csv-daily`. The CSV is the official MIMIT open-data file (prezzo_alle_8.csv + anagrafica_impianti_attivi.csv); it is updated once a day, so prices can be up to ~1 day older than the live API. Station details (services, opening hours) are only available from the live API.",
            "default": "auto"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}