# Apartments.com Locations

Resolves free text to geography candidates. entity_type 1 address, 2 zip, 3 city, 4 property, 20 street, 21 neighborhood, 22 airport. mid is the join key for geo_mid in the search endpoint. The search endpoint takes a different, smaller vocabulary: geo_type 1 address, 2 zip, 3 city, 5 neighborhood.

- **Documentation:** [https://scrappa.co/docs/apartments-com-api/apartments_com_locations](https://scrappa.co/docs/apartments-com-api/apartments_com_locations)
- **API group:** Apartments.com API
- **Endpoint:** `GET https://scrappa.co/api/apartments-com/locations`

## 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 |
| --- | --- | --- | --- |
| `query` | string | Yes | Address, zip, city, neighborhood, or property name. |
| `max_items` | integer | No | Candidate count, 1-50. |
| `use` | integer | No | Upstream use flag, for example a student-housing scope. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/apartments-com/locations?query=Chicago"
```

## Example response

```json
{
    "success": true,
    "data": {
        "candidates": [
            {
                "mid": "26543",
                "entity_type": 3,
                "label": "Chicago, IL"
            }
        ]
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The requested listing, guide, or sitemap was not found. This response is not billable. |
| 422 | Validation Error | A required public parameter is missing or invalid. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result. This response is not billable. |

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