> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> API reference for Open Weather Map: every `openweathermap.api.*` operation with input and output types.

Every `openweathermap.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

<Info>
  **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).
</Info>

## History

### timeMachine

`history.timeMachine`

Get historical weather data for a specific timestamp (available from 1979-01-01)

**Risk:** `read`

```ts theme={null}
await corsair.openweathermap.api.history.timeMachine({});
```

**Input**

| Name    | Type                             | Required | Description                                                       |
| ------- | -------------------------------- | -------- | ----------------------------------------------------------------- |
| `lat`   | `number`                         | Yes      | Latitude of the location                                          |
| `lon`   | `number`                         | Yes      | Longitude of the location                                         |
| `dt`    | `number`                         | Yes      | Unix timestamp (UTC) for the requested historical date            |
| `units` | `standard \| metric \| imperial` | No       | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit) |
| `lang`  | `string`                         | No       | Language code for weather descriptions                            |

**Output**

| Name              | Type       | Required | Description |
| ----------------- | ---------- | -------- | ----------- |
| `lat`             | `number`   | Yes      | —           |
| `lon`             | `number`   | Yes      | —           |
| `timezone`        | `string`   | Yes      | —           |
| `timezone_offset` | `number`   | Yes      | —           |
| `data`            | `object[]` | Yes      | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
      dt: number,
      sunrise: number,
      sunset: number,
      temp: number,
      feels_like: number,
      pressure: number,
      humidity: number,
      dew_point: number,
      uvi?: number,
      clouds: number,
      visibility?: number,
      wind_speed: number,
      wind_deg: number,
      wind_gust?: number,
      weather: {
        id: number,
        main: string,
        description: string,
        icon: string
      }[],
      rain?: {
        1h: number
      },
      snow?: {
        1h: number
      }
    }[]
    ```
  </Accordion>
</AccordionGroup>

***

## Summary

### daySummary

`summary.daySummary`

Get aggregated weather summary for a specific date (temperature, wind, precipitation)

**Risk:** `read`

```ts theme={null}
await corsair.openweathermap.api.summary.daySummary({});
```

**Input**

| Name    | Type                             | Required | Description                                                       |
| ------- | -------------------------------- | -------- | ----------------------------------------------------------------- |
| `lat`   | `number`                         | Yes      | Latitude of the location                                          |
| `lon`   | `number`                         | Yes      | Longitude of the location                                         |
| `date`  | `string`                         | Yes      | Date in YYYY-MM-DD format                                         |
| `units` | `standard \| metric \| imperial` | No       | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit) |
| `lang`  | `string`                         | No       | Language code for weather descriptions                            |
| `tz`    | `string`                         | No       | Timezone offset in ±XX:XX format (e.g. +05:30)                    |

**Output**

| Name            | Type     | Required | Description |
| --------------- | -------- | -------- | ----------- |
| `lat`           | `number` | Yes      | —           |
| `lon`           | `number` | Yes      | —           |
| `tz`            | `string` | Yes      | —           |
| `date`          | `string` | Yes      | —           |
| `units`         | `string` | Yes      | —           |
| `cloud_cover`   | `object` | Yes      | —           |
| `humidity`      | `object` | Yes      | —           |
| `precipitation` | `object` | Yes      | —           |
| `temperature`   | `object` | Yes      | —           |
| `pressure`      | `object` | Yes      | —           |
| `wind`          | `object` | Yes      | —           |

<AccordionGroup>
  <Accordion title="cloud_cover full type">
    ```ts theme={null}
    {
      afternoon: number
    }
    ```
  </Accordion>

  <Accordion title="humidity full type">
    ```ts theme={null}
    {
      afternoon: number
    }
    ```
  </Accordion>

  <Accordion title="precipitation full type">
    ```ts theme={null}
    {
      total: number
    }
    ```
  </Accordion>

  <Accordion title="temperature full type">
    ```ts theme={null}
    {
      min: number,
      max: number,
      afternoon: number,
      night: number,
      evening: number,
      morning: number
    }
    ```
  </Accordion>

  <Accordion title="pressure full type">
    ```ts theme={null}
    {
      afternoon: number
    }
    ```
  </Accordion>

  <Accordion title="wind full type">
    ```ts theme={null}
    {
      max: {
        speed: number,
        direction: number
      }
    }
    ```
  </Accordion>
</AccordionGroup>

***

### overview

`summary.overview`

Get a human-readable weather overview text for a location and date

**Risk:** `read`

```ts theme={null}
await corsair.openweathermap.api.summary.overview({});
```

**Input**

