# Drunk Elephant — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 Drunk Elephant's full product catalog by category or collection, view detailed product information including ingredients and specifications, and access customer ratings and reviews. Find the perfect skincare and beauty products for your needs with comprehensive product details and authentic customer feedback.

**Category:** E-commerce | **Website:** [drunkelephant.com/](https://drunkelephant.com/) | **Docs:** [parse.bot/marketplace/093896cc-6c7b-4076-8373-9e8f82bb4b92/drunkelephant-com-api](https://parse.bot/marketplace/093896cc-6c7b-4076-8373-9e8f82bb4b92/drunkelephant-com-api)

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

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/drunk-elephant/`
**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 all collections

Retrieve all available product collections/categories from the site navigation. Returns collection names, URL slugs, and full URLs. Use the slug values as input to get_products_by_category.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/drunk-elephant/get-all-collections \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get product details

Fetch full product details including ingredients, usage instructions, benefits, and availability. Accepts either a URL slug ending in .html for direct lookup, or a product_id/partial name which triggers a search to resolve the product page. At least one of url_slug or product_id must be provided.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | No | Product ID/SKU (e.g., '999DE00000103' or '812343034358') |
| `url_slug` | string | No | Product URL slug ending in .html (e.g., 'protini-polypeptide-firming-refillable-moisturizer-999DE00000103.html') for direct lookup, or a partial name (e.g., 'protini') to search |

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

### Get product ratings and reviews

Fetch customer ratings and reviews for a product. Returns flattened individual reviews with rating, headline, and comments, plus a rollup summary with average rating, total counts, and rating histogram. Paginated by page number.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of reviews per page |
| `page` | integer | No | Page number (1-based) |
| `product_id` | string | Yes | Product ID/SKU (e.g., '999DE00000103') |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/drunk-elephant/get-product-ratings-and-reviews \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","page":"<integer>","product_id":"<string>"}'
```

### Get products by category

Retrieve a paginated list of products within a collection/category. Returns product summaries with price, rating, and stock status, plus a total count and current page index. Use get_all_collections to discover valid category slugs.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_slug` | string | Yes | Category slug (e.g., 'skincare', 'best-sellers', 'hair-collection', 'kits-bundles', 'moisturizers', 'serums') |
| `start` | integer | No | Pagination start index (0-based offset into the product list) |
| `sz` | integer | No | Number of products per page |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/drunk-elephant/get-products-by-category \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"category_slug":"<string>","start":"<integer>","sz":"<integer>"}'
```

### Search products

Full-text search over Drunk Elephant products by keyword. Returns matching products with price, star rating, review count, stock status, and image URL. Supports multi-word queries. Results are not paginated — the site returns all matches in one response.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword or phrase (e.g., 'moisturizer', 'vitamin c serum', 'protini') |

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

## Next steps

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