***

title: WeatherApiSkill
slug: /reference/typescript/agents/skills/weather-api
description: Get current weather conditions for any location using the OpenWeatherMap API.
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill

Get current weather conditions for any location using the OpenWeatherMap API.

**Class:** `WeatherApiSkill`

**Tools:** `get_weather`

**Env vars:** `WEATHER_API_KEY`

<ParamField path="api_key" type="string" required={true} toc={true}>
  OpenWeatherMap API key. Falls back to the `WEATHER_API_KEY` environment variable.
</ParamField>

<ParamField path="units" type="string" default="metric" toc={true}>
  Temperature units: `"metric"` (Celsius), `"imperial"` (Fahrenheit), or
  `"standard"` (Kelvin).
</ParamField>

```typescript {6-8}
import { AgentBase, WeatherApiSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

await agent.addSkill(new WeatherApiSkill({
  units: 'imperial',
}));

agent.run();
```