# Nemlig — 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 grocery products across categories on nemlig.com, view detailed product information and recipes, check current promotional offers, and manage a shopping basket. Add items to a basket and organize them before checkout.

**Category:** Food & Dining | **Website:** [nemlig.com/](https://nemlig.com/) | **Docs:** [parse.bot/marketplace/821a965e-38ad-4987-b205-52c9e4afe93c/nemlig-com-api](https://parse.bot/marketplace/821a965e-38ad-4987-b205-52c9e4afe93c/nemlig-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-nemlig-com-api-821a965e/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### add_to_basket

Add a product to the anonymous shopping basket. Returns the full updated basket state including all line items, total price (including delivery fee), and basket identifier. The product_id is available from search_products results via products[*].Id.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Internal product ID (e.g. '103368'). Obtainable from search_products results via products[*].Id. |
| `quantity` | integer | No | Quantity to add to the basket. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nemlig-com-api-821a965e/add_to_basket \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>","quantity":"<integer>"}'
```

### get_basket

Retrieve the current anonymous shopping basket contents including line items, total price (with delivery fee), and product count. An empty basket still returns the delivery fee as TotalPrice.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nemlig-com-api-821a965e/get_basket \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_category_products

Browse the content of a specific category page by its URL path. Returns page content sections (product lists, brand spots, banners) and metadata. The category_url is available from list_categories results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_url` | string | Yes | Category URL path (e.g. '/dagligvarer/frugt-groent'). Obtainable from list_categories results via categories[*].Url. |

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

### get_offers

List current promotional offers from nemlig.com's tilbud (offers) page. Returns page content sections and metadata describing active campaigns and discounted products.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nemlig-com-api-821a965e/get_offers \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_product_details

Fetch full details for a single product by its URL slug, including HTML description, attributes (series, fat percentage, animal type), media gallery, nutritional declarations, and page metadata. The slug is available from search_products results via products[*].Url.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_slug` | string | Yes | Product URL slug (e.g. 'minimaelk-0-4-oeko-103368'). Obtainable from search_products results via products[*].Url. |

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

### list_categories

Retrieve the full navigation hierarchy of grocery categories as a nested tree. Each node carries an Id, display Text, Url path, and recursive Children array. Use the Url values as input to get_category_products.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nemlig-com-api-821a965e/list_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_products

Full-text search over nemlig.com's product catalog. Returns matching products with pricing, availability, and campaign info, plus recipe suggestions related to the query. Paginated via offset/limit. Each product exposes an Id (for basket operations) and a Url slug (for detail lookups).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of product results to return. |
| `offset` | integer | No | Offset for pagination of product results. |
| `query` | string | Yes | Search keyword (e.g. 'mælk', 'brød', 'ost') |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-nemlig-com-api-821a965e/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","offset":"<integer>","query":"<string>"}'
```
