{
  "openapi": "3.0.1",
  "info": {
    "title": "Trolley Grocery Price Comparison Scraper",
    "description": "Scrape UK grocery prices from Trolley.co.uk - compare Tesco, Asda, Sainsbury's, Morrisons, Waitrose, Ocado & more. Search, browse categories, get per-retailer price comparisons with weekly history, or list current retailer deals.",
    "version": "1.0",
    "x-build-id": "arfgX3QyYfLaaYtPE"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~trolley-grocery-price-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-trolley-grocery-price-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/crawlerbros~trolley-grocery-price-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-trolley-grocery-price-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/crawlerbros~trolley-grocery-price-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-trolley-grocery-price-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byCategory",
              "byProductIds",
              "dealsByStore"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text product search, e.g. `milk`, `chocolate`, `washing pods`.",
            "default": "milk"
          },
          "categorySlug": {
            "title": "Category slug (mode=byCategory)",
            "type": "string",
            "description": "A Trolley.co.uk `/explore/` category slug, e.g. `vanilla-ice-creams`, `salted-butter`, `single-malt-whiskeys`. Also accepts a full `https://www.trolley.co.uk/explore/...` URL."
          },
          "productIds": {
            "title": "Product IDs (mode=byProductIds)",
            "type": "array",
            "description": "Trolley.co.uk product IDs (e.g. `MOZ184`), product paths (`/product/x/MOZ184`), or full product URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "store": {
            "title": "Retailer (mode=dealsByStore)",
            "enum": [
              "asda",
              "tesco",
              "sainsburys",
              "morrisons",
              "coop",
              "iceland",
              "boots",
              "superdrug",
              "aldi",
              "waitrose",
              "poundland",
              "savers",
              "ocado",
              "amazon",
              "ebay",
              "petsathome"
            ],
            "type": "string",
            "description": "Retailer to pull current deals from.",
            "default": "tesco"
          },
          "sortOrder": {
            "title": "Sort order (mode=search)",
            "enum": [
              "relevance",
              "price"
            ],
            "type": "string",
            "description": "How to order search results. `Lowest price first` sorts by each product's best listed price across all retailers.",
            "default": "relevance"
          },
          "dietary": {
            "title": "Dietary filter (mode=search)",
            "enum": [
              "",
              "vegetarian",
              "organic",
              "vegan",
              "halal",
              "kosher",
              "not tested on animals"
            ],
            "type": "string",
            "description": "Only return search results tagged with this dietary attribute on Trolley.co.uk.",
            "default": ""
          },
          "brandFilter": {
            "title": "Brand filter (mode=search)",
            "type": "string",
            "description": "Only return search results from this brand, e.g. `Arla`, `Tesco`, `Yeo Valley`. Must match a brand name Trolley.co.uk shows for the given search query — check a plain search first if unsure."
          },
          "sizeFilter": {
            "title": "Pack size filter (mode=search)",
            "type": "string",
            "description": "Only return search results of this pack size, e.g. `1l`, `500ml`, `2l`. Must match a size Trolley.co.uk shows for the given search query — check a plain search first if unsure."
          },
          "minPrice": {
            "title": "Min price (GBP)",
            "minimum": 0,
            "maximum": 10000,
            "type": "number",
            "description": "Drop products cheaper than this (best/lowest listed price)."
          },
          "maxPrice": {
            "title": "Max price (GBP)",
            "minimum": 0,
            "maximum": 10000,
            "type": "number",
            "description": "Drop products more expensive than this (best/lowest listed price)."
          },
          "filterByStore": {
            "title": "Filter results to a retailer",
            "enum": [
              "Asda",
              "Tesco",
              "Sainsbury's",
              "Morrisons",
              "Co-op",
              "Iceland",
              "Boots",
              "Superdrug",
              "ALDI",
              "Waitrose",
              "Poundland",
              "Savers",
              "Ocado",
              "Amazon",
              "Ebay",
              "Pets At Home"
            ],
            "type": "string",
            "description": "Only keep products/comparisons that include this retailer, e.g. `Tesco`, `Asda`, `Sainsbury's`. For mode=search this is applied server-side (a real Trolley.co.uk filter); for other modes it's applied to the retailers found on each record."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}