# SeLoger Search Count

Get the total number of SeLoger listings matching a set of filters. Use it to size a market before paginating a search. Passing `energy_certificate_class[]` additionally returns a breakdown by energy certificate class (DPE A through G); upstream withholds the total in that mode, so `total_results` is null and `aggregation_only` is true. The facet counts only listings that carry a DPE value and is computed over the criteria with its own dimension removed, so the classes do not sum to `total_results`. It reads a single count route, so this endpoint costs 1 credit. A failed request costs nothing.

- **Documentation:** [https://scrappa.co/docs/seloger-api/seloger_count](https://scrappa.co/docs/seloger-api/seloger_count)
- **API group:** SeLoger API
- **Endpoint:** `GET https://scrappa.co/api/seloger/count`

## 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 |
| --- | --- | --- | --- |
| `place_id` | string | No | Optional. A SeLoger place id, e.g. "AD08FR31096", obtainable from the `locations=` query parameter of any seloger.com search URL. Omit it to count the whole of France; a malformed value is rejected with 400 INVALID_PLACE_ID. |
| `distribution` | string | No | buy or rent |
| `estate_types[]` | array | No | Property types to count |
| `price_min` | integer | No | Minimum price in EUR |
| `price_max` | integer | No | Maximum price in EUR |
| `year_built_min` | integer | No | Earliest construction year |
| `size_min` | integer | No | Minimum floor area in m² |
| `available_from_max` | string | No | Latest availability date, YYYY-MM-DD |
| `energy_certificate_class[]` | array | No | DPE classes to count: A, B, C, D, E, F, G. Requesting this switches the response to aggregation-only mode, where `total_results` is null. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/seloger/count?distribution=buy"
```

## Example response

```json
{
    "success": true,
    "total_results": 24816,
    "energy_certificate_counts": [],
    "aggregation_only": false
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | One or more query parameters failed validation. |
| 400 | Invalid Request | The request is well formed but cannot be expressed as a SeLoger query. `INVALID_PLACE_ID` means the `place_id` you supplied is not a SeLoger place id (`AD08FR…`); omit it to query the whole of France instead. `INVALID_DISTRIBUTION`, `INVALID_ESTATE_TYPES` and `INVALID_ENERGY_CERTIFICATE_CLASS` name the offending parameter. `INVALID_UPSTREAM_REQUEST` means a combination SeLoger cannot answer honestly, such as `new_build` without `distribution=buy`; the message names it. These failures are not billed. |
| 404 | Not Found | The requested resource does not exist upstream: the listing is gone, was never live, or is not reachable through the search it would belong to. This is not billed. |
| 503 | Upstream Unavailable | SeLoger did not return a usable response through any available request path, or refused the request this integration sent it. This failure is not billed and is retryable. |
| 503 | Service Disabled | The SeLoger integration is switched off. Reads as a clean 503 so a rollback needs no deploy. |

## 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)
