{
  "openapi": "3.0.1",
  "info": {
    "title": "Grocery Product Scraper for Instacart",
    "description": "Scrape Instacart grocery prices in the US and Canada: whole departments or stores, searches at chosen retailers, product pages and price grids by ZIP code. Returns price, regular price, stock, brand and size. Independent tool, not affiliated with or endorsed by Instacart.",
    "version": "0.0",
    "x-build-id": "knrCtfcfdDIaWllLw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/piotrv1001~instacart-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-piotrv1001-instacart-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/piotrv1001~instacart-scraper/runs": {
      "post": {
        "operationId": "runs-sync-piotrv1001-instacart-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/piotrv1001~instacart-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-piotrv1001-instacart-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Any mix of instacart.com and instacart.ca URLs: product pages (/products/... or /store/{retailer}/products/...), retailer storefronts (/store/{retailer}), departments (/store/{retailer}/collections/{department}), cross-retailer search (/store/s?k=...) or a search at one retailer (/store/{retailer}/s?k=...). Other URLs are skipped and named in the run's status. For product IDs or keywords use the fields below.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "retailerSlugs": {
            "title": "Retailer slugs",
            "uniqueItems": true,
            "type": "array",
            "description": "Retailer slugs or names (e.g. costco, safeway, target; loblaws, walmart-canada in Canada). For each one the actor scrapes the storefront's featured products. With Departments set, it reads those departments in full instead. In grid mode (Postal codes with Product IDs) these are the retailers priced in each ZIP.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "departments": {
            "title": "Departments or aisles",
            "uniqueItems": true,
            "type": "array",
            "description": "Read whole departments or aisles at every retailer in Retailer slugs: names as shown in the store menu (Dairy & Eggs, Frozen, Cheese) or slugs (dairy, frozen, cheese). Use all for the whole store. Every product in them is returned, with its department and aisle, at Postal code or at each of Postal codes. Raise Max items for full departments: a large one has 1,000+ products. Department links (/store/safeway/collections/dairy) also work in Start URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "uniqueItems": true,
            "type": "array",
            "description": "Free-text queries. Without Search at retailers, each query returns the first cross-retailer results page (about 14 items from the top two retailers). With Search at retailers, each query is run at each of those retailers (up to 20 items per query and retailer).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchRetailers": {
            "title": "Search at retailers",
            "uniqueItems": true,
            "type": "array",
            "description": "Retailer slugs or names (costco, safeway, target, Whole Foods...). Every search query is run at every retailer listed here: query × retailer, up to 20 items each, priced at the store that serves Postal code. Compare one product across banners in one run. A retailer with no results for a query (for example, it does not serve the ZIP) is named in the run's status and costs nothing.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "productIds": {
            "title": "Product IDs",
            "uniqueItems": true,
            "type": "array",
            "description": "List of Instacart product IDs to fetch directly. The slug part of the PDP URL is decorative and is omitted. In grid mode (Postal codes set) these are the products priced in each ZIP.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "defaultRetailerSlug": {
            "title": "Default retailer slug for product IDs",
            "type": "string",
            "description": "Retailer slug to attach as ?retailerSlug= when fetching PDPs from productIds. If empty, Instacart returns its default (SF) market.",
            "default": ""
          },
          "seedFromHome": {
            "title": "Seed retailers from Instacart home",
            "type": "boolean",
            "description": "If true, fetch https://www.instacart.com/ and enqueue all retailer storefronts found on it. Useful when you want a broad sweep.",
            "default": false
          },
          "postalCode": {
            "title": "Postal code (US ZIP or Canada)",
            "type": "string",
            "description": "US ZIP code (94105) or Canadian postal code (M5V 3L9) the results are priced for: Instacart prices each area at the store that serves it. Canadian postal codes use instacart.ca, with prices in CAD. Each row's postalCode shows what it was priced for. Also the area for List stores and Departments when Postal codes is empty.",
            "default": "94105"
          },
          "postalCodes": {
            "title": "Postal codes (several areas)",
            "uniqueItems": true,
            "type": "array",
            "description": "List of US ZIP or Canadian postal codes. With Departments, those departments are read at each one. With Product IDs, the actor runs grid mode: every Product ID × ZIP × retailer (Retailer slugs, or the default retailer slug) is priced at the store that actually serves that ZIP. One row per priced cell with shopId, retailerLocationId, place and zoneId. Cells that cannot be priced (retailer does not serve the ZIP, ZIP outside Instacart, product not carried there) are not charged and are listed in the GRID_COVERAGE key-value record. In grid mode Retailer slugs and Product IDs are used for the grid, not for storefront / PDP scraping. With List stores on, the stores serving each of them are listed.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "listStores": {
            "title": "List stores",
            "type": "boolean",
            "description": "List every store Instacart offers at Postal code (or at each of Postal codes): retailer, slug, name, type, categories, store location ID and service type (delivery or pickup). One row per store; use the slugs in Retailer slugs or Search at retailers. Product filters do not apply to store rows.",
            "default": false
          },
          "inStockOnly": {
            "title": "In stock only",
            "type": "boolean",
            "description": "Keep only products the store reports as available. Applies to every source (product pages, storefronts, search, grid). Skipped products are not charged.",
            "default": false
          },
          "onSaleOnly": {
            "title": "On sale only",
            "type": "boolean",
            "description": "Keep only discounted products: Instacart shows a regular price (fullPriceString) above the current price. Skipped products are not charged.",
            "default": false
          },
          "minPrice": {
            "title": "Min price",
            "minimum": 0,
            "type": "number",
            "description": "Keep only products priced at or above this, in the store's currency (USD, or CAD in Canada), e.g. 2.5. Products without a price are skipped when this is set. Skipped products are not charged."
          },
          "maxPrice": {
            "title": "Max price",
            "minimum": 0,
            "type": "number",
            "description": "Keep only products priced at or below this, in the store's currency (USD, or CAD in Canada), e.g. 10. Products without a price are skipped when this is set. Skipped products are not charged."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Stop pushing to the dataset after this many products. 0 = unlimited.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. PDP, storefront and cross-retailer search work from any IP, but a US IP yields more accurate location defaults.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}