{
  "openapi": "3.0.1",
  "info": {
    "title": "Flashfood Deals Scraper — Grocery Markdowns, Canada + US",
    "description": "Scrape Flashfood's discounted near-expiry groceries by postal code, ZIP, city, store or the whole network: sale vs regular price, % off, best-before date, quantity left, department, barcode (GTIN) and store details. Monitor mode tracks new, repriced and sold-out items between runs.",
    "version": "0.1",
    "x-build-id": "WFJnfvtFI99mCdlRW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yugenox~flashfood-deals-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yugenox-flashfood-deals-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/yugenox~flashfood-deals-scraper/runs": {
      "post": {
        "operationId": "runs-sync-yugenox-flashfood-deals-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/yugenox~flashfood-deals-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-yugenox-flashfood-deals-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": {
          "locations": {
            "title": "📍 Locations",
            "type": "array",
            "description": "Where to look. Each entry can be a Canadian postal code (M5V 2T6 or just M5V), a US ZIP code (48226), a place (\"Toronto, ON\", \"Pittsburgh, PA\", \"Montréal\") or coordinates (\"43.65,-79.38\"). Every Flashfood store within the radius below is scraped, nearest first. A store found from several locations is only scraped once.",
            "items": {
              "type": "string"
            }
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 400,
            "type": "integer",
            "description": "Search radius around each location, in kilometres (up to 400). 5–10 km is a neighbourhood, 20 km a city, 50 km a metro area.",
            "default": 20
          },
          "storeIds": {
            "title": "🏪 Store ids",
            "type": "array",
            "description": "Specific Flashfood stores to scrape, by their 24-character id (the storeId field of any earlier run, e.g. 5ccc4fa913ed23170c14db02). Can be combined with locations.",
            "items": {
              "type": "string"
            }
          },
          "fullNetwork": {
            "title": "🌎 Whole network",
            "type": "boolean",
            "description": "Scrape every Flashfood store in Canada and the US (about 2,100 stores). Use \"Countries\" to keep one country. Locations and the radius are not needed.",
            "default": false
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Only stores in these countries. Leave empty for both.",
            "items": {
              "type": "string",
              "enum": [
                "CA",
                "US"
              ],
              "enumTitles": [
                "🇨🇦 Canada",
                "🇺🇸 United States"
              ]
            }
          },
          "banners": {
            "title": "Store banners / chains",
            "type": "array",
            "description": "Only these chains, e.g. No Frills, Loblaws, Real Canadian Superstore, Maxi, Provigo, Zehrs, Meijer, Giant Eagle, Kroger, Tops, DashMart. Matching ignores case, spaces and accents (\"No Frills\" = \"Nofrills\"). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Only items whose name contains one of these words (matched at the start of a word, case- and accent-insensitive), e.g. salmon, chicken, poulet, bread. Leave empty for everything.",
            "items": {
              "type": "string"
            }
          },
          "departments": {
            "title": "Departments",
            "type": "array",
            "description": "Only these departments, English or French, e.g. Meat, Seafood, Produce, Bakery, Deli, Dairy, Boucherie. Partial names match.",
            "items": {
              "type": "string"
            }
          },
          "minDiscountPercent": {
            "title": "Minimum discount (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only items at least this much below their regular price."
          },
          "maxPrice": {
            "title": "Maximum price",
            "pattern": "^\\s*(\\d+([.,]\\d{1,2})?)?\\s*$",
            "type": "string",
            "description": "Only items at or below this sale price, in the store's currency, e.g. 5 or 4.99."
          },
          "expiringWithinDays": {
            "title": "Best before within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Only items whose best-before date is at most this many days away (0 = today)."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of item rows for the whole run. Leave empty for no limit (a 20 km radius in a big Canadian city is typically 1,000–3,000 items; the whole network is 30,000+)."
          },
          "maxStores": {
            "title": "Max stores",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many stores (nearest first). Leave empty for no limit."
          },
          "includeStores": {
            "title": "Add store rows",
            "type": "boolean",
            "description": "Also output one row per store (address, coordinates, opening hours, pickup instructions, number of deals listed). Store rows are free.",
            "default": false
          },
          "storesOnly": {
            "title": "Stores only (no items)",
            "type": "boolean",
            "description": "Output only the store rows — a Flashfood store directory for the area or the whole network. No item rows. Each store row is billed as one `store` event (store rows next to items stay free).",
            "default": false
          },
          "monitorMode": {
            "title": "🔁 Monitor mode",
            "type": "boolean",
            "description": "Compare with the previous run of the same monitor key and output only what changed: NEW items, UPDATED ones (price, quantity or best-before changed, with quantity sold since last run), and SOLD_OUT / EXPIRED items that disappeared. Schedule it (e.g. hourly) to track markdowns and sell-through.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Name of the saved state to compare against. Runs with the same key compare with each other. Leave empty to derive one from your locations and filters."
          },
          "emitUnchanged": {
            "title": "Also output unchanged items",
            "type": "boolean",
            "description": "In monitor mode, also output items that did not change (marked UNCHANGED).",
            "default": false
          },
          "emitSoldOut": {
            "title": "Output sold-out / expired items",
            "type": "boolean",
            "description": "In monitor mode, output items that disappeared since the last run (SOLD_OUT, or EXPIRED when their best-before date has passed).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel requests. The default is fast and gentle.",
            "default": 8
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Apify Proxy is required. Datacenter proxies work; the actor switches to residential by itself if they stop working.",
            "default": {
              "useApifyProxy": true
            }
          },
          "apiKeyOverride": {
            "title": "API key override",
            "type": "string",
            "description": "Advanced / support only."
          },
          "apiBaseUrlOverride": {
            "title": "API base URL override",
            "type": "string",
            "description": "Advanced / support only."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}