# List the streets at a postcode

`GET /api/v1/address/streets`

- Authentication: Secret API key as a bearer token
- Billing: 1 credit per answered postcode, free for the next seven days for the same postcode. A country or postcode with nothing to list costs nothing.
- Group: Address

Answers every street a national address register lists inside one postcode, in the register's own spelling and sorted: the list behind a street picker under a postcode field, and the list a single lookup's `street_suggestion` is drawn from. One call returns the whole postcode, so a form filters locally as the visitor types rather than calling per keystroke.

Open data only: the registers publish their streets and Spaw lists them back, with no house numbers and nothing about who is there. Available wherever a register with a street listing is installed — Switzerland, Austria, Czechia, Norway, Belgium, Luxembourg, Latvia, Australia and Denmark in full, the parts of the United States and France their registers carry, and Great Britain by postcode district from Ordnance Survey's Open Names. A country with no such register, and a postcode the register lists no street at, both answer `404 ADDRESS_STREETS_NOT_FOUND` and cost nothing.

`country` is an ISO 3166-1 alpha-2 code the postal format table covers and `postal_code` the postcode in the country's own notation, with or without its space.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `country` | query | string | yes | An ISO 3166-1 alpha-2 code the postal format table covers, in either case. 2 to 2 characters. |
| `postal_code` | query | string | yes | The postcode to list, in the country's own notation. At most 32 characters. |

## Example request

```bash
curl https://spaw.co/api/v1/address/streets \
  -H "Authorization: Bearer sk_live_…"
```

## Responses

### 200 — The streets the register lists at that postcode.

```json
{
    "success": true,
    "data": {
        "country": "CH",
        "postal_code": "8001",
        "register": "ch-amtliches-gebaeudeadressverzeichnis",
        "streets": [
            "Bahnhofstrasse",
            "Limmatquai",
            "Münsterhof",
            "Paradeplatz",
            "Rennweg"
        ],
        "count": 5
    },
    "meta": {
        "credits_used": 1,
        "credits_remaining": 9,
        "cache_hit": false,
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 401 — The key is missing, malformed, or revoked.

```json
{
    "success": false,
    "error": {
        "code": "UNAUTHENTICATED",
        "message": "Provide a valid API key as a bearer token.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 402 — The balance is empty. The lookup did not run.

```json
{
    "success": false,
    "error": {
        "code": "INSUFFICIENT_CREDITS",
        "message": "Your credit balance is empty.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 404 — No register with a street listing covers the country, or the register lists no street at the postcode. Nothing was charged.

```json
{
    "success": false,
    "error": {
        "code": "ADDRESS_STREETS_NOT_FOUND",
        "message": "No street is listed at 9999 in CH.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 422 — The request body could not be validated; `error.errors` lists the fields.

```json
{
    "success": false,
    "error": {
        "code": "VALIDATION_FAILED",
        "message": "The email field is required.",
        "errors": {
            "email": [
                "The email field is required."
            ]
        },
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

### 429 — Over 5 requests per second for the key. Retry after the limit resets.

```json
{
    "success": false,
    "error": {
        "code": "RATE_LIMITED",
        "message": "Too many requests. Retry after the limit resets.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}
```

## Error codes

- `UNAUTHENTICATED` — https://spaw.co/docs/errors/UNAUTHENTICATED
- `VALIDATION_FAILED` — https://spaw.co/docs/errors/VALIDATION_FAILED
- `INSUFFICIENT_CREDITS` — https://spaw.co/docs/errors/INSUFFICIENT_CREDITS
- `ADDRESS_STREETS_NOT_FOUND` — https://spaw.co/docs/errors/ADDRESS_STREETS_NOT_FOUND
- `RATE_LIMITED` — https://spaw.co/docs/errors/RATE_LIMITED

---

Canonical page: https://spaw.co/docs/api/list-address-streets · OpenAPI document: https://spaw.co/openapi.json · All endpoints: https://spaw.co/docs/api
