# Blocket API — Nordic second-hand classifieds (Blocket Sweden, FINN Norway, Tori Finland, DBA Denmark): search listings, read the full listing and browse categories, in local currency. No account, no browser; private sellers' data stays private.

> Search second-hand listings on Blocket (se), FINN (no), Tori (fi) or DBA (dk) by keyword, category or region: listing id, title, price in local currency (null for give-aways), free/give-away flag, municipality, publication time, private or business seller, shipping and buy-now availability, brand, images and attributes, with the true total and category/region counts. Filter by price, condition, seller type, ad type, shipping and ads published today; sort by relevance, newest or price.
> ReefAPI engine `blocket` · 3 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/blocket/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 calls are free except verified SHEIN NOT_FOUND on product/detail and price (4 credits).
- **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 /blocket/v1/search — 1 credit
Search second-hand listings on Blocket (se), FINN (no), Tori (fi) or DBA (dk) by keyword, category or region: listing id, title, price in local currency (null for give-aways), free/give-away flag, municipality, publication time, private or business seller, shipping and buy-now availability, brand, images and attributes, with the true total and category/region counts. Filter by price, condition, seller type, ad type, shipping and ads published today; sort by relevance, newest or price.

**Parameters:**
- `query` (string, optional) — Keyword, in the site's language (cykel, sykkel, polkupyörä, cykel). Optional when `category` or `location` is given.
- `country` (enum, optional, default "se") — Which Nordic marketplace: se = Blocket, no = FINN torget, fi = Tori, dk = DBA. Prices come back in that country's currency; listing ids belong to one site. [one of: se, no, fi, dk]
- `category` (string, optional) — Category code from `categories` or a search's `category_facets` — 0.<id> (top level, e.g. 0.69 sport), 1.<id>.<id> (sub-category) or 2.<id>.<id>.<id> (leaf, e.g. 2.69.3963.257 bicycles). The codes are shared by all four sites; the names are localised.
- `location` (string, optional) — Region code from a search's `region_facets` (e.g. 0.300001 Stockholm on Blocket, 0.20003 Akershus on FINN). Region codes are per country.
- `page` (integer, optional, default 1) — Result page, 1-50 (53 listings per page). The sites stop at page 50 whatever the total.
- `sort` (enum, optional, default "relevance") — Order of results. Anything else is rejected (the sites silently fall back to relevance). [one of: relevance, newest, price_asc, price_desc]
- `price_min` (integer, optional) — Lowest price, whole units of the country's currency.
- `price_max` (integer, optional) — Highest price, whole units of the country's currency.
- `condition` (enum, optional) — Item condition, on the sites' shared five-step scale. [one of: new, like_new, good, fair, needs_repair]
- `seller_type` (enum, optional) — Only private sellers or only businesses. [one of: private, business]
- `listing_type` (enum, optional) — Kind of ad. Give-away ads have no price. [one of: sell, give_away, wanted]
- `shipping` (enum, optional) — Only ads that can be shipped through the site's own delivery service, or only free shipping. [one of: shipping, free_shipping]
- `published_today` (boolean, optional) — Only ads published today.
- `max_rotations` (integer, optional, default 3) — Advanced: how many times to retry a difficult request (1-5).

**Returns:** results[]{listing_id, title, url, price (number, null when none is published or the ad is a give-away), currency, is_free, listing_type (sell|give_away|wanted), listing_type_label, location (municipality), coordinates{lat, lon} (business sellers, or with include_pii), listed_at (ISO, UTC), seller_type (private|business), seller_name (businesses only), brand, shipping_available, buy_now, free_shipping, image, images[], image_count, attributes[]{id, label, value}, labels[]}, count, total_results, page, last_page, has_more, sort_applied, filters_applied[]{filter, label, values}, category_facets[]{category, name, count}, region_facets[]{location, name, count}, country, site, currency, query

**Example request body:**
```json
{
  "query": "cykel",
  "country": "se"
}
```

### POST /blocket/v1/listing — 1 credit
The full listing by id or URL: title, full description, price and currency, give-away flag, status (active or sold), condition on the five-step scale, category path with its search code, all attributes (size, brand, model…), every image with dimensions, postal code and city, last-edited time, shipping and buy-now availability, and the seller — for businesses the shop name, organisation id, company registry link, address, website and their other listings; for private sellers only the seller type.

**Parameters:**
- `listing_id` (string, required) — Listing id (the number at the end of …/recommerce/forsale/item/26612110) or the full listing URL — a URL also sets the country.
- `country` (enum, optional, default "se") — Which Nordic marketplace: se = Blocket, no = FINN torget, fi = Tori, dk = DBA. Prices come back in that country's currency; listing ids belong to one site. [one of: se, no, fi, dk]
- `max_rotations` (integer, optional, default 3) — Advanced: how many times to retry a difficult request (1-5).

**Returns:** listing{listing_id, title, url, status (active|sold|inactive), status_label, price (null for give-aways or when none is published), currency, is_free, listing_type, listing_type_label, condition{code (new|like_new|good|fair|needs_repair), label, value_id}, description (phones/e-mails redacted unless include_pii), category, category_path[]{id, name}, category_search_code, attributes[]{id, label, value, value_id}, images[]{url, width, height}, image_count, location{postal_code, city, country_code, street_address, lat, lon} (street/coordinates for businesses or with include_pii), edited_at, seller{type, id, name (businesses), organisation_id, shop_url, website_url, company_registry_url, logo_url, address{street, city, postal_code}, verified_identity, has_phone, phone (include_pii only), selling_points[]}, shipping{shipping_available, buy_now, free_shipping}, is_webstore, seller_other_listings[]{listing_id, title, price, location, url, image}, country, site}

### POST /blocket/v1/categories — 1 credit
The marketplace category tree of one site with live listing counts — three levels, each node with the code to pass as `category` to search. Optionally counted for a keyword.

**Parameters:**
- `country` (enum, optional, default "se") — Which Nordic marketplace: se = Blocket, no = FINN torget, fi = Tori, dk = DBA. Prices come back in that country's currency; listing ids belong to one site. [one of: se, no, fi, dk]
- `query` (string, optional) — Optional keyword: counts are then for that keyword.
- `max_rotations` (integer, optional, default 3) — Advanced: how many times to retry a difficult request (1-5).

**Returns:** categories[]{category, name, count, level, search_param, children[]}, count, total_results, region_facets[]{location, name, count}, country, site, query

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