> For the complete documentation index, see [llms.txt](https://chekin.gitbook.io/chekin-public-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chekin.gitbook.io/chekin-public-api/resources/locations.md).

# Locations

### **Overview**

The "Locations" endpoint allows you to retrieve detailed information about geographical locations in a JSON format. This endpoint is useful for specifying countries, regions, provinces, and municipalities. It supports filtering by country and various administrative division levels, making it easier to obtain structured location data.

### **Key Capabilities**

* **Country-Specific Data**: Retrieve detailed location data for a specified country.
* **Administrative Divisions**: Access information about regions, provinces, and municipalities.
* **Structured Responses**: Get well-structured JSON responses for easy integration with your application.
* **Flexible Queries**: Use query parameters to filter results based on country and division levels.

### **How to Use**

1. **Without specifying anything:** You will receive a list of all the countries
2. **Specify the Country:** Use the `country` query parameter to indicate the country code you are interested in.
3. **Specify Division Level**: Use the `division_level` query parameter to indicate the level of administrative division you want data for.
   * **Division Level 1:** Community (Spain)/Region (Italy and Portugal)/Department (Colombia)
   * **Division Level 2:** Province (Spain, Italy)/Municipality (Colombia)
   * **Division Level 3:** Comune (Italy). For Spanish municipalities, use [Spain Municipalities](/chekin-public-api/resources/spain-municipalities-hos-police.md) instead
   * For Spain, a request without `division_level` returns the provinces (level 2)
4. **Send search text in query parameters**
5. **Send the Request**: Make a GET request to the endpoint with the specified query parameters.
6. **Process the Response**: The response will contain detailed information about the locations, including codes, names, and types of administrative divisions.

{% hint style="info" %}
When you submit a guest, send the **code** of the division you picked (for example `division_level_2.code` = `ES-M`, or an Italian `division_level_3.code` = `420095001`), not its name. See [Location fields](/chekin-public-api/api-reference/guests/location-and-document-fields.md) for the exact keys.
{% endhint %}

{% openapi src="/files/2YNWdcD7SWYAbJN2lC4R" path="/locations-search" method="post" %}
[Chekin-Chekin-1.0.0-resolved.json](https://3564732132-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAJzL2tAGO9ZwOToBa0R%2Fuploads%2Fgit-blob-0641a0e07e27281f11fe82de446c7229bfe15c1e%2FChekin-Chekin-1.0.0-resolved.json?alt=media)
{% endopenapi %}
