# 99.co Location Autocomplete API Documentation

Resolve free text into 99.co locations: MRT and LRT stations, districts, areas, streets and developments. Each suggestion returns its id, type, title, subtitle, coordinates and (for stations) the line colours. Districts, areas, stations, regions and subzones come with ready location_type and location_id values for /search. Developments come with a development_id for /transactions. Streets and developments cannot filter a search, so their location_type and location_id are null. A query without a match is a successful response with an empty list.

- **Documentation:** [https://scrappa.co/docs/99co-api/99co_autocomplete](https://scrappa.co/docs/99co-api/99co_autocomplete)
- **API group:** 99.co API
- **Endpoint:** `GET https://scrappa.co/api/99co/v1/autocomplete`

## 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 | Free text, 2 to 80 characters. Example: orchard. |
| `listing_type` | string | No | sale or rent. Defaults to rent. |
| `property_segments` | string | No | residential or commercial. Defaults to residential. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/99co/v1/autocomplete?query=orchard"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "orchard",
        "items": [
            {
                "id": "sg-mrt-orchard",
                "type": "subway_station",
                "title": "Orchard",
                "subtitle": "MRT",
                "section": "MRT/LRT",
                "coordinates": {
                    "lat": 1.304292,
                    "lng": 103.832494
                },
                "line_colors": [
                    "#9C5924",
                    "#E55244"
                ],
                "main_categories": [],
                "is_new_launch": null,
                "location_type": "subway_station",
                "location_id": "sg-mrt-orchard",
                "development_id": null
            },
            {
                "id": "dtdistrict09",
                "type": "district",
                "title": "D9 - Orchard / River Valley",
                "subtitle": "District",
                "section": "District",
                "coordinates": {
                    "lat": 1.302458,
                    "lng": 103.839109
                },
                "line_colors": [],
                "main_categories": [],
                "is_new_launch": null,
                "location_type": "district",
                "location_id": "dtdistrict09",
                "development_id": null
            },
            {
                "id": "derMAQynz2P9eXeXmJV9He6A",
                "type": "cluster",
                "title": "Orchard Bel Air",
                "subtitle": "Condo",
                "section": "Project",
                "coordinates": {
                    "lat": 1.302318,
                    "lng": 103.824973
                },
                "line_colors": [],
                "main_categories": [
                    "condo"
                ],
                "is_new_launch": false,
                "location_type": null,
                "location_id": null,
                "development_id": "derMAQynz2P9eXeXmJV9He6A"
            }
        ]
    },
    "meta": {
        "endpoint_family": "autocomplete",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A public parameter is missing or invalid. No upstream call is made and the response is not billable. |
| 502 | Unexpected Upstream Response | 99.co answered with a body that is not the documented shape. The response is not billable. |
| 503 | Upstream Unavailable | 99.co was temporarily unavailable or blocked the request. The response is not billable and the request never answers 429. |

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