# Grainger — 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 Grainger's industrial supply catalog to find products across categories and subcategories, then access detailed specifications and pricing information for any item. Quickly locate the exact industrial supplies you need by exploring the full product catalog with organized categories and comprehensive product details.

**Category:** E-commerce | **Website:** [grainger.com/](https://grainger.com/) | **Docs:** [parse.bot/marketplace/77e19856-6408-449e-80aa-621877d58daf/grainger-com-api](https://parse.bot/marketplace/77e19856-6408-449e-80aa-621877d58daf/grainger-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-grainger-com-api-77e19856/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_all_top_level_categories

Get all top-level product categories from Grainger.com. Returns a flat list of category names, URLs, and URL slugs. Use this as the entry point to navigate the catalog hierarchy.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-grainger-com-api-77e19856/get_all_top_level_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_category_subcategories

Get subcategories, description, and breadcrumbs for a given category page. Accepts any category URL from get_all_top_level_categories or from subcategory URLs returned by this endpoint. Returns the category name, a text description, breadcrumb trail, and child subcategories with their URLs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_url` | string | Yes | Full URL of the category page (e.g. https://www.grainger.com/category/safety) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-grainger-com-api-77e19856/get_category_subcategories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_url":"<string>"}'
```

### get_product_details

Get full product details including specifications, pricing, and brand information for a specific product page. Returns technical specifications as key-value pairs, pricing, brand, and description.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_url` | string | Yes | Full URL of the product page (e.g. https://www.grainger.com/product/ANSELL-Chemical-Resistant-Gloves-60WL39) |

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

### get_subcategory_detail

Get detailed subcategory information including total product count and available filter facets (e.g. Brand, Trade Designation). Filters contain only values with available products in that category. Use subcategory URLs from get_category_subcategories.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_url` | string | Yes | Full URL of the subcategory page (e.g. https://www.grainger.com/category/safety/eye-face-protection) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-grainger-com-api-77e19856/get_subcategory_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"category_url":"<string>"}'
```

### search_products

Search for products on Grainger.com by keyword. Returns product listings with name, SKU, price, and image URL. Some broad search terms redirect to a parent category and return category_url alongside the products array; use more specific terms or part numbers for direct product results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword or part number |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-grainger-com-api-77e19856/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
