Skip to content
Navigation

Search locations

GET
https://api.weather.example/v1/locations

Find places whose name matches a query, best match first.

Authorization

  • bearer
    HTTP Bearer
    required

    Authorization: Bearer <token>

Query parameters

  • q
    string
    required

    A place name, such as Lisbon or Lisbon, PT.

    minLength: 2
  • limit
    optional
    integer

    How many matches to return.

    maximum: 20 · minimum: 1 · default: 5

Returns

200

Matching places.

JSON
  • data
    array of
    object
    required
    • id
      string
      required
    • name
      string
      required
    • latitude
      number
      required
      maximum: 90 · minimum: -90
    • longitude
      number
      required
      maximum: 180 · minimum: -180
    • timezone
      string
      required
    • country
      optional
      string

      ISO 3166-1 alpha-2 code.

400

The request was malformed.
JSON
  • code
    string
    required
  • message
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close