> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/m20prs/Sky-AI-Forecast/llms.txt
> Use this file to discover all available pages before exploring further.

# Open-Meteo API reference

> The two Open-Meteo API endpoints used by Sky AI Forecast: geocoding and weather forecast.

<Note>
  Both endpoints are completely free and require no API key or account registration.
</Note>

Sky AI Forecast calls two Open-Meteo endpoints. First, the geocoding endpoint resolves a city name to coordinates. Those coordinates are then passed to the forecast endpoint to retrieve weather data.

***

## Geocoding endpoint

```
GET https://geocoding-api.open-meteo.com/v1/search
```

Converts a city name into geographic coordinates plus display metadata.

### Parameters

<ParamField query="name" type="string" required>
  City name to search for (e.g. `London`, `Tokyo`, `New York`).
</ParamField>

<ParamField query="count" type="integer" default="1">
  Maximum number of results to return. Sky AI Forecast always passes `count=1` to take the single best match.
</ParamField>

### Example request

```
GET https://geocoding-api.open-meteo.com/v1/search?name=London&count=1
```

### Example response

```json theme={null}
{
  "results": [
    {
      "name": "London",
      "country": "United Kingdom",
      "latitude": 51.5085,
      "longitude": -0.1257
    }
  ]
}
```

### Response fields used by the app

The app reads `results[0]` and extracts the following fields:

<ResponseField name="results" type="object[]">
  Array of matching locations. The app always reads index `0`.

  <Expandable title="properties">
    <ResponseField name="name" type="string" required>
      Display name of the city, shown in the UI.
    </ResponseField>

    <ResponseField name="country" type="string" required>
      Full country name, shown alongside the city name.
    </ResponseField>

    <ResponseField name="latitude" type="number" required>
      Latitude in decimal degrees. Passed to the forecast endpoint.
    </ResponseField>

    <ResponseField name="longitude" type="number" required>
      Longitude in decimal degrees. Passed to the forecast endpoint.
    </ResponseField>
  </Expandable>
</ResponseField>

***

## Forecast endpoint

```
GET https://api.open-meteo.com/v1/forecast
```

Returns current conditions, hourly data, and a 16-day daily outlook for a given location.

### Full URL built by the app

```
https://api.open-meteo.com/v1/forecast?latitude=LAT&longitude=LON&current=temperature_2m,relative_humidity_2m,weather_code&hourly=temperature_2m,weather_code&daily=temperature_2m_max,temperature_2m_min,weather_code&forecast_days=16&timezone=auto
```

### Parameters

<ParamField query="latitude" type="number" required>
  Latitude of the location, taken from the geocoding result.
</ParamField>

<ParamField query="longitude" type="number" required>
  Longitude of the location, taken from the geocoding result.
</ParamField>

<ParamField query="current" type="string" required>
  Comma-separated list of current-condition variables to include. The app requests:
  `temperature_2m`, `relative_humidity_2m`, `weather_code`.
</ParamField>

<ParamField query="hourly" type="string" required>
  Comma-separated list of hourly variables to include. The app requests:
  `temperature_2m`, `weather_code`.
</ParamField>

<ParamField query="daily" type="string" required>
  Comma-separated list of daily aggregate variables to include. The app requests:
  `temperature_2m_max`, `temperature_2m_min`, `weather_code`.
</ParamField>

<ParamField query="forecast_days" type="integer" default="16">
  Number of days of forecast data to return. Fixed at `16`.
</ParamField>

<ParamField query="timezone" type="string" default="auto">
  Timezone for time values. Set to `auto` so Open-Meteo infers the local timezone from the coordinates.
</ParamField>

### Response fields used by the app

<ResponseField name="current" type="object">
  Current weather conditions at the time of the request.

  <Expandable title="properties">
    <ResponseField name="current.temperature_2m" type="number" required>
      Current air temperature at 2 m height, in °C.
    </ResponseField>

    <ResponseField name="current.relative_humidity_2m" type="number" required>
      Current relative humidity at 2 m height, in %.
    </ResponseField>

    <ResponseField name="current.weather_code" type="integer" required>
      WMO weather interpretation code describing current conditions. See the [Weather codes reference](/reference/weather-codes).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="hourly" type="object">
  Hourly data arrays. Each array is ordered chronologically and shares the same index with `hourly.time`.

  <Expandable title="properties">
    <ResponseField name="hourly.time" type="string[]" required>
      ISO 8601 timestamp for each hour (e.g. `"2024-06-01T14:00"`).
    </ResponseField>

    <ResponseField name="hourly.temperature_2m" type="number[]" required>
      Hourly air temperature at 2 m height, in °C.
    </ResponseField>

    <ResponseField name="hourly.weather_code" type="integer[]" required>
      WMO weather code for each hour.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="daily" type="object">
  Daily aggregate arrays. Each array is ordered by date and shares the same index with `daily.time`.

  <Expandable title="properties">
    <ResponseField name="daily.time" type="string[]" required>
      Date string for each day (e.g. `"2024-06-01"`).
    </ResponseField>

    <ResponseField name="daily.temperature_2m_max" type="number[]" required>
      Daily high temperature, in °C. Displayed in the 16-day outlook.
    </ResponseField>

    <ResponseField name="daily.temperature_2m_min" type="number[]">
      Daily low temperature, in °C. Fetched but not currently displayed in the UI.
    </ResponseField>

    <ResponseField name="daily.weather_code" type="integer[]" required>
      WMO weather code for each day.
    </ResponseField>
  </Expandable>
</ResponseField>
