---
title: "Location by City"
method: GET
path: "/locate/{country}/{city}"
tags: ["Address Validation"]
---

# Location by City

`GET /locate/{country}/{city}`

## Request

- Base URL: `https://geocodes.envia.com`
- URL: `https://geocodes.envia.com/locate/{country}/{city}`
- Auth: none declared

**City / Locality validation**

Obtain a city specific information like state or zip code. Sometimes cities have multiple zip codes, this endpoint will return all available zip codes for the given city.

## Path parameters

- `country` string, required
- `city` string, required

## Response `200`

Successful city location

- object
  - `success` boolean: Indicates if the request was successful
  - `data` object[]: List of locations matching the city
    - `city` string: City name
    - `state` string: State code
    - `country` string: Country code
    - `zipcode` string: Zip code
    - `coordinates` object: GPS coordinates
      - `latitude` string: Latitude coordinate
      - `longitude` string: Longitude coordinate

---

[API](https://skmtc.dev/envia/apis/envia-geocodes-api-complete-documentation.md) - [All operations](https://skmtc.dev/envia/apis/envia-geocodes-api-complete-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/envia/apis/envia-geocodes-api-complete-documentation/revisions/d7c9bafb8a3c?raw)
