# Instacart — 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 for grocery products across multiple retailers, view store locations and availability, and access detailed product information including prices and descriptions. Find the best deals and nearest stores offering the items you need.

**Category:** Food & Dining | **Website:** [instacart.com/](https://instacart.com/) | **Docs:** [parse.bot/marketplace/b64496db-9614-4897-9c82-9901474a6e81/instacart-com-api](https://parse.bot/marketplace/b64496db-9614-4897-9c82-9901474a6e81/instacart-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/instacart/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get product details

Get detailed information for a specific product including description, nutritional info, and ratings. Uses the product page and GraphQL APIs to gather comprehensive product data. Requires a product_id from search_products results and the retailer_slug.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `postal_code` | string | No | US postal/zip code for regional pricing and availability |
| `product_id` | string | Yes | Product ID from search_products results. Accepts numeric ID (e.g. '16902650') or full item ID (e.g. 'items_1944-16902650'). |
| `retailer_slug` | string | Yes | Retailer slug (e.g. 'costco', 'key-food') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/instacart/get-product-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"postal_code":"<string>","product_id":"<string>","retailer_slug":"<string>"}'
```

### Get store details

Get details for a specific retailer including name, logo, categories, and estimated delivery time. Requires a retailer_slug from get_stores results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `postal_code` | string | Yes | US postal/zip code |
| `retailer_slug` | string | Yes | Retailer slug from get_stores results (e.g. 'costco', 'key-food') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/instacart/get-store-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"postal_code":"<string>","retailer_slug":"<string>"}'
```

### Get stores

Get available grocery stores and retailers for a specific US postal code. Returns a list of stores with their names, slugs, categories, and delivery/pickup availability. Use store slugs from the results to query other endpoints.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `postal_code` | string | Yes | US postal/zip code to search for stores (e.g. '10001', '07094', '90210'). Leading zeros are preserved. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/instacart/get-stores \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"postal_code":"<string>"}'
```

### Search products

Search for products within a specific retailer by keyword. Returns product listings with prices, availability, and ratings. Results are deduplicated by product_id. Requires a retailer_slug obtained from get_stores.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of products to return |
| `postal_code` | string | Yes | US postal/zip code for store availability |
| `query` | string | Yes | Search keyword (e.g. 'milk', 'bread', 'organic eggs') |
| `retailer_slug` | string | Yes | Retailer slug from get_stores results (e.g. 'costco', 'key-food') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/instacart/search-products \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","postal_code":"<string>","query":"<string>","retailer_slug":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.