# Costco Mexico Scraper & API - Products, Prices & Promotions (`latinamericadata/costco-mexico`) Actor

Extract Costco Mexico products, MXN prices, promotions, item numbers, ratings and availability signals. Monitor retail prices and bulk-pack assortments. Export JSON, CSV or Excel, or automate with the Apify API.

- **URL**: https://apify.com/latinamericadata/costco-mexico.md
- **Developed by:** [Latin America Data](https://apify.com/latinamericadata) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 products

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Mexico Scraper & API

Extract **Costco Mexico products, prices in MXN, promotions, item numbers, ratings and availability signals** for competitor price monitoring, wholesale-club comparisons and assortment research. Search groceries, electronics, appliances and household products, then export JSON, CSV or Excel or automate through the Apify API.

Independent tool by Latin America Data. Not affiliated with or endorsed by Costco. This is an Apify-powered product scraper, not an official Costco API.

### Quick start

```json
{"term":"leche","maxItems":3,"maxRuntimeSecs":120}
```

Multiple searches without a product or page limit:

```json
{"searchTerms":["leche","cafe"],"maxRuntimeSecs":600}
```

Leave `maxItems` and `maxPages` blank to follow all pages offered by the source. The default 240-second time budget and your Apify spending limit still apply. Results are delivered page by page and deduplicated across searches. Proxy recovery is automatic and needs no customer setup.

### Business uses

- Monitor advertised prices and promotions through scheduled runs.
- Compare Costco and Sam's Club product assortments and original pack descriptions.
- Research item numbers, product descriptions, public stock signals and shipping restrictions.
- Build your own timestamped price history for retail, distribution or purchasing reports.

Para equipos de retail en Mexico: extrae productos, precios y ofertas de Costco para comparar catalogos, analizar surtidos y monitorear cambios de precio.

### Inputs

| Input | Purpose |
| --- | --- |
| `term` | Product, brand or category keywords; defaults to `leche`. |
| `searchTerms` | Optional 1-100 searches, replacing `term`. |
| `maxItems` | Optional total maximum of unique products. |
| `maxPages` | Optional page maximum per search. |
| `startPage` | First page, starting at 1; the source's zero-based page is converted automatically. |
| `maxRuntimeSecs` | Run time budget: default 240, maximum 7200 seconds. |
| `requestTimeoutSecs` | Request timeout: default 30, maximum 90 seconds. |

Results follow the public catalog search API's relevance ordering. Broad source searches may include related products, so a category keyword does not mean every returned item belongs to that category. This version has no postal-code or warehouse selector.

### Product output

Each row includes `product_id` (Costco item number), `title`, `brand`, `description`, `price`, `list_price`, `currency`, `price_hidden`, `price_status`, `price_scope`, `promotions`, `available`, `availability`, `availability_scope`, `purchasable`, `location_available`, `membership_restricted`, `shipping_restricted`, `shipping_included`, `pickup_available`, `rating`, `review_count`, `image_url` and `source_url`.

Audit fields include `search_term`, `search_url`, `page`, `rank`, `scraped_at`, `source`, `country` and `status`. Optional fields are null when not published. Item numbers are source identifiers, not assumed EAN barcodes. Pack quantities and per-unit prices are not inferred from titles.

#### Prices and availability

Prices are the published online MXN amounts for the product or pack. `list_price` is returned only when the source base price is higher than the current price. Promotions are retained as published text; card and membership offers are not automatically deducted.

If Costco explicitly hides a price, `price` is null, `price_hidden` is true and `price_status` is `hidden_by_source`. The actor does not reveal hidden prices. A product that the source marks non-purchasable or out of stock can have `price: null` and `price_status: "unavailable"`. Missing prices on otherwise purchasable listings are checked against the public product detail before delivery. These valid catalog products remain billable; prices are never fabricated as zero.

`available` summarizes the public purchasability and stock signals. `availability` retains the source stock status. `location_available` and restrictions are reported separately because selecting a postal code, warehouse or membership can change checkout conditions. This actor does not promise local inventory or member-specific checkout prices.

### Pricing

**USD 0.004 per delivered unique product**, plus **Apify platform usage paid by the customer**, including compute, storage, transfer and proxies when needed. 1,000 products cost USD 4.00 in product fees plus usage.

Duplicates are charged once per run. Empty searches, blocks and diagnostic records have no product fee. Platform usage still applies. Use the Apify spending limit to control result charges and consult platform limits for usage.

### Completion and errors

`RUN_SUMMARY` records completeness, delivered and charged counts, pages, stopping reason and free performance measurements. `DIAGNOSTICS` contains explanations outside the product dataset.

- `success`: products were delivered; inspect `complete` and `stop_reason` for limits.
- `no_results`: an explicitly empty source search with zero product charges.
- `partial`: earlier products remain available after a later error or time/spending limit.
- `blocked` or `failed`: no products could be delivered, and the run fails visibly.

The actor uses the public Costco Mexico catalog search contract, validates query and page metadata, and uses the original product URLs. Repeated non-terminal pages are reported as incomplete. Source totals can change during a run. No extra data sources or substitute products are used to manufacture results.

### API, exports and schedules

Use the Apify API tab for runnable requests. Download JSON, CSV or Excel from the dataset, or schedule repeat searches to build your own historical records. The actor returns current observations, not historical prices from before your runs.

Source: [Costco Mexico](https://www.costco.com.mx/). This tool does not log in, access member accounts, purchase products or collect customer information.

# Actor input Schema

## `term` (type: `string`):

Product, brand or category keywords.

## `searchTerms` (type: `array`):

Optional 1-100 searches, replacing Search term. Products are deduplicated across terms.

## `maxItems` (type: `integer`):

Optional total product limit. Leave blank for all source results within the time and spending budget.

## `maxPages` (type: `integer`):

Optional page limit. Leave blank to follow all available pages.

## `startPage` (type: `integer`):

First source page to collect.

## `maxRuntimeSecs` (type: `integer`):

Safety time budget, independent of the result count.

## `requestTimeoutSecs` (type: `integer`):

Maximum time per source request.

## Actor input object example

```json
{
  "term": "leche",
  "startPage": 1,
  "maxRuntimeSecs": 240,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

## `diagnostics` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("latinamericadata/costco-mexico").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("latinamericadata/costco-mexico").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 '{}' |
apify call latinamericadata/costco-mexico --silent --output-dataset

```

## MCP server setup

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

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/oecAwSyl2X1BWjdws/builds/lt8eQ7ztvvW2RnEV2/openapi.json
