# Costco — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and browse Costco's complete product catalog, retrieve detailed product information and member reviews, check current savings and promotions, and find nearby warehouse locations — all through a single API.

**Category:** E-commerce | **Website:** [costco.com/](https://costco.com/) | **Docs:** [parse.bot/marketplace/8fb92be2-2257-46fb-a922-8ea4015f1bb2/costco-com-api](https://parse.bot/marketplace/8fb92be2-2257-46fb-a922-8ea4015f1bb2/costco-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_category_listing

Browse products within a specific category path. Returns paginated product listings for a given category URL path.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_path` | string | Yes | Category URL path (e.g., '/televisions.html', '/laptops.html', '/grocery-household.html') |
| `rows` | integer | No | Number of results per page |
| `start` | integer | No | Pagination offset (0-based) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/get_category_listing \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_path":"<string>","rows":"<integer>","start":"<integer>"}'
```

### get_gold_and_precious_metals

Search specifically for gold bars, silver coins, and precious metals available on Costco.com.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `rows` | integer | No | Number of results per page |
| `start` | integer | No | Pagination offset (0-based) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/get_gold_and_precious_metals \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rows":"<integer>","start":"<integer>"}'
```

### get_pharmacy_medications

Browse vitamins, supplements, and health products available on Costco.com. Searches the health and pharmacy product categories.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | No | Search keyword for health/pharmacy products (e.g., 'vitamin', 'supplement', 'probiotic') |
| `rows` | integer | No | Number of results per page |
| `start` | integer | No | Pagination offset (0-based) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/get_pharmacy_medications \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","rows":"<integer>","start":"<integer>"}'
```

### get_product_details

Get detailed product information including price, descriptions, attributes, and ratings via GraphQL. Accepts one or more item numbers from search results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `item_numbers` | string | Yes | Comma-separated item numbers from search results (e.g., '9555677' or '9555677,1943308') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"item_numbers":"<string>"}'
```

### get_product_reviews

Get member reviews for a specific product. Uses the Costco catalog product ID (group_id from search results), not the item_number.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of reviews per page |
| `offset` | integer | No | Pagination offset |
| `product_id` | string | Yes | Costco catalog product ID (group_id from search results, e.g., '4000362984') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/get_product_reviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>","product_id":"<string>"}'
```

### get_savings_deals

Retrieve current savings and promotional offers. Returns products with active discounts and deals.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `rows` | integer | No | Number of results per page |
| `start` | integer | No | Pagination offset (0-based) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/get_savings_deals \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rows":"<integer>","start":"<integer>"}'
```

### get_warehouse_locations

Find Costco warehouse locations near a specific latitude and longitude. Returns store details including address, hours, services, and distance.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `latitude` | string | No | Latitude coordinate |
| `limit` | integer | No | Maximum number of locations to return |
| `longitude` | string | No | Longitude coordinate |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/get_warehouse_locations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"latitude":"<string>","limit":"<integer>","longitude":"<string>"}'
```

### search_products

Search for products by keyword with pagination and sorting. Returns product listings with pricing, ratings, images, and availability information.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (e.g., 'television', 'organic coffee') |
| `rows` | integer | No | Number of results per page |
| `sort_by` | string | No | Sort order: price_low_high, price_high_low, top_rated, best_match |
| `start` | integer | No | Pagination offset (0-based) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-costco-com-api-8fb92be2/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","rows":"<integer>","sort_by":"<string>","start":"<integer>"}'
```
