> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# weather_api

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

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

**Tools:** `get_weather`

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

**`api_key`** `str` — required

WeatherAPI.com API key. Falls back to the `WEATHER_API_KEY` environment variable.

---

**`tool_name`** `str` — default: get_weather

Custom function name.

---

**`temperature_unit`** `str` — default: fahrenheit

Temperature unit: `"fahrenheit"` or `"celsius"`.

---

```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()
```