# Drunk Elephant — 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 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-drunkelephant-com-api-093896cc/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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.paywithlocus.com/api/wrapped/parse-drunkelephant-com-api-093896cc/get_all_collections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-drunkelephant-com-api-093896cc/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-drunkelephant-com-api-093896cc/get_product_ratings_and_reviews \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-drunkelephant-com-api-093896cc/get_products_by_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-drunkelephant-com-api-093896cc/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
