{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Fuel Prices Scraper",
    "description": "Today's petrol and diesel prices at ~3,000 UK forecourts, from the retailers' own CMA open-data feeds: station, brand, postcode, coordinates and pence per litre for E10, E5, B7 and super diesel. Stale feeds are excluded by age -- one publishes prices nineteen months old.",
    "version": "0.1",
    "x-build-id": "5VpBrft1HfVsuUzrr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~uk-fuel-prices-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-uk-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/scrapyx~uk-fuel-prices-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-uk-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/scrapyx~uk-fuel-prices-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-uk-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": {
          "retailers": {
            "title": "Retailers",
            "type": "array",
            "description": "Which CMA scheme feeds to read. Leave empty for all ten reachable ones. Asda is part of the scheme but its robots.txt disallows the feed, so it is never fetched; BP, Sainsbury's, Ascona and Karan are unreachable (403 / dead host / broken TLS / timeout). Every run reports those five as feed_not_fetched rows so the coverage gap is visible.",
            "items": {
              "type": "string",
              "enum": [
                "applegreen",
                "esso",
                "jet",
                "morrisons",
                "moto",
                "mfg",
                "rontec",
                "sgn",
                "shell",
                "tesco"
              ]
            }
          },
          "maxFeedAgeDays": {
            "title": "Max feed age (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Each feed carries ONE last_updated timestamp. On the day this was built, four of ten were stale - Tesco, Rontec and Shell by ~4 months and Applegreen by 19 months - and their prices (E10 at 138.8p) look perfectly plausible next to today's ~170p. Stations from feeds older than this are excluded and the summary names each excluded feed with its age. Set to 0 to accept only feeds updated today.",
            "default": 7
          },
          "includeStaleFeeds": {
            "title": "Include stale feeds anyway",
            "type": "boolean",
            "description": "Keep stations from stale feeds, each labelled with feedAgeDays and feedIsStale, instead of dropping them.",
            "default": false
          },
          "fuelTypes": {
            "title": "Fuel types",
            "type": "array",
            "description": "Keep only stations selling at least one of these. E10 = petrol, E5 = super unleaded, B7 = diesel, SDV = super diesel.",
            "items": {
              "type": "string",
              "enum": [
                "E10",
                "E5",
                "B7",
                "SDV"
              ]
            }
          },
          "postcodeAreas": {
            "title": "Postcode areas",
            "type": "array",
            "description": "Outward-code letters - SW, M, EH, BS. Keep only stations in these areas.",
            "items": {
              "type": "string"
            }
          },
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "Shell, Esso, BP, Tesco, Texaco, JET... Matched against the normalised brand - the feeds spell Shell three ways.",
            "items": {
              "type": "string"
            }
          },
          "excludeSuspectRows": {
            "title": "Exclude suspect rows",
            "type": "boolean",
            "description": "Drop stations whose site_id is a placeholder geohash (7zzzzzzzzzzz) or whose coordinates fall outside the UK - Morrisons' feed, for instance, holds a single station located in Gibraltar. They are counted in the summary either way.",
            "default": true
          },
          "maxItems": {
            "title": "Max stations",
            "minimum": 1,
            "type": "integer",
            "description": "Overall cap. The ten reachable feeds hold about 3,000 stations between them.",
            "default": 5000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Feeds fetched in parallel. Each is one request.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Every feed answered 200 from a plain IP; these are published for exactly this kind of use.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}