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

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-allegro-pl-api-fd8e84c0/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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.paywithlocus.com/api/wrapped/parse-allegro-pl-api-fd8e84c0/browse_category \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-allegro-pl-api-fd8e84c0/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-allegro-pl-api-fd8e84c0/get_search_suggestions \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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.paywithlocus.com/api/wrapped/parse-allegro-pl-api-fd8e84c0/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","query":"<string>","sort":"<string>"}'
```
