# Instacart Scraper (`tortuga/instacart-scraper`) Actor

Instacart grocery search as JSON: product name, brand, size, price, unit price, availability, retailer, product URL and image for each keyword, from the first retailers near the server. Cross-retailer price checks for milk, eggs or any item. No login.

- **URL**: https://apify.com/tortuga/instacart-scraper.md
- **Developed by:** [Trevor Ortega](https://apify.com/tortuga) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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.
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

## Instacart Scraper

Instacart Scraper searches Instacart by keyword and returns priced grocery products from the first retailers near the server's location: product name, brand, size, price, unit, availability, retailer, product URL and image. Each search term returns about 14 products. No login, no cookies.

It reads Instacart's public cross-retailer search page (`instacart.com/store/s?k=<term>`), the page any visitor sees.

### Location follows the server

Instacart decides which retailers and prices to show from the visitor's location, which it takes from the IP address. This Actor has no ZIP input: the location is whatever the residential US proxy exit IP resolves to, and it can differ between runs. Every row carries the `postalCode` Instacart used, so you can see which area a price belongs to. Treat prices as examples of the local market, not as a fixed-ZIP price index.

### What you get

| Field | Meaning |
|---|---|
| `query` | The search term |
| `retailer`, `retailerSlug`, `retailerId`, `shopId` | Retailer name and ids (the store near the visitor) |
| `productId`, `itemId`, `id` | Product id, Instacart item id, and a unique `shopId:productId` id |
| `name`, `brand`, `size` | Product name, brand, package size |
| `price`, `priceText` | Current price as a number and as shown (for example `$2.99`) |
| `originalPrice` | Price before a discount, when Instacart shows one |
| `pricingUnit`, `pricePerUnit` | Unit the price refers to (for example `1 gal`) and the unit price when shown |
| `available`, `stockLevel` | Availability flag and Instacart's stock level |
| `url`, `imageUrl` | Product page and image |
| `postalCode` | ZIP code Instacart used for this run |

### Input example

```json
{
  "searchTerms": ["milk", "eggs"],
  "maxItems": 20
}
```

### Output example

```json
{
  "query": "milk",
  "retailer": "Fred Meyer",
  "retailerSlug": "fred-meyer",
  "retailerId": "200",
  "shopId": "1933",
  "productId": "17408660",
  "itemId": "items_3103-17408660",
  "name": "Fred Meyer™ Vitamin D Whole Milk Gallon",
  "brand": "fred meyer",
  "size": "1 gal",
  "price": 4.99,
  "priceText": "$4.99",
  "originalPrice": null,
  "pricingUnit": "1 gal",
  "pricePerUnit": null,
  "available": true,
  "stockLevel": "highlyInStock",
  "imageUrl": "https://d2lnr5mha7bycj.cloudfront.net/product-image/file/large_e665d81b-8e6f-4d5c-b324-cf14d9225fd5.jpeg",
  "url": "https://www.instacart.com/products/17408660-whole-milk",
  "postalCode": "98104",
  "id": "1933:17408660"
}
```

### Pricing

| Event | Price |
|---|---|
| Product (one row) | $0.0015 ($1.50 per 1,000), volume tiers 10 to 20 percent lower |

Platform usage, mainly the residential proxy, is billed to you on top (about $0.00016 per product measured on a 5-term run).

### Monitor changes on a schedule

Turn on `onlyNewOrChanged` and schedule a saved task in Apify. The Actor remembers the price and availability of each product and outputs only new products and products whose price or availability changed; unchanged products are not charged. Because the location can change between runs, compare results with the same `postalCode`. Changed rows carry `changeType` and `previousValues`. Use `monitoringKey` to keep several watches separate.

### FAQ

**Can I choose the ZIP code?** No. Instacart takes the location from the IP address and this Actor does not log in or set an address.

**Why only about 14 products per search?** The public search page shows full product data for the first retailers only. Use several, more specific search terms for more coverage.

**Does it need a login?** No.

**Why a residential proxy?** Instacart blocks datacenter IPs. The default is Apify residential proxy in the US.

**Is this legal?** The Actor reads public search pages and returns product and price data only. Check Instacart's terms for your own use.

### Proxy note

Residential US proxy is the default and is billed to your Apify account as platform usage (about 1.6 MB per search term).

# Actor input Schema

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

Grocery products to search for, for example milk or organic eggs. Each term returns about 14 priced products from the first retailers near the server's location.

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

Stop after this many products across all terms. Each term yields about 14.

## `onlyNewOrChanged` (type: `boolean`):

Remember what earlier runs of this search returned and output only new items or items whose price/status changed. Use with a Schedule; unchanged items are not charged.

## `monitoringKey` (type: `string`):

Name for this watch, so several schedules on the same search stay separate; defaults to a key derived from the search input.

## `proxyConfiguration` (type: `object`):

Residential US proxy (default). Instacart blocks datacenter IPs. The delivery location follows the proxy exit IP and cannot be set.

## Actor input object example

```json
{
  "searchTerms": [
    "milk",
    "eggs"
  ],
  "maxItems": 50,
  "onlyNewOrChanged": false,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `results` (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 = {
    "searchTerms": [
        "milk",
        "eggs"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tortuga/instacart-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 = {
    "searchTerms": [
        "milk",
        "eggs",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("tortuga/instacart-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 '{
  "searchTerms": [
    "milk",
    "eggs"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call tortuga/instacart-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tortuga/instacart-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/VK4gTgWBRCbmXGvoP/builds/Aag3P8jsmXBB1cJ3I/openapi.json
