# Hemnet.se API scraper — Sweden real estate data: for-sale (till salu) and recently-sold (slutpriser/sålda) property listings across every Swedish city, municipality and county with full filters (price SEK, rooms, living area m², plot, property type, price per m², construction year, keyword, sort), each listing with price, rooms, area, fee, square-metre price, energy class, coordinates, photos, broker agency and address, a full per-listing detail record (description, all photos, amenities, year built, sale history) and recently-sold final prices, plus a location resolver that maps a Swedish place name to Hemnet's location — no API key required

> Search Hemnet.se for-sale property listings by location, with structured filters: price (SEK), rooms, living area (m²), plot, property type, price-per-m², construction year, keyword and sort. Each result carries asking price, fee, square-metre price, rooms, living area, housing form, coordinates, broker agency, address and photos. Paginate with page.
> ReefAPI engine `hemnet` · 4 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/hemnet/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 /hemnet/v1/search — 1 credit
Search Hemnet.se for-sale property listings by location, with structured filters: price (SEK), rooms, living area (m²), plot, property type, price-per-m², construction year, keyword and sort. Each result carries asking price, fee, square-metre price, rooms, living area, housing form, coordinates, broker agency, address and photos. Paginate with page.

**Parameters:**
- `location` (string, required) — Where to search — a Swedish city, municipality, county, district or postal area ('Stockholm', 'Göteborg', 'Malmö', 'Uppsala kommun', 'Vasastan'). Free text is resolved to Hemnet's location id automatically; pass a numeric Hemnet location_id directly to skip resolution.
- `home_type` (string, optional) — Property type — one or several comma-separated: villa (house), radhus (townhouse), bostadsratt (apartment/condo), fritidshus (holiday home), tomt (plot/land), gard (farm). e.g. 'villa,radhus'.
- `sort` (enum, optional, default "newest") — Result ordering. [one of: newest, oldest, price_low, price_high, size_high, size_low, ppm2_low, ppm2_high, fee_low]
- `page` (integer, optional, default 1) — Result page (50 listings per page; paginate with page += 1). Hemnet caps the viewable window at 50 pages / 2500 results.
- `price_min` (integer, optional) — Minimum asking price in SEK.
- `price_max` (integer, optional) — Maximum asking price in SEK.
- `rooms_min` (number, optional) — Minimum number of rooms.
- `rooms_max` (number, optional) — Maximum number of rooms.
- `living_area_min` (integer, optional) — Minimum living area in square metres (m²).
- `living_area_max` (integer, optional) — Maximum living area in square metres (m²).
- `land_area_min` (integer, optional) — Minimum plot / land area in square metres (m²).
- `land_area_max` (integer, optional) — Maximum plot / land area in square metres (m²).
- `price_per_m2_min` (integer, optional) — Minimum price per square metre (SEK/m²).
- `price_per_m2_max` (integer, optional) — Maximum price per square metre (SEK/m²).
- `year_min` (integer, optional) — Earliest construction year.
- `year_max` (integer, optional) — Latest construction year.
- `keywords` (string, optional) — Free-text listing keyword filter ('pool', 'sjöutsikt', 'kakelugn', 'balkong').

**Returns:** results[]{id, url, street_address, area, housing_form, asking_price{amount_sek}, fee, square_meter_price, rooms, living_area_m2, land_area_m2, latitude, longitude, broker_agency, labels, primary_photo_url} + total + count + page + max_pages + location + filters_applied

**Example request body:**
```json
{
  "location": "Stockholm"
}
```

### POST /hemnet/v1/sold — 1 credit
Recently-SOLD property prices (slutpriser) by location, with the same filters as search — the comparable-sales / price-history surface. Each record carries asking price, FINAL sold price, sold date, price change (%) and square-metre price.

**Parameters:**
- `location` (string, required) — Where to search — a Swedish city, municipality, county, district or postal area ('Stockholm', 'Göteborg', 'Malmö', 'Uppsala kommun', 'Vasastan'). Free text is resolved to Hemnet's location id automatically; pass a numeric Hemnet location_id directly to skip resolution.
- `home_type` (string, optional) — Property type — one or several comma-separated: villa (house), radhus (townhouse), bostadsratt (apartment/condo), fritidshus (holiday home), tomt (plot/land), gard (farm). e.g. 'villa,radhus'.
- `sort` (enum, optional, default "newest") — Result ordering. [one of: newest, oldest, price_low, price_high, size_high, size_low, ppm2_low, ppm2_high, fee_low]
- `page` (integer, optional, default 1) — Result page (50 listings per page; paginate with page += 1). Hemnet caps the viewable window at 50 pages / 2500 results.
- `price_min` (integer, optional) — Minimum asking price in SEK.
- `price_max` (integer, optional) — Maximum asking price in SEK.
- `rooms_min` (number, optional) — Minimum number of rooms.
- `rooms_max` (number, optional) — Maximum number of rooms.
- `living_area_min` (integer, optional) — Minimum living area in square metres (m²).
- `living_area_max` (integer, optional) — Maximum living area in square metres (m²).
- `land_area_min` (integer, optional) — Minimum plot / land area in square metres (m²).
- `land_area_max` (integer, optional) — Maximum plot / land area in square metres (m²).
- `price_per_m2_min` (integer, optional) — Minimum price per square metre (SEK/m²).
- `price_per_m2_max` (integer, optional) — Maximum price per square metre (SEK/m²).
- `year_min` (integer, optional) — Earliest construction year.
- `year_max` (integer, optional) — Latest construction year.
- `keywords` (string, optional) — Free-text listing keyword filter ('pool', 'sjöutsikt', 'kakelugn', 'balkong').

**Returns:** results[]{id, url, street_address, housing_form, asking_price, final_price{amount_sek}, sold_at_label, price_change, square_meter_price, rooms, living_area_m2, broker_agency} + total + count + page + location + filters_applied

**Example request body:**
```json
{
  "location": "Malmö"
}
```

### POST /hemnet/v1/detail — 1 credit
Full record for a single listing by its Hemnet listing URL, slug or id (hemnet.se/bostad/<slug>). Returns asking price, fee, rooms, living & plot area, construction year, energy class, tenure, the full description, every photo, amenities, days-on-market, view count and any sale history.

**Parameters:**
- `url` (string, required) — A Hemnet listing URL, /bostad/<slug> path or slug — the `url` from a search result. A full https URL, the path or the bare slug all work.

**Returns:** listing{id, url, title, street_address, post_code, housing_form, tenure, asking_price, fee, square_meter_price, rooms, living_area_m2, land_area_m2, construction_year, energy_classification, description, days_on_hemnet, times_viewed, amenities[], sale_history[], photos[], agent{agency_name}}

### POST /hemnet/v1/location — 0 credits
Location resolver / autocomplete — map a free-text Swedish place name to Hemnet locations (city, municipality, county, district, postal area) with their ids. Use it to power a search box or to confirm the exact location a search will use.

**Parameters:**
- `query` (string, required) — Free-text Swedish place to resolve — a city, municipality, county or district ('Göteborg', 'Vasastan', 'Lund').
- `limit` (integer, optional, default 10) — Max suggestions to return (1-40).

**Returns:** suggestions[]{id, name, parent_name, type} + resolved{id, name, type} + count + query

**Example request body:**
```json
{
  "query": "Göteborg"
}
```

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