# Costco Scraper (`newpo/costco-scraper`) Actor

Scrapes Costco Products

- **URL**: https://apify.com/newpo/costco-scraper.md
- **Developed by:** [newpo](https://apify.com/newpo) (community)
- **Categories:** E-commerce
- **Stats:** 88 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$40.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Costco Scraper

This actor scrapes products on Costco. Data points include

- Product Name
- Specs
- Descriptions
- Images
- Services and Warranty
- and more (see output example)!

### Input Parameters
- URLs
Use any product listing pages or search pages e.g. https://www.costco.com/televisions.html
- maxPages
Number of pages you'd like to scrape.

### Data Output
A dataset will be created from each run (go to `Storage` on the sidebar). It looks like `costco-details-1676441778724`. The trailing numbers are the unix timestamp the actor started.

### How much does it cost to scrape Costco?
I haven't tested it yet but it uses minimal resources so I'd say 10,000 products for around $1~$2. I'll update this once I have more accurate data. 

### Sample Output

```json
[{
  "product": [
    {
      "pricePerUnit": "",
      "unitOfMeasure": "Price Per :",
      "catentry": "2887933",
      "isScheduledDeliverable": "false",
      "limitOneQuantity": false,
      "priceInCartOnly": false,
      "isSinglePriced": true,
      "membershipRequired": false,
      "isGroceryItem": false,
      "isDependentProductConfigured": false,
      "isComingSoon": false
    }
  ],
  "products": [
    [
      {
        "isLocInvItem": "true",
        "pricePerUnit": "",
        "unitOfMeasure": "Price Per :",
        "unpriced": false,
        "single": true,
        "catentry": "2887934",
        "partNumber": "9755800",
        "programType": "3rdPartyDelivery,LocationControlledInventory,InWarehouse,WarehouseDelivery,Standard",
        "manufacturerPartNumber": "9755800 ",
        "defaultShipModeId": "32651",
        "vendorModelNumber": "",
        "price": "",
        "productName": "LG 55&#034; Class - UQ8000 Series - 4K UHD LED LCD TV",
        "productUrl": "https://www.costco.com/lg-55%22-class---uq8000-series---4k-uhd-led-lcd-tv.product.9755800.html",
        "listPrice": "LTEuMA==",
        "date": "",
        "date2": "",
        "type": "0",
        "message": "0",
        "zipcodeAvailabilityMessage": "0",
        "zipcodeAvailabilityResponseCode": "success",
        "inventory": "IN_STOCK",
        "minQty": "1",
        "maxQty": "3",
        "ordinal": "4794.0",
        "itemSequence": "",
        "img_url": "https://images.costco-static.com/ImageDelivery/imageService?profileId=12026540&amp;imageId=9755800-847__1&amp;recipeName=300",
        "plainPackaging": "2",
        "eddVendorName": "EDD:Calendar",
        "liveEDD": "true",
        "options": [],
        "itemLimitOneQty": "false",
        "isDependentProductConfigured": "false",
        "feeRegions": [],
        "feeOptions": [],
        "regionPrices": []
      }
    ]
  ],
  "options": [
    []
  ],
  "partNumber": "100970919",
  "id": "100970919",
  "vsku": "100970919",
  "psku": "9755800",
  "name": "LG 55\" Class - UQ8000 Series - 4K UHD LED LCD TV",
  "price": "",
  "priceMin": "369.99",
  "priceMax": "369.99",
  "priceVaries": "true",
  "available": "In stock",
  "categories": [
    "Electronics",
    "TVs",
    "55 inch TVs"
  ],
  "storeid": "US",
  "productId": "100970919",
  "specs": [
    {
      "name": "Brand",
      "value": "LG"
    },
    {
      "name": "Compatible with",
      "value": "Alexa"
    },
    {
      "name": "Compatible with",
      "value": "Apple AirPlay 2"
    },
    {
      "name": "Compatible with",
      "value": "Apple HomeKit"
    },
    {
      "name": "Compatible with",
      "value": "Google Assistant"
    },
    {
      "name": "Dimensions (with stand)",
      "value": "9.1 in. x 30.6 in. x 48.6 in."
    },
    {
      "name": "Dimensions (without stand)",
      "value": "2.3 in. x 28.1 in. x 48.6 in."
    },
    {
      "name": "Display Type",
      "value": "Direct Lit LED-LCD"
    },
    {
      "name": "High Dynamic Range (HDR)",
      "value": "HDR10"
    },
    {
      "name": "High Dynamic Range (HDR)",
      "value": "HLG"
    },
    {
      "name": "Inputs - HDMI 1",
      "value": "HDMI 2.0"
    },
    {
      "name": "Inputs - HDMI 2",
      "value": "HDMI 2.0 eARC"
    },
    {
      "name": "Model",
      "value": "LG 55UQ8000AUB"
    },
    {
      "name": "Motion Technology",
      "value": "TruMotion 120"
    },
    {
      "name": "Native Refresh Rate",
      "value": "60Hz"
    },
    {
      "name": "Number of Digital Optical Audio Inputs",
      "value": "1"
    },
    {
      "name": "Number of HDMI Inputs",
      "value": "2"
    },
    {
      "name": "Number of USB Ports",
      "value": "1"
    },
    {
      "name": "Resolution",
      "value": "3840 x 2160"
    },
    {
      "name": "Screen Size Class",
      "value": "55 in."
    },
    {
      "name": "Screen Type",
      "value": "Flat"
    },
    {
      "name": "Smart TV Platform",
      "value": "webOS"
    },
    {
      "name": "Speaker Output",
      "value": "20 W"
    },
    {
      "name": "VESA Mounting Standard",
      "value": "300x300"
    },
    {
      "name": "Warranty Coverage",
      "value": "2 Years"
    },
    {
      "name": "Weight - with Stand",
      "value": "31.3 lb."
    },
    {
      "name": "Weight - without Stand",
      "value": "30.9 lb."
    },
    {
      "name": "Wireless Standard",
      "value": "802.11ac"
    }
  ],
  "images": [],
  "services": [
    "2nd Year Warranty",
    "Free Technical Support",
    "90 Day Return Policy"
  ],
  "description": {},
  "ratings": {
    "reviewSummary": {
      "numReviews": 2768,
      "primaryRating": {
        "distribution": [
          {
            "key": 5,
            "count": 1936
          },
          {
            "key": 4,
            "count": 464
          },
          {
            "key": 3,
            "count": 137
          },
          {
            "key": 2,
            "count": 67
          },
          {
            "key": 1,
            "count": 164
          }
        ],
        "average": 4.4238,
        "missing": 0,
        "ratingRange": 5
      },
      "recommended": {
        "distribution": [
          {
            "count": 721,
            "key": true
          },
          {
            "count": 175,
            "key": false
          }
        ],
        "missing": 1872
      }
    },
    "questionSummary": {
      "numQuestions": 0,
      "numAnswers": 0
    }
  }
}]
````

# Actor input Schema

## `maxPage` (type: `integer`):

Will only crawl up to x pages

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

URLs to start with.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "maxPage": 2,
  "startUrls": [
    {
      "url": "https://www.costco.com/televisions.html"
    }
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.costco.com/televisions.html"
        }
    ],
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("newpo/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 = {
    "startUrls": [{ "url": "https://www.costco.com/televisions.html" }],
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

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

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.costco.com/televisions.html"
    }
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call newpo/costco-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=newpo/costco-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Costco Scraper",
        "description": "Scrapes Costco Products",
        "version": "0.0",
        "x-build-id": "FsyxxHAvPP4luSLcP"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/newpo~costco-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-newpo-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/newpo~costco-scraper/runs": {
            "post": {
                "operationId": "runs-sync-newpo-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/newpo~costco-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-newpo-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": {
                    "maxPage": {
                        "title": "maxPage",
                        "maximum": 500,
                        "type": "integer",
                        "description": "Will only crawl up to x pages",
                        "default": 2
                    },
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "URLs to start with.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by your crawler."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
