{
  "openapi": "3.0.1",
  "info": {
    "title": "Costco Stock Checker & API: Warehouse Inventory & Prices",
    "description": "Costco stock checker and API: in stock, low stock or out of stock at every Costco warehouse near a ZIP or postal code (US and Canada), with the warehouse price, online price and online stock. Search, item numbers, Pokemon restock and price drop alerts.",
    "version": "0.1",
    "x-build-id": "aYZkWoALFpjD6c5T1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/s_actors~costco-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-s_actors-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/s_actors~costco-scraper/runs": {
      "post": {
        "operationId": "runs-sync-s_actors-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/s_actors~costco-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-s_actors-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 do",
            "enum": [
              "search",
              "products"
            ],
            "type": "string",
            "description": "Search: keywords, every product Costco sells in its warehouses with its stock and price at your warehouses. Check products: exact products by link or item number (best for a back-in-stock watchlist).",
            "default": "search"
          },
          "keywords": {
            "title": "🔎 Keywords",
            "type": "array",
            "description": "Search mode: what to search on Costco, one per line (e.g. \"pokemon\", \"pokemon cards\", \"kirkland olive oil\", \"ninja air fryer\", \"tv\"). Only products sold in warehouses are checked (online-only products have no warehouse stock).",
            "items": {
              "type": "string"
            }
          },
          "products": {
            "title": "🏷️ Product links or item numbers",
            "type": "array",
            "description": "Check products mode: costco.com or costco.ca product links (…/p/-/name/4000446166), item numbers from the shelf tag or receipt (e.g. 1511996) or product ids, one per line.",
            "items": {
              "type": "string"
            }
          },
          "locations": {
            "title": "📍 ZIP codes, postal codes or cities",
            "type": "array",
            "description": "Where to check, one per line: a US ZIP code (\"98101\"), a Canadian postal code (\"M5V 2T6\" or \"M5V\"), a city with a Costco (\"Seattle, WA\", \"Toronto\") or \"latitude, longitude\". The nearest Costco warehouses within \"Radius\" are checked (up to \"Warehouses per location\"). The first ZIP also gives the online price and online stock. One country per run: Costco US and Costco Canada have different catalogs.",
            "items": {
              "type": "string"
            }
          },
          "warehouses": {
            "title": "🏬 Warehouse numbers or names",
            "type": "array",
            "description": "Exact Costco warehouses to check, one per line: the warehouse number (e.g. \"129\", in the \"warehouseId\" column of any run) or its name as on costco.com (e.g. \"Santa Clara\", \"Seattle\").",
            "items": {
              "type": "string"
            }
          },
          "radius": {
            "title": "📏 Radius (miles)",
            "minimum": 1,
            "maximum": 3000,
            "type": "integer",
            "description": "How far from each location to look for warehouses.",
            "default": 50
          },
          "maxWarehousesPerLocation": {
            "title": "🔢 Warehouses per location",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "For each ZIP code, postal code or city: how many of the nearest warehouses to check.",
            "default": 5
          },
          "maxProductsPerSearch": {
            "title": "🔢 Max products per search",
            "minimum": 1,
            "maximum": 960,
            "type": "integer",
            "description": "Search mode: how many warehouse products to take from each keyword, in Costco's order.",
            "default": 48
          },
          "onlyMatchingProducts": {
            "title": "🎯 Only products matching the keywords",
            "type": "boolean",
            "description": "Costco's search also returns loosely related products (\"pokemon\" brings Star Wars and Topps cards). On: keep only products whose name, brand or category contains every word of the keyword. Broad words that Costco opens as a category page (e.g. \"tv\") are not filtered.",
            "default": true
          },
          "includeOnlineOnly": {
            "title": "🌐 Include online-only products",
            "type": "boolean",
            "description": "Costco sells many products online only (no warehouse stock): they are skipped by default. Tick to get them too, with the online price and online stock (\"Not carried\" at warehouses).",
            "default": false
          },
          "onlyInStock": {
            "title": "✅ Only in stock",
            "type": "boolean",
            "description": "Return only rows where the warehouse has the product now (in stock or low stock).",
            "default": false
          },
          "maxPrice": {
            "title": "💲 Maximum price",
            "minimum": 0,
            "type": "integer",
            "description": "Return only products at or below this price (USD or CAD, the warehouse price). Empty = any price."
          },
          "onlyChanges": {
            "title": "🔔 Only report changes",
            "type": "boolean",
            "description": "For scheduled runs. The first run saves the stock and prices; later runs return only what changed: back in stock at a warehouse, restocked (low stock to in stock), low stock, sold out, warehouse price drops and increases (handy for Costco price adjustments), and new products or warehouses in your searches (e.g. a new Pokemon set). Each row also carries the restocks this monitor has seen and the usual restock weekday. You pay only for the changes returned.",
            "default": false
          },
          "monitorName": {
            "title": "🏷️ Monitor name",
            "type": "string",
            "description": "Separate monitors keep separate memory. Use a different name for each scheduled task.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}