{
  "openapi": "3.0.1",
  "info": {
    "title": "Costco Scraper API - Warehouse Prices, Deals & Product Data",
    "description": "Extract Costco prices and product data from costco.ca and costco.com — sale prices, discounts, package sizes, normalized unit pricing, images and item numbers. Pick a warehouse by postal code for regional pricing. Browse any department, paste product URLs, or search. Export as JSON, CSV or Excel.",
    "version": "1.0",
    "x-build-id": "AfMTnMjruEBhTRGQ8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sunny_eternity~costco-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sunny_eternity-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/sunny_eternity~costco-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sunny_eternity-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/sunny_eternity~costco-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sunny_eternity-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": {
          "site": {
            "title": "Storefront",
            "enum": [
              "CABC",
              "USBC"
            ],
            "type": "string",
            "description": "Which Costco storefront to scrape. Prices and assortment differ between them.",
            "default": "CABC"
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Select departments (📁), specific subcategories (└), or curated lists (⭐). Selecting a department also scrapes everything nested beneath it, so there is no need to add its subcategories as well. Choose 'All Categories' for the entire catalog.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "grocery-household",
                "snacks",
                "baking-packaged-food",
                "water-beverages",
                "coffee-tea",
                "meat",
                "produce",
                "dairy",
                "cheese",
                "frozen-food",
                "bakery-desserts",
                "seasoning-sauces",
                "canned-food",
                "international-foods",
                "organic",
                "gluten-free",
                "vegan-foods",
                "household",
                "paper-plastic-products",
                "household-cleaning",
                "laundry-detergent",
                "kirkland-signature-products",
                "appliances",
                "auto",
                "baby-kids",
                "clothing-handbags",
                "computers",
                "electronics",
                "furniture",
                "gift-cards-tickets-floral",
                "hardware",
                "health-beauty",
                "home-and-decor",
                "jewellery-fashion",
                "office-products",
                "patio-lawn-garden",
                "pet-supplies",
                "sports-fitness",
                "toys-games",
                "whats-new",
                "treasure-hunt",
                "offers-ending"
              ],
              "enumTitles": [
                "All Categories (entire catalog)",
                "📁 Grocery & Household",
                "  └ Snacks, Candy & Nuts",
                "  └ Pantry & Dry Goods",
                "  └ Water & Beverages",
                "  └ Coffee",
                "  └ Meat & Seafood",
                "  └ Produce",
                "  └ Dairy",
                "  └ Cheese",
                "  └ Frozen Food",
                "  └ Bakery",
                "  └ Spices, Seasoning & Sauces",
                "  └ Canned & Jarred Foods",
                "  └ International Foods",
                "  └ Organic",
                "  └ Gluten-Free",
                "  └ Vegan Foods",
                "  └ Household Products",
                "  └ Paper & Plastic Products",
                "  └ Cleaning Supplies",
                "  └ Laundry Detergent & Supplies",
                "  └ Kirkland Signature",
                "📁 Appliances",
                "📁 Automotive & Tires",
                "📁 Baby",
                "📁 Clothing, Luggage & Handbags",
                "📁 Computers",
                "📁 Electronics",
                "📁 Furniture & Mattresses",
                "📁 Floral & Gift Baskets",
                "📁 Home Improvement",
                "📁 Health & Beauty",
                "📁 Home & Kitchen",
                "📁 Jewellery, Watches & Sunglasses",
                "📁 Office Products",
                "📁 Patio, Lawn & Garden",
                "📁 Pet Supplies",
                "📁 Sports & Fitness",
                "📁 Toys",
                "⭐ New Items",
                "⭐ Treasure Hunt",
                "⭐ Offers Ending Sunday"
              ]
            }
          },
          "startUrls": {
            "title": "Costco URLs (optional)",
            "type": "array",
            "description": "Paste raw costco.ca or costco.com links. Product pages (…/p/…/1234567) are fetched individually, category pages (…/grocery-household.html) are scraped in full, and search pages (…/s?keyword=olive+oil) run as searches. A bare category slug such as 'snacks' also works.",
            "items": {
              "type": "string"
            }
          },
          "search_terms": {
            "title": "Search Terms (optional)",
            "type": "array",
            "description": "Free-text queries such as 'olive oil' or 'organic eggs'. Each runs separately and its rows are tagged with category 'search:<term>'. When categories are also selected, these act as keyword filters on the category results instead.",
            "items": {
              "type": "string"
            }
          },
          "postal_code": {
            "title": "Postal / ZIP Code",
            "type": "string",
            "description": "Resolves the nearest warehouse and sets the pricing region. Costco returns no results without one. Canadian postal codes are geocoded automatically; for the US site supply latitude/longitude, or a ZIP together with warehouseId."
          },
          "warehouseId": {
            "title": "Warehouse Number (optional)",
            "type": "string",
            "description": "Skip the warehouse lookup and use this warehouse number directly (e.g. '552' for Vancouver Expo Blvd). Requires postal_code to be set as well."
          },
          "shipToState": {
            "title": "Province / State (optional)",
            "type": "string",
            "description": "Override the province or state code (e.g. 'BC', 'ON', 'WA'). This is what drives regional pricing and assortment; by default it comes from the resolved warehouse."
          },
          "latitude": {
            "title": "Latitude (optional)",
            "type": "string",
            "description": "Latitude to search for the nearest warehouse from, e.g. '47.6062'. Use together with longitude — this is the supported way to pick a US warehouse."
          },
          "longitude": {
            "title": "Longitude (optional)",
            "type": "string",
            "description": "Longitude to search for the nearest warehouse from, e.g. '-122.3321'. Use together with latitude."
          },
          "on_sale_only": {
            "title": "Only discounted products",
            "type": "boolean",
            "description": "Keep only products flagged as on sale — those with a struck-through original price, an active promotion, or a discount badge.",
            "default": false
          },
          "max_items": {
            "title": "Maximum products",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many products. Set to 0 for no limit — the full Costco Canada catalog is roughly 11,000 products.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}