{
  "openapi": "3.0.1",
  "info": {
    "title": "Costco Scraper — Canada & USA Prices, Deals, Stock & Warehouses",
    "description": "Costco price tracker and scraper for Costco.ca and Costco.com: search by keyword, category, product URL, item number or the full catalogue. Prices, sale prices and deal end dates, warehouse stock by postal code, ratings, model numbers, specs, plus every warehouse with hours. No login.",
    "version": "0.1",
    "x-build-id": "eaxQPURzSaNHznxCL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yugenox~costco-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yugenox-costco-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~costco-scraper/runs": {
      "post": {
        "operationId": "runs-sync-yugenox-costco-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~costco-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-yugenox-costco-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": {
          "mode": {
            "title": "📦 What to scrape",
            "enum": [
              "products",
              "warehouses"
            ],
            "type": "string",
            "description": "Products: search results, categories, product pages or the whole catalogue. Warehouses: every Costco warehouse in the country (address, hours, holiday closures, gas station, pharmacy, tire centre and other services), nearest first if you give a postal code.",
            "default": "products"
          },
          "country": {
            "title": "🌎 Country",
            "enum": [
              "CA",
              "US"
            ],
            "type": "string",
            "description": "Costco Canada (costco.ca, prices in CAD) or Costco USA (costco.com, prices in USD). Costco URLs you paste are always scraped on their own site.",
            "default": "CA"
          },
          "searchTerms": {
            "title": "🔍 Search terms",
            "type": "array",
            "description": "Keywords, exactly as you would type them in Costco's search box. Each term is scraped separately. Terms that Costco sends to a category (for example \"tv\") scrape that category.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "🔗 Costco URLs",
            "type": "array",
            "description": "Category pages (https://www.costco.ca/televisions.html), search pages (https://www.costco.com/s?keyword=olive+oil) and product pages (https://www.costco.ca/p/-/…/4000405951).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "productIds": {
            "title": "🏷️ Item numbers / product ids",
            "type": "array",
            "description": "Costco item numbers (the number on the shelf tag and receipt, e.g. 15071) or product ids (e.g. 4000405951). Great for tracking the price of specific products.",
            "items": {
              "type": "string"
            }
          },
          "fullCatalog": {
            "title": "🗂️ Full catalogue",
            "type": "boolean",
            "description": "Scrape every product Costco lists online for your location (about 11,000 in Canada). Takes a few minutes. Combine with \"Only items on sale\" for a complete deals list.",
            "default": false
          },
          "postalCode": {
            "title": "📍 Postal / ZIP code",
            "type": "string",
            "description": "Your location. Costco's online assortment, delivery prices and stock depend on it, and the nearest warehouse is used for in-warehouse stock. Leave empty for downtown Toronto (M5V 3L9) or Seattle (98101). In Warehouses mode, sorts warehouses by distance."
          },
          "warehouseId": {
            "title": "🏬 Warehouse number",
            "type": "string",
            "description": "Check stock at a specific warehouse instead of the one nearest your postal code (e.g. 1316 = Thorncliffe Park, Toronto). Run the Warehouses mode to list every number."
          },
          "sortBy": {
            "title": "↕️ Sort by",
            "enum": [
              "relevance",
              "price_asc",
              "price_desc",
              "rating",
              "newest"
            ],
            "type": "string",
            "description": "Order of results within each search / category. Price sorting applies to everything matching the search, so broad keywords can surface loosely related cheap items first.",
            "default": "relevance"
          },
          "maxItems": {
            "title": "🔢 Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of rows for the whole run. Leave empty for no limit."
          },
          "maxItemsPerQuery": {
            "title": "🔢 Max results per search / category",
            "minimum": 1,
            "type": "integer",
            "description": "Cap for each search term, category or URL. Leave empty for no per-input limit."
          },
          "onSaleOnly": {
            "title": "💸 Only items on sale",
            "type": "boolean",
            "description": "Keep only products that currently have a discount (instant savings / manufacturer's savings).",
            "default": false
          },
          "includeDetails": {
            "title": "📝 Include full product details",
            "type": "boolean",
            "description": "Add the full description, feature list, specifications table, delivery note, department and variants (sizes / colours with their item numbers) to every product.",
            "default": false
          },
          "maxConcurrency": {
            "title": "⚡ Max concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Parallel requests. The default is fast and gentle; raise it for big catalogue crawls.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "🛡️ Proxy configuration",
            "type": "object",
            "description": "Apify Proxy is required. Datacenter proxies work and are the cheapest; the scraper switches to residential automatically if needed.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}