# SS.lv Search API Documentation

<p><strong>SS.lv Search API</strong>: Lists ads of one category and location, 30 per page, for sale or for rent. Pick a category and a region, then add a district for Riga, filter by price, rooms, area, floor and series, sort, and page through the results. Each item has price, price per square metre, rooms, area, floor, series, land area, location and thumbnail. Item <code>url</code> works in the listing route. The site is in Latvian: text such as titles, descriptions and series stays Latvian or Russian, field names are English. Bedrooms and bathrooms do not exist on SS.lv, only rooms.</p><p><strong>Filters are never ignored.</strong> Price, price per square metre, rooms, area, floor, series and sort run on the one source page that was fetched. Items that break a requested filter are not returned. <code>pagination.source_page</code> names the page and <code>pagination.filtered_from</code> counts its rows, so a strict filter can return few or no items. Riga without a <code>district</code> lists the whole city (<code>all</code>). Page N is always page N of the site. When the site shows no price per square metre, <code>price_per_sqm</code> is the sale price divided by the area for flats, offices and premises, otherwise it stays null.</p>

- **Documentation:** [https://scrappa.co/docs/ss-lv-api/ss_lv_search](https://scrappa.co/docs/ss-lv-api/ss_lv_search)
- **API group:** SS.lv API
- **Endpoint:** `GET https://scrappa.co/api/ss-lv/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `category` | string | No | flats (default), homes, farms, plots, offices, wood, premises or other. |
| `sub_category` | string | No | Required for premises and other. Slug from the autocomplete route with type sub_category, such as garages or parkings. |
| `region` | string | No | Region slug from the autocomplete route, such as riga, jurmala, riga-region or aizkraukle-and-reg. Required for every category except other. |
| `district` | string | No | Area slug for riga and riga-region from the autocomplete route. Default all: the whole city or region. |
| `listing_type` | string | No | sale (default) or rent. |
| `posted` | string | No | Only ads posted today, within 2 days (2d) or within 5 days (5d). The site applies this filter. |
| `min_price` | number | No | Minimum price in EUR. Applied to the fetched source page. |
| `max_price` | number | No | Maximum price in EUR. Applied to the fetched source page. |
| `min_price_per_sqm` | number | No | Minimum price per square metre. Applied to the fetched source page. |
| `max_price_per_sqm` | number | No | Maximum price per square metre. Applied to the fetched source page. |
| `min_rooms` | integer | No | Minimum rooms. SS.lv lists rooms only, not bedrooms. |
| `max_rooms` | integer | No | Maximum rooms. |
| `min_area` | number | No | Minimum area in square metres. Hectares are converted. |
| `max_area` | number | No | Maximum area in square metres. |
| `min_floor` | integer | No | Minimum floor. |
| `max_floor` | integer | No | Maximum floor. |
| `series` | string | No | Building series exactly as shown on the site, such as Staļina or Hrušč. |
| `sort` | string | No | price_asc, price_desc, area_asc, area_desc, price_per_sqm_asc or price_per_sqm_desc. Sorts the fetched source page only. |
| `page` | integer | No | One-based page number, 1 to 1000 (default 1). Page N fetches page N of the site list. |

## Example response

```json
{
    "data": {
        "items": [
            {
                "id": "58219672",
                "url": "https://www.ss.lv/msg/lv/real-estate/flats/jurmala/kauguri/aagfc.html",
                "area": 30,
                "code": "aagfc",
                "size": null,
                "floor": 5,
                "price": 48800,
                "rooms": 1,
                "title": "P\u0101rdodu dz\u012bvokli p\u0113c kapit\u0101la remonta, ir nomain\u012bts viss iz\u0146",
                "series": "Hru\u0161\u010d.",
                "company": null,
                "currency": "EUR",
                "location": {
                    "region": "jurmala",
                    "address": "Kauguri Talsu \u0161oseja31 8",
                    "district": null,
                    "region_name": "J\u016brmala",
                    "district_name": null
                },
                "area_unit": "m2",
                "land_area": null,
                "thumbnail": "https://i.ss.lv/gallery/8/1561/390147/78029282.th2.jpg",
                "price_text": "48,800 \u20ac",
                "floors_total": 5,
                "listing_type": "sale",
                "price_period": null,
                "category_path": null,
                "price_per_sqm": 1627
            },
            {
                "id": "58219258",
                "url": "https://www.ss.lv/msg/lv/real-estate/flats/jurmala/lielupe/bxnebx.html",
                "area": 48,
                "code": "bxnebx",
                "size": null,
                "floor": 2,
                "price": 52800,
                "rooms": 2,
                "title": "Tiek pied\u0101v\u0101ts divistabu neremont\u0113ts dz\u012bvoklis \u0137ie\u0123e\u013cu m\u0101j\u0101",
                "series": "Specpr.",
                "company": null,
                "currency": "EUR",
                "location": {
                    "region": "jurmala",
                    "address": "Lielupe La\u0161u 7 4",
                    "district": null,
                    "region_name": "J\u016brmala",
                    "district_name": null
                },
                "area_unit": "m2",
                "land_area": null,
                "thumbnail": "https://i.ss.lv/gallery/8/1561/390136/78027193.th2.jpg",
                "price_text": "52,800 \u20ac",
                "floors_total": 2,
                "listing_type": "sale",
                "price_period": null,
                "category_path": null,
                "price_per_sqm": 1100
            }
        ],
        "notices": [
            "Filters and sort apply to the one source page that was fetched. See source_page and filtered_from."
        ],
        "pagination": {
            "page": 1,
            "has_more": true,
            "per_page": 3,
            "source_page": 1,
            "total_pages": 5,
            "filtered_from": 5
        },
        "applied_filters": {
            "sort": "price_asc",
            "max_price": 60000
        }
    },
    "meta": {
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing, unknown or not supported, or the location has no list. This response is not billable. |
| 503 | Upstream Unavailable | SS.lv could not be reached or returned a page that does not match the request. This response is not billable and is retryable. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
