---
title: "Get location by passed coordinates (v1)"
method: GET
path: "/api/v1/references/locations/by-coordinates"
tags: ["api---references"]
---

# Get location by passed coordinates (v1)

`GET /api/v1/references/locations/by-coordinates`

## Request

- Base URL: `https://api.casafari.com`
- URL: `https://api.casafari.com/api/v1/references/locations/by-coordinates`
- Auth: HTTP bearer

Returns a location for the given coordinates with user restrictions.

## Query parameters

- `latitude` number, required
- `longitude` number, required
- `lang` string

## Response `200`

- ApiReferenceLocationV1
  - `location_id` integer, required: ID of the location.
  - `name` string, required: Name of the location.
  - `parent_id` integer, required: ID of the parent level location.
  - `administrative_level` string, required: Location administrative level.
  - `locations_structure` object[], required: Information about all the parent locations, starting from the top-most level - country.
    - `location_id` integer, required: ('Location ID, as returned by the [POST /api/v1/references/locations](/#operation/api__post__v1__references__locations) endpoint.',)
    - `name` string, required: Location name.
    - `administrative_level` string, required: Location administrative level.
    - `zip_codes` string[]: The location zip codes.
    - `level` integer, required: Location level as number.

## Other responses

- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/casafari/apis/casafari-api.md) · [All operations](https://skmtc.dev/casafari/apis/casafari-api/llms.txt) · [OpenAPI document](https://skmtc.dev/casafari/apis/casafari-api/revisions/6743b99d4bf9?raw)
