***

title: weather_api
slug: /reference/python/agents/skills/weather-api
description: Get current weather conditions for locations worldwide using WeatherAPI.com.
---------------------

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

Get current weather conditions for locations worldwide using WeatherAPI.com.

**Tools:** `get_weather`

**Requirements:** WeatherAPI.com API key (free tier available)

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

<ParamField path="tool_name" type="str" default="get_weather" toc={true}>
  Custom function name.
</ParamField>

<ParamField path="temperature_unit" type="str" default="fahrenheit" toc={true}>
  Temperature unit: `"fahrenheit"` or `"celsius"`.
</ParamField>

```python
from signalwire import AgentBase

class MyAgent(AgentBase):
    def __init__(self):
        super().__init__(name="assistant", route="/assistant")
        self.set_prompt_text("You are a helpful assistant.")
        self.add_skill("weather_api", {"api_key": "YOUR_WEATHER_API_KEY"})

agent = MyAgent()
agent.serve()
```