---
title: "Look up coordinates by city name"
url: "https://devportal.jilson.dev/apis/nominatim-city-geocoding/versions/54640638-d26d-4952-a3c1-22e9555bdefd/operations/lookupCityCoordinates"
---

> Full API specification: https://devportal.jilson.dev/apis/nominatim-city-geocoding/versions/54640638-d26d-4952-a3c1-22e9555bdefd.md

# Look up coordinates by city name

`GET` `/v1/geocode/city`

Operation ID: `lookupCityCoordinates`

Returns the highest-ranked Nominatim match for the supplied city.

## Query parameters

- `city` (string, required) - City name to geocode.
- `countrycodes` (string, optional) - Optional comma-separated ISO 3166-1 alpha-2 country-code filter.
- `accept-language` (string, optional) - Preferred language for result names.

## Responses

- `200` - Matching city coordinates.
- `400` - Invalid request.
- `401` - API key is missing or invalid.
- `429` - Rate limit exceeded.

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Nominatim City Geocoding API
  version: 1.0.0
servers:
  - url: https://86ff79c5ed.us.serverless.gateways.konggateway.tech
    description: metering-demo-jilson gateway
paths:
  /v1/geocode/city:
    get:
      operationId: lookupCityCoordinates
      summary: Look up coordinates by city name
      description: Returns the highest-ranked Nominatim match for the supplied city.
      parameters:
        - name: city
          in: query
          required: true
          description: City name to geocode.
          schema:
            type: string
          example: Toronto
        - name: countrycodes
          in: query
          required: false
          description: Optional comma-separated ISO 3166-1 alpha-2 country-code filter.
          schema:
            type: string
          example: ca
        - name: accept-language
          in: query
          required: false
          description: Preferred language for result names.
          schema:
            type: string
          example: en
      responses:
        "200":
          description: Matching city coordinates.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/GeocodingResult"
        "400":
          description: Invalid request.
        "401":
          description: API key is missing or invalid.
        "429":
          description: Rate limit exceeded.
security:
  - apiKeyAuth: []
components:
  schemas:
    GeocodingResult:
      type: object
      required:
        - lat
        - lon
        - display_name
      properties:
        place_id:
          type: integer
        display_name:
          type: string
        lat:
          type: string
          description: Latitude in decimal degrees.
        lon:
          type: string
          description: Longitude in decimal degrees.
        boundingbox:
          type: array
          items:
            type: string
        type:
          type: string
        importance:
          type: number
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: query
      name: apikey
```
