# Glassdoor Location Search API Documentation

<p><strong>Glassdoor Location Search API Documentation</strong> Find Glassdoor locations by name: cities, states and countries with location id, type, names, label, state abbreviation, ISO country code, metro id, state id and country id. Use these ids with the salary estimate endpoint (city_id, state_id, metro_id, country_id) and with the company jobs endpoint (location_id and location_type). A name without matches returns an empty locations list and is a successful response. Costs 1 credit per successful request. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/glassdoor-api/glassdoor_location_search](https://scrappa.co/docs/glassdoor-api/glassdoor_location_search)
- **API group:** Glassdoor API
- **Endpoint:** `GET https://scrappa.co/api/glassdoor/locations/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 |
| --- | --- | --- | --- |
| `query` | string | Yes | Location name, 2 to 100 characters. Example: new york. |

## Example response

```json
{
    "data": {
        "query": "new york",
        "locations": [
            {
                "city": "New York",
                "name": "New York, NY",
                "type": "CITY",
                "label": "New York, NY",
                "state": "New York State",
                "country": "United States",
                "metro_id": 615,
                "state_id": 428,
                "long_name": "New York, NY (US)",
                "country_id": 1,
                "country_iso": "US",
                "location_id": 1132348,
                "state_abbreviation": "NY"
            },
            {
                "name": "New York State",
                "type": "STATE",
                "label": "New York State",
                "state": "New York State",
                "country": "United States",
                "metro_id": -1,
                "state_id": 428,
                "long_name": "New York State, US",
                "country_id": 1,
                "country_iso": "US",
                "location_id": 428,
                "state_abbreviation": "NY"
            },
            {
                "city": "New York Mills",
                "name": "New York Mills, NY",
                "type": "CITY",
                "label": "New York Mills, NY",
                "state": "New York State",
                "country": "United States",
                "metro_id": 881,
                "state_id": 428,
                "long_name": "New York Mills, NY (US)",
                "country_id": 1,
                "country_iso": "US",
                "location_id": 1132913,
                "state_abbreviation": "NY"
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "location_search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required or invalid query parameter. No upstream call is made. This response is not billable. |
| 503 | Invalid Source Response | Glassdoor answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Upstream Blocked | Glassdoor blocked every try. This response is not billable. |
| 503 | Service Unavailable | Glassdoor could not be reached. 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)
