# n11 API scraper — product detail, search, reviews, categories & sellers on n11.com (Turkey's marketplace); prices in TRY. No account, no browser.

> Full n11 product by `url` or `product_id`: title, brand, price, discount, campaign (Sepette indirim), rating, review_count, images, seller, gtin/barcode, category, description, attributes, variants, rating_breakdown and sample reviews. Parsed from n11's own window.model JSON (durable).
> ReefAPI engine `n11` · 6 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/n11/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed or blocked calls are free.
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http, `Authorization: Bearer <key>`) and your assistant can call these actions directly.

## Endpoints

### POST /n11/v1/product/detail — 1 credit
Full n11 product by `url` or `product_id`: title, brand, price, discount, campaign (Sepette indirim), rating, review_count, images, seller, gtin/barcode, category, description, attributes, variants, rating_breakdown and sample reviews. Parsed from n11's own window.model JSON (durable).

**Parameters:**
- `url` (string, optional) — Full n11 product URL (…/urun/<slug>-<id>). Provide url OR product_id.
- `product_id` (string, optional) — n11 product id — the digits at the end of /urun/<slug>-<id>. Provide product_id OR url (url is most reliable).
- `max_rotations` (integer, optional, default 6) — Advanced: residential IP-rotation attempts (1-12, default 6).

**Returns:** product{product_id, title, brand, price, currency=TRY, original_price, discount_rate, campaign (str|null — n11 basket-discount campaign text, e.g. 'SEPETTE %13 İNDİRİM'), campaign_price (str|null — the in-basket price), in_stock, rating, rating_count, comment_count, rating_breakdown{}, gtin, images[], category{}, description, seller{}, attributes[], variants[], sample_reviews[]}

**Example request body:**
```json
{
  "url": "https://www.n11.com/urun/samsung-galaxy-a07-4-gb-128-gb-samsung-turkiye-garantili-106765738"
}
```

### POST /n11/v1/product/reviews — 1 credit
Customer reviews for a product by `url` or `product_id`, paginated (`page`). Returns author, text, rating, date, helpful_count.

**Parameters:**
- `url` (string, optional) — Full n11 product URL (…/urun/<slug>-<id>). Provide url OR product_id.
- `product_id` (string, optional) — n11 product id — the digits at the end of /urun/<slug>-<id>. Provide product_id OR url (url is most reliable).
- `page` (integer, optional, default 1) — Result page (1-based).
- `max_rotations` (integer, optional, default 6) — Advanced: residential IP-rotation attempts (1-12, default 6).

**Returns:** reviews[]{author, text, rating, date, helpful_count, seller}, count, page

### POST /n11/v1/search — 1 credit
Search n11 by keyword (`query`), paginated + sortable. Every card carries product_id, title, brand, price, rating, image, url.

**Parameters:**
- `query` (string, required) — Search keyword.
- `page` (integer, optional, default 1) — Result page (1-based).
- `sort` (string, optional, default "default") — Result ordering. [one of: default, price_asc, price_desc, best_seller, newest]
- `max_rotations` (integer, optional, default 6) — Advanced: residential IP-rotation attempts (1-12, default 6).

**Returns:** products[]{product_id, title, brand, price, currency, discount_rate, rating, rating_count, image, url, seller, category, in_stock}, count, total, page

**Example request body:**
```json
{
  "query": "telefon"
}
```

### POST /n11/v1/category — 1 credit
Browse an n11 category by its `url` (…/<slug> or …-c-<id>), paginated + sortable.

**Parameters:**
- `url` (string, required) — Full n11 category URL (…/<slug> or …-c-<id>).
- `page` (integer, optional, default 1) — Result page (1-based).
- `sort` (string, optional, default "default") — Result ordering. [one of: default, price_asc, price_desc, best_seller, newest]
- `max_rotations` (integer, optional, default 6) — Advanced: residential IP-rotation attempts (1-12, default 6).

**Returns:** products[]{...same card as search}, count, total, page

**Example request body:**
```json
{
  "url": "https://www.n11.com/urun/samsung-galaxy-a07-4-gb-128-gb-samsung-turkiye-garantili-106765738"
}
```

### POST /n11/v1/seller — 1 credit
Seller (mağaza) profile + its products by nickname or store `url`.

**Parameters:**
- `seller` (string, required) — Seller nickname (nickName) or full store URL (…/magaza/<nick>).
- `page` (integer, optional, default 1) — Result page (1-based).
- `max_rotations` (integer, optional, default 6) — Advanced: residential IP-rotation attempts (1-12, default 6).

**Returns:** seller{nickname, business_name, company_name, follower_count, grade, id}, products[]{...card}, count

### POST /n11/v1/resolve — 1 credit
Resolve an n11 short-link (`token` or `url`, e.g. sl.n11.com/n/<token>) to its REAL n11.com URL + type. Follows www.n11.com/n/<token> THROUGH the Cloudflare wall (which a plain client 403s) and captures the final URL — escaping the app-only adj.st/Play-Store dead-end that the short link otherwise hits. Classifies product/store/campaign/category; for products it embeds the full product detail (include_detail) so one call returns both. Deterministic per token → cacheable.

**Parameters:**
- `token` (string, optional) — n11 short-link token — the part after /n/ in https://sl.n11.com/n/<token> or https://www.n11.com/n/<token>. Provide token OR url.
- `url` (string, optional) — Full n11 short-link (sl.n11.com/n/…, www.n11.com/n/…, or an adj.st link carrying the token). Provide url OR token.
- `include_detail` (boolean, optional, default true) — When the token resolves to a product, also embed the full product detail under `product` (saves a second call). Default true.
- `max_rotations` (integer, optional, default 6) — Advanced: residential IP-rotation attempts (1-12, default 6).

**Returns:** token, final_url, kind (product|store|campaign|category|other|dead), product_id (kind=product), store_slug (kind=store), http_status, product{} (full detail when kind=product and include_detail)

**Example request body:**
```json
{
  "token": "vnETLtk"
}
```

## More
- Try it live, no code: https://reefapi.com/playground?engine=n11
- Human docs page: https://reefapi.com/docs/n11
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
