> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.dealmachine.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Location

Retrieve a single location by its `location_id`. Returns the full location object including type, code, name, and property count.

## Path Parameters

<ParamField path="location_id" type="string" required>
  The DealMachine location ID (e.g., `"loc_county_48201"`, `"loc_city_48106"`, `"loc_zip_code_90210"`, `"loc_state_FL"`).
</ParamField>

***

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.v2.dealmachine.com/v1/locations/loc_county_48201" \
    -H "Authorization: Bearer dm_sk_live_xxx"
  ```

  ```typescript Node.js theme={null}
  const locationId = "loc_county_48201";

  const response = await fetch(
    `https://api.v2.dealmachine.com/v1/locations/${locationId}`,
    {
      headers: {
        Authorization: `Bearer ${apiKey}`,
      },
    }
  );

  const { data } = await response.json();
  console.log(`${data.name} (${data.state}) - FIPS: ${data.code}`);
  // Harris County (TX) - FIPS: 48201
  ```

  ```python Python theme={null}
  import requests

  location_id = "loc_county_48201"

  response = requests.get(
      f"https://api.v2.dealmachine.com/v1/locations/{location_id}",
      headers={"Authorization": f"Bearer {api_key}"},
  )

  body = response.json()
  location = body["data"]
  print(f"{location['name']} ({location['state']}) - FIPS: {location['code']}")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 County theme={null}
  {
    "data": {
      "location_id": "loc_county_48201",
      "type": "county",
      "code": "48201",
      "name": "Harris County",
      "state": "TX",
      "state_name": "Texas",
      "property_count": 1842305
    }
  }
  ```

  ```json 200 ZIP Code theme={null}
  {
    "data": {
      "location_id": "loc_zip_code_90210",
      "type": "zip_code",
      "code": "90210",
      "name": "Beverly Hills",
      "state": "CA",
      "state_name": "California",
      "property_count": 15832
    }
  }
  ```

  ```json 200 City theme={null}
  {
    "data": {
      "location_id": "loc_city_48106",
      "type": "city",
      "code": "48106",
      "name": "St. Louis",
      "state": "MO",
      "state_name": "Missouri",
      "property_count": 215360
    }
  }
  ```

  ```json 200 State theme={null}
  {
    "data": {
      "location_id": "loc_state_TX",
      "type": "state",
      "code": "TX",
      "name": "Texas",
      "property_count": 12483201
    }
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": {
      "code": "location_not_found",
      "message": "No location found with ID loc_county_99999",
      "request_id": "req_abc123def456"
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": {
      "code": "invalid_api_key",
      "message": "The provided API key is invalid",
      "request_id": "req_def456ghi789"
    }
  }
  ```
</ResponseExample>

## Response Fields

The response contains a single `data` object. The shape depends on the location type. See [List Locations](/api-reference/locations/list-locations#location-object) for the full field reference.

## Credits

This endpoint does **not** consume credits. Location lookups are included with your API plan.
