Geography

The Geography section provides reference endpoints for location lookup and search. Use these endpoints to fetch country lists, country cities, and location slugs for weather requests.

Authentication

All Geography endpoints require an API token:

  • Header: X-token: TOKEN
  • Query: ?key=TOKEN (if supported by your client flow)

Endpoints Overview

EndpointMethodPurpose
/v2/geography/countries/GETGet all available countries.
/v2/geography/countries/?country_code={code}GETGet a country by ISO code (for example US).
/v2/geography/countries/cities/?country_code={code}GETGet cities for a country code.
/v2/geography/search/?q={query}&limit={n}GETSearch locations by name.

1. Countries List

Returns all available countries with slug and ISO code.

curl --location 'https://api.meteoflow.com/v2/geography/countries/' \
--header 'X-token: TOKEN'

Response Structure

FieldDescriptionFormat
country_slugCountry slug used in API location references.String
country_nameCountry display name.String
country_codeISO 3166-1 alpha-2 country code.String

2. Country By Code

Filters countries by country_code (case-insensitive).

curl --location 'https://api.meteoflow.com/v2/geography/countries/?country_code=us' \
--header 'X-token: TOKEN'

Example result:

[
  {
    "country_slug": "united-states",
    "country_name": "United States",
    "country_code": "US"
  }
]

3. Cities By Country

Returns all indexed cities for a specific country.

curl --location 'https://api.meteoflow.com/v2/geography/countries/cities/?country_code=us' \
--header 'X-token: TOKEN'

Response Structure

FieldDescriptionFormat
countryCountry code.String
slugLocation slug for weather endpoints.String
timezone_offsetUTC offset in minutes.Number
latitudeLatitude.Number
longitudeLongitude.Number
city_nameCity name.String
country_nameCountry name.String
region_nameRegion/state name.String

Searches locations by free-text query.

curl --location 'https://api.meteoflow.com/v2/geography/search/?q=london&limit=10' \
--header 'X-token: TOKEN'

Query Parameters

ParameterRequiredDescription
qYesSearch string (for example city name).
limitNoMax number of results to return.

Response Structure

FieldDescriptionFormat
countryCountry code.String
slugLocation slug for weather endpoints.String
timezone_offsetUTC offset in minutes.Number
latitudeLatitude.Number
longitudeLongitude.Number
city_nameCity name.String
country_nameCountry name.String
region_nameRegion/state name.String