| Name    | Type                             | Required | Description                                                       |
| ------- | -------------------------------- | -------- | ----------------------------------------------------------------- |
| `lat`   | `number`                         | Yes      | Latitude of the location                                          |
| `lon`   | `number`                         | Yes      | Longitude of the location                                         |
| `date`  | `string`                         | No       | Date in YYYY-MM-DD format (defaults to today)                     |
| `units` | `standard \| metric \| imperial` | No       | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit) |

**Output**

| Name               | Type     | Required | Description |
| ------------------ | -------- | -------- | ----------- |
| `lat`              | `number` | Yes      | —           |
| `lon`              | `number` | Yes      | —           |
| `tz`               | `string` | Yes      | —           |
| `date`             | `string` | Yes      | —           |
| `units`            | `string` | Yes      | —           |
| `weather_overview` | `string` | Yes      | —           |

***

## Weather

### oneCall

`weather.oneCall`

Get current weather, minutely/hourly/daily forecasts, and weather alerts for a location

**Risk:** `read`

```ts theme={null}
await corsair.openweathermap.api.weather.oneCall({});
```

**Input**

| Name      | Type                                                 | Required | Description                                                                  |
| --------- | ---------------------------------------------------- | -------- | ---------------------------------------------------------------------------- |
| `lat`     | `number`                                             | Yes      | Latitude of the location                                                     |
| `lon`     | `number`                                             | Yes      | Longitude of the location                                                    |
| `exclude` | `current \| minutely \| hourly \| daily \| alerts[]` | No       | Parts to exclude from the response: current, minutely, hourly, daily, alerts |
| `units`   | `standard \| metric \| imperial`                     | No       | Units: standard (Kelvin), metric (Celsius), imperial (Fahrenheit)            |
| `lang`    | `string`                                             | No       | Language code for weather descriptions                                       |

**Output**

| Name              | Type       | Required | Description |
| ----------------- | ---------- | -------- | ----------- |
| `lat`             | `number`   | Yes      | —           |
| `lon`             | `number`   | Yes      | —           |
| `timezone`        | `string`   | Yes      | —           |
| `timezone_offset` | `number`   | Yes      | —           |
| `current`         | `object`   | No       | —           |
| `minutely`        | `object[]` | No       | —           |
| `hourly`          | `object[]` | No       | —           |
| `daily`           | `object[]` | No       | —           |
| `alerts`          | `object[]` | No       | —           |

<AccordionGroup>
  <Accordion title="current full type">
    ```ts theme={null}
    {
      dt: number,
      sunrise?: number,
      sunset?: number,
      temp: number,
      feels_like: number,
      pressure: number,
      humidity: number,
      dew_point: number,
      uvi: number,
      clouds: number,
      visibility?: number,
      wind_speed: number,
      wind_deg: number,
      wind_gust?: number,
      weather: {
        id: number,
        main: string,
        description: string,
        icon: string
      }[],
      rain?: {
        1h: number
      },
      snow?: {
        1h: number
      }
    }
    ```
  </Accordion>

  <Accordion title="minutely full type">
    ```ts theme={null}
    {
      dt: number,
      precipitation: number
    }[]
    ```
  </Accordion>

  <Accordion title="hourly full type">
    ```ts theme={null}
    {
      dt: number,
      temp: number,
      feels_like: number,
      pressure: number,
      humidity: number,
      dew_point: number,
      uvi: number,
      clouds: number,
      visibility?: number,
      wind_speed: number,
      wind_deg: number,
      wind_gust?: number,
      weather: {
        id: number,
        main: string,
        description: string,
        icon: string
      }[],
      pop: number,
      rain?: {
        1h: number
      },
      snow?: {
        1h: number
      }
    }[]
    ```
  </Accordion>

  <Accordion title="daily full type">
    ```ts theme={null}
    {
      dt: number,
      sunrise: number,
      sunset: number,
      moonrise: number,
      moonset: number,
      moon_phase: number,
      summary?: string,
      temp: {
        day: number,
        min: number,
        max: number,
        night: number,
        eve: number,
        morn: number
      },
      feels_like: {
        day: number,
        night: number,
        eve: number,
        morn: number
      },
      pressure: number,
      humidity: number,
      dew_point: number,
      wind_speed: number,
      wind_deg: number,
      wind_gust?: number,
      weather: {
        id: number,
        main: string,
        description: string,
        icon: string
      }[],
      clouds: number,
      pop: number,
      rain?: number,
      snow?: number,
      uvi: number
    }[]
    ```
  </Accordion>

  <Accordion title="alerts full type">
    ```ts theme={null}
    {
      sender_name: string,
      event: string,
      start: number,
      end: number,
      description: string,
      tags: string[]
    }[]
    ```
  </Accordion>
</AccordionGroup>

***
