# 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 — 2 credits
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: how many times to retry the fetch (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
Every customer review n11 publishes for a product, paginated and ordered. `sort=newest` (the default) puts the most recent review first and holds that order across pages, so you can poll a product for new reviews; `sort=helpful` orders by n11's helpful-vote count instead. Each page carries the honest totals — how many people rated the product, how many wrote text, the star breakdown, total_pages for your page_size, and how deep n11 actually serves — plus n11's own AI review summary. Reviewer names are returned exactly as n11 publishes them on the product page — usually masked (e.g. 'a*** s***'), but n11 does not mask all of them, so treat the field as public site content rather than as anonymised.

**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) — Review page — 1-BASED (1, 2, 3…); summary.total_pages says how many exist and summary.reachable_pages how many n11 serves.
- `page_size` (integer, optional, default 20) — Reviews per page (1–100, default 20). A larger page_size also reaches further into the corpus, because n11 caps the OFFSET rather than the page number.
- `sort` (enum, optional, default "newest") — Review ordering. `newest` (default) returns the most recent reviews first and keeps that order across pages. `helpful` orders by n11's helpful-vote count. n11 does not publish an oldest-first or rating-ordered view of its reviews. [one of: newest, helpful]
- `max_rotations` (integer, optional, default 6) — Advanced: how many times to retry the fetch (1-12, default 6).

**Returns:** product_id, page, page_size, sort, ai_summary (n11's own AI digest of the reviews, Turkish; null if it publishes none), summary{average_rating, total_rating_count (every rating incl. star-only), total_comment_count (the written reviews this action pages through), total_pages, page_size, rating_breakdown{5..1}, reachable_reviews, reachable_pages}, reviews[]{id, author (as n11 publishes it — usually masked, not always), title (null on most products — n11 only stores a headline for some reviews), text, rating, date, date_epoch_ms, helpful_count, unhelpful_count, images[], seller, product_id}, count

### POST /n11/v1/search — 2 credits
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: how many times to retry the fetch (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 — 2 credits
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: how many times to retry the fetch (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 — 2 credits
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: how many times to retry the fetch (1-12, default 6).

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

### POST /n11/v1/resolve — 2 credits
Resolve an n11 short-link (`token` or `url`, e.g. sl.n11.com/n/<token>) to its REAL n11.com URL + type, capturing the final destination — a short link opened directly dead-ends on an app-install page instead of the item. 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: how many times to retry the fetch (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
- Overview page: https://reefapi.com/n11-api
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
