# Costco Scraper API - Warehouse Prices & Deals (`sunny_eternity/costco-scraper`) Actor

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.

- **URL**: https://apify.com/sunny_eternity/costco-scraper.md
- **Developed by:** [JChaw](https://apify.com/sunny_eternity) (community)
- **Categories:** Automation, Integrations, E-commerce
- **Features:** Limited permissions
- **Stats:** 33 total users, 12 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Costco Scraper API - Warehouse Prices & Deals

> **Need prices compared across Loblaws, Save-On-Foods, T\&T & more in one call?**
>
> → [Canadian Grocery Price Comparison API](https://apify.com/sunny_eternity/canada-grocery-price-comparison)

### What it does

Costco price and product data from [Costco Canada](https://www.costco.ca) and [Costco US](https://www.costco.com), priced at the warehouse you pick.

The Costco Scraper API returns prices, discounts, promotional windows, derived unit prices and warehouse item numbers, with no membership, no login and no browser.

- **Storefronts:** costco.ca in CAD, costco.com in USD
- **Every row:** name, brand, price, was-price, sale flag, promotion text and dates, derived unit price, package size, image, product URL, item number, availability, rating, warehouse details
- **Catalogue:** 43 selectable entries, from a single subcategory up to all ~11,000 products
- **Setup:** no membership, no login, no API key

Costco's assortment differs by province, so a BC run and an Ontario run return different products for the same query.

### Run it

Paste this into the **Input** tab (switch to JSON view) and hit **Start**:

```json
{
  "site": "CABC",
  "categories": ["grocery-household"],
  "postal_code": "V6B 1V4",
  "max_items": 1000
}
```

Rows stream into **Output** as they arrive. Download from **Storage → Dataset** as JSON, CSV or Excel.

Three things to change from there:

- **Take the whole catalogue** with `"categories": ["all"]` and `"max_items": 0`
- **Keep only discounts** with `"on_sale_only": true`
- **Scrape Costco US** by swapping `site` to `USBC` and giving `latitude` and `longitude` instead of a postal code

Selecting a department also scrapes everything nested beneath it.

#### From the API

Grab a token at [console.apify.com/settings/integrations](https://console.apify.com/settings/integrations):

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/sunny_eternity~costco-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"site": "CABC", "categories": ["grocery-household"], "postal_code": "V6B 1V4", "max_items": 100}'
```

- `run-sync-get-dataset-items` suits small runs and can time out on large ones
- For scheduled or full-catalogue scrapes, POST to `/runs` and read the returned `defaultDatasetId`
- Official [JavaScript](https://docs.apify.com/api/client/js) and [Python](https://docs.apify.com/api/client/python) clients work too

### What you get back

```json
{
  "store": "Costco",
  "currency": "CAD",
  "category": "grocery-household",
  "name": "Ruffles Potato Chips Variety Pack, 36 × 28 g",
  "brand": "Ruffles",
  "price": 17.49,
  "was_price": 20.99,
  "is_on_sale": true,
  "multi_buy_deal": "$3.50 OFF",
  "promotion_text": "$3.50 OFF",
  "promotion_validity": "Valid for orders placed 08/03/26 to 08/30/26.",
  "unit_price": "1008g, $1.74/100g",
  "comparable_unit_price": 1.74,
  "package_size": "1008g",
  "parsed_package_size": { "size": 1008, "unit": "g" },
  "parsed_unit_price": { "value": 1.74, "quantity": 100, "unit": "g", "unit_type": "weight" },
  "selling_type": "by_weight",
  "image_url": "https://bfasset.costco-static.com/.../4160094-894__1?auto=webp&format=jpg",
  "product_url": "https://www.costco.ca/p/-/ruffles-potato-chips-variety-pack-36-x-28-g/4000363385",
  "product_id": "4000363385",
  "item_number": "4160094",
  "availability": "IN_STOCK",
  "member_only": false,
  "rating": 4.3,
  "rating_count": 128,
  "location": "552",
  "location_name": "Vancouver BC",
  "location_postal_code": "V6B 1V4",
  "location_coordinates": { "lat": 49.278, "lng": -123.11 }
}
```

| Field | What it holds |
| --- | --- |
| `name`, `brand` | Product title and brand |
| `price`, `was_price`, `is_on_sale` | Current price, original price, discount flag |
| `multi_buy_deal`, `promotion_text`, `promotion_validity` | Costco's own promotional wording and its dates |
| `unit_price`, `comparable_unit_price` | Derived per-100 g, per-100 ml or per-unit pricing |
| `package_size`, `parsed_package_size`, `normalized_package_size` | Package size, parsed and normalized |
| `selling_type` | `by_weight` or `by_unit` |
| `image_url`, `product_url` | Product image and page link |
| `product_id`, `item_number` | Catalogue ID and the warehouse item number from the shelf tag |
| `availability`, `member_only` | Stock status and membership restriction |
| `rating`, `rating_count` | Customer rating and review count |
| `location`, `location_name`, `location_postal_code`, `location_coordinates` | The resolved warehouse |
| `store`, `currency`, `category` | Storefront, currency, and the category scraped |

Export as JSON, CSV or Excel, pull it through the Apify API, schedule recurring runs, or push it into Zapier, Make, Google Sheets and Airbyte.

### Why this Actor

- **705 runs across the suite in the last 30 days, none ended in a failed state.** Run stats are public on the Apify API; figures from August 2026.
- Supplies **unit prices Costco does not publish.** Costco exposes no unit price and no package-size field, so the Actor derives both from the product title, which Costco consistently suffixes with the size (`", 1 kg"`, `"36 × 28 g"`, `"21-pack"`).
- **Collapses multipacks to total contents**, so `36 × 28 g` becomes `1008 g` priced per 100 g. That puts Costco's bulk formats on the same footing as an ordinary supermarket pack.
- Leaves `package_size` and `comparable_unit_price` as **`null` where a title carries no parseable size**, such as gift cards, furniture and apparel, which keeps a bad number out of your comparison.
- **Never reports an empty run as a success.** Costco's catalogue API answers with zero results when no location is supplied, and reports success while doing it. This Actor checks for a location up front and stops with a clear message.
- Takes **no membership, no login and no browser.** It works over plain HTTP, and its only runtime dependency is the Apify SDK.
- Accepts **raw Costco URLs**: paste a product, category or search link and the Actor works out what to do with each one.
- Covers **both storefronts** from one input shape and one output schema.

### What people build with it

- **Bulk vs. supermarket price studies**, using derived per-100 g pricing to compare a Costco multipack against a regular pack
- **Deal trackers** built on `is_on_sale`, `was_price`, `promotion_text` and `promotion_validity`
- **Regional assortment research**, comparing what a BC warehouse stocks against Ontario or a US state
- **CPG monitoring** of a brand's Costco price, item number and rating over time
- **AI shopping agents** that need grounded warehouse-club prices
- **Product databases** keyed by `item_number`, the number printed on the shelf tag

### Input

| Field | Type | Description |
| --- | --- | --- |
| `site` | string | `CABC` (costco.ca, CAD) or `USBC` (costco.com, USD). Default `CABC` |
| `categories` | string\[] | Department, subcategory or curated-list slugs; `all` for the entire catalogue |
| `startUrls` | string\[] | Raw costco.ca or costco.com product, category or search URLs |
| `search_terms` | string\[] | Keyword queries; combined with `categories` they filter by name instead |
| `postal_code` | string | Resolves the nearest warehouse and sets the pricing region. Required, see below |
| `warehouseId` | string | A specific warehouse number. Requires `postal_code` as well |
| `shipToState` | string | Override the province or state code (`BC`, `ON`, `WA`, and so on) |
| `latitude`, `longitude` | string | Resolve the warehouse from coordinates; this is how you select a US warehouse |
| `on_sale_only` | boolean | Keep only discounted products. Default `false` |
| `max_items` | integer | Stop after N products; `0` means no limit. Default `1000`. Capped at 100 on the free Apify plan |

The 43 category entries cover `all`, departments, subcategories and Costco's curated lists such as New Items, Treasure Hunt and Offers Ending Sunday.

**Free Apify plan:** each run stops at 100 results, whatever `max_items` says. Paid Apify plans have no cap, so the full-catalogue runs below need one.

#### A location is required

Costco's catalogue API answers with an empty catalogue when no location is supplied, so the Actor requires one of:

- `postal_code`, geocoded automatically for Canadian postal codes (`site: "CABC"`)
- `latitude` and `longitude`, which work for both countries and are how you pick a US warehouse
- `warehouseId`, supplied together with `postal_code`

#### Examples

Discounted grocery items only:

```json
{ "site": "CABC", "categories": ["grocery-household"], "postal_code": "M5H 2N2", "on_sale_only": true }
```

A single product from its URL:

```json
{ "site": "CABC", "postal_code": "V6B 1V4", "startUrls": ["https://www.costco.ca/p/-/scotties-premium-facial-tissue-21-pack/4000376464"] }
```

Costco US, warehouse resolved from coordinates:

```json
{ "site": "USBC", "latitude": "47.6062", "longitude": "-122.3321", "search_terms": ["olive oil"] }
```

The entire Costco Canada catalogue, roughly 11,000 products:

```json
{ "site": "CABC", "categories": ["all"], "postal_code": "V6B 1V4", "max_items": 0 }
```

### FAQ

**How do I scrape Costco prices?** Give a `postal_code` (or `latitude` and `longitude`) plus either `categories`, `search_terms` or `startUrls`. The [Run it](#run-it) input above is a working example.

**Do I need a Costco membership?** No. The Actor reads Costco's public catalogue, which takes no account, no membership and no login.

**Does it return warehouse-specific prices?** It returns prices for the region the warehouse sits in. Costco varies price and assortment at the province and state level, so two warehouses in the same province generally return the same catalogue.

**Can I scrape Costco US?** Yes. Set `"site": "USBC"` and supply `latitude` and `longitude`, which is the supported way to select a US warehouse. Prices come back in USD.

**Where does the unit price come from?** Costco publishes none, so the Actor derives it from the product title, which Costco suffixes with the size. Multipacks are collapsed to total contents, so `36 × 28 g` becomes `1008 g` priced per 100 g.

**Why is `comparable_unit_price` null on some rows?** Titles with no parseable size, such as gift cards, furniture and apparel, return `null` rather than a guessed number.

**Is there an official Costco API?** No. Costco publishes no public product or pricing API.

**How many products are in the full catalogue?** Costco Canada runs to roughly 11,000 products with `categories: ["all"]` and `max_items: 0`.

**How do I track prices over time?** Schedule the Actor daily or weekly in Apify, keep each run's dataset, and compare `price` per `item_number`. The Actor returns current prices and stores no history itself.

**Is scraping Costco legal?** Scraping publicly available product and price information is generally legal. Complying with Costco's terms of service and the law in your jurisdiction remains your responsibility, so keep request volume reasonable.

### Canadian grocery Actors

| Actor | Chains | Coverage |
| --- | --- | --- |
| [Canadian Grocery Price Comparison API](https://apify.com/sunny_eternity/canada-grocery-price-comparison) | 16, matched and ranked in one run | Nationwide |
| [Loblaws, No Frills, Superstore & Maxi Scraper API - Canada](https://apify.com/sunny_eternity/loblaws-grocery-scraper) | 12 Loblaw banners | Every province, YT, NT |
| [Save-On-Foods, PriceSmart & Urban Fare Scraper API - Canada](https://apify.com/sunny_eternity/save-on-foods-pricesmart-scraper) | 4 Pattison Food Group banners | BC, AB, SK, MB |
| [T\&T Asian Supermarket Grocery Price Scraper API - Canada](https://apify.com/sunny_eternity/tnt-grocery-scraper) | T\&T | BC, AB, ON, QC |
| **Costco Scraper API - Warehouse Prices & Deals** (this Actor) | Costco warehouses | Canada and US |

All four retailer Actors emit the same 21 core fields, among them `name`, `price`, `was_price`, `is_on_sale`, `unit_price`, `comparable_unit_price`, `package_size`, `selling_type` and the `location` set. Their datasets concatenate without a mapping layer. Chain-specific extras such as `item_number` sit alongside those fields.

### Feedback

Found a bug or have technical feedback? Open an issue on the Actor's Issues tab.

# Actor input Schema

## `site` (type: `string`):

Which Costco storefront to scrape. Prices and assortment differ between them.

## `categories` (type: `array`):

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.

## `startUrls` (type: `array`):

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.

## `search_terms` (type: `array`):

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.

## `postal_code` (type: `string`):

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` (type: `string`):

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` (type: `string`):

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` (type: `string`):

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` (type: `string`):

Longitude to search for the nearest warehouse from, e.g. '-122.3321'. Use together with latitude.

## `on_sale_only` (type: `boolean`):

Keep only products flagged as on sale — those with a struck-through original price, an active promotion, or a discount badge.

## `max_items` (type: `integer`):

Stop after this many products. Set to 0 for no limit — the full Costco Canada catalog is roughly 11,000 products. On the free Apify plan, runs stop at 100 products whatever this is set to.

## Actor input object example

```json
{
  "site": "CABC",
  "postal_code": "V6B 1V4",
  "on_sale_only": false,
  "max_items": 1000
}
```

# Actor output Schema

## `products` (type: `string`):

Complete dataset of scraped products including names, prices, discounts, images, item numbers, package sizes and derived unit pricing

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "postal_code": "V6B 1V4"
};

// Run the Actor and wait for it to finish
const run = await client.actor("sunny_eternity/costco-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "postal_code": "V6B 1V4" }

# Run the Actor and wait for it to finish
run = client.actor("sunny_eternity/costco-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "postal_code": "V6B 1V4"
}' |
apify call sunny_eternity/costco-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sunny_eternity/costco-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/r3CryUP8qWOcc7f2i/builds/eeozb8ph5lU0NUgfh/openapi.json
