# Cosdna — 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 cosmetic products and ingredients to view detailed safety information, supplier data, and community reviews all in one place. Analyze ingredient lists to understand product composition and access the latest cosmetics forum discussions and user feedback.

**Category:** Healthcare | **Website:** [cosdna.com/](https://cosdna.com/) | **Docs:** [parse.bot/marketplace/c596db1d-8302-45d6-9a54-3eaab89afce9/cosdna-com-api](https://parse.bot/marketplace/c596db1d-8302-45d6-9a54-3eaab89afce9/cosdna-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/cosdna/`
**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

### Analyze cosmetics

Analyze a list of ingredients submitted as text. Returns safety, acne, and irritant ratings for each recognized ingredient. Useful for checking a product's full ingredient list without needing a product_id.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `ingredient_list` | string | Yes | Comma-separated list of cosmetic ingredients to analyze (e.g. 'Water, Glycerin, Niacinamide'). |

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

### Get forum posts

Get forum posts for a specific board. Returns post titles, links, and authors with pagination support.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `board_id` | string | No | Forum board ID (e.g. '13' for Skincare). |
| `page` | integer | No | Page number for pagination. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/cosdna/get-forum-posts \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"board_id":"<string>","page":"<integer>"}'
```

### Get ingredient details

Get details for a specific ingredient including synonyms, metadata (formula, molecular weight, CAS number), a description, and up to 10 related products containing the ingredient.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `ingredient_id` | string | Yes | Ingredient ID from search_ingredients results (e.g. 'af81356377'). |

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

### Get latest reviews

Get the latest product reviews displayed on the CosDNA homepage. Returns product names and links to their review sections.

**Estimated cost:** Metered

_No parameters required._

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

### Get product details

Get full details for a product including its complete ingredient list with safety, acne, and irritant ratings. The product name is extracted from the page title. Each ingredient includes an ingredient_id for cross-referencing with get_ingredient_details.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product ID from search_products results (e.g. '73c6694771'). |

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

### Search ingredients

Search for cosmetic ingredients by name. Supports single and multi-word queries. Returns ingredient IDs that can be used with get_ingredient_details for full information.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword for ingredients (e.g. 'niacinamide', 'hyaluronic acid'). |

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

### Search products

Full-text search over cosmetic products by name. Returns paginated results with product IDs, names, links, and thumbnails. Each product can be drilled into via get_product_details for its full ingredient list.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `query` | string | Yes | Search keyword for products (e.g. 'sunscreen', 'moisturizer'). |
| `sort` | string | No | Sort order for results. |

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

### Search suppliers

Search for ingredient suppliers. Returns supplier product listings with company names and descriptions.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword for supplier products (e.g. 'Hyaluronic Acid'). |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/cosdna/search-suppliers \
  -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.