# Allegro — 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 listings, browse categories, retrieve product details, and get autocomplete suggestions from Allegro.pl, Poland's largest e-commerce marketplace.

**Category:** Marketplaces | **Website:** [allegro.pl/](https://allegro.pl/) | **Docs:** [parse.bot/marketplace/fd8e84c0-aa45-4d2c-884f-d46fabe40b89/allegro-pl-api](https://parse.bot/marketplace/fd8e84c0-aa45-4d2c-884f-d46fabe40b89/allegro-pl-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/allegro/`
**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

### Browse category

Browse products within a specific Allegro category. Returns paginated product listings similar to search results but scoped to a category. Category IDs can be found from product detail parameters or the site navigation (e.g. 491 for Laptopy).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_id` | string | Yes | The Allegro category ID (numeric string, e.g. '491' for Laptopy). |
| `category_slug` | string | No | URL slug for the category. Defaults to 'kategoria' which works as a generic slug. |
| `page` | integer | No | Page number to retrieve (1-based, max 100). |

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

### Get product details

Retrieve comprehensive details of a specific product listing including price, images, seller info, technical parameters, and description. Accepts either a full Allegro offer URL or an offer ID. Data is extracted from server-rendered HTML containing embedded JSON facade data.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `offer_id` | string | No | The Allegro offer ID (numeric string). Required if url is not provided. |
| `url` | string | No | Full Allegro offer URL. Required if offer_id is not provided. |

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

### Get search suggestions

Get search autocomplete suggestions for a keyword prefix from Allegro.pl. Returns phrase suggestions and navigation tiles that help users discover popular product searches and categories. Uses the edge API which is not subject to the same rate limiting as listing pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword prefix to get suggestions for. |

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

### Search products

Search for products on Allegro.pl by keyword. Returns paginated product listings with price, seller, and delivery information. Results are extracted from server-rendered HTML containing embedded JSON. Each page contains up to ~60-70 items. The site enforces aggressive rate limiting; requests may occasionally be blocked by DataDome antibot requiring proxy rotation.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number to retrieve (1-based, max 100). |
| `query` | string | Yes | Search keyword. |
| `sort` | string | No | Sorting order. Accepted values: relevance, price_asc, price_desc, popularity, newest. Defaults to relevance if omitted. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/allegro/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>"}'
```

## 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.