> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/integrations/catalog/weatherapi.com.md).

# WeatherAPI.com

Read current conditions, multi-day forecasts, historical weather, astronomy, and location search from WeatherAPI.com.

## Connectors

Choose the connector that matches your authentication method. The options below use the names shown in StackAI.

| Connector      | Authentication |
| -------------- | -------------- |
| WeatherAPI.com | API Key        |

### WeatherAPI.com

Connect to WeatherAPI.com with an API key to read current conditions, forecasts, historical weather, astronomy, and location search. Free-plan keys carry a link-back attribution requirement under WeatherAPI.com's terms.

#### Set up in WeatherAPI.com

1. Prepare the WeatherAPI.com account or service that the workflow will access. Grant access to the required resources and operations.
2. **API Key:** Your WeatherAPI.com API key, shown on your account dashboard after signup.

#### Set up in StackAI

1. Open **Settings → Connections**, add a connection, and select **WeatherAPI.com**.
2. Enter the credentials and connection details in the fields below.
3. Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.

**Connection fields**

| StackAI field | Required | What to enter                                                                                                                       |
| ------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| API Key       | Yes      | Your WeatherAPI.com API key, shown on your account dashboard after signup. [Provider instructions](https://www.weatherapi.com/my/). |

### Verify the connection

Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.

If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.

## Use an action

1. Add the required **WeatherAPI.com** action to the workflow.
2. Select a connection when the action requests one.
3. Complete the required fields. Use the reference picker when a value comes from another workflow step.
4. Run the workflow and inspect the action’s output. Check the result before using it in a later step.

## Actions

### Get Current Weather

Get the weather conditions happening right now at a place.

#### Inputs

| Field               | Type            | Required | Description                                                                                                                                     |
| ------------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Location            | string          | Yes      | The city, postcode, coordinates or IP address to look up.                                                                                       |
| Units               | select (string) | No       | Whether numbers come back in metric or imperial units. Available values: Metric (°C, kph, mm, km), Imperial (°F, mph, in, mi). Default: metric. |
| Condition language  | string          | No       | Language for the human-readable condition text.                                                                                                 |
| Include air quality | boolean         | No       | Add air-quality readings to the result. Default: false.                                                                                         |

#### Outputs

| Field              | Type    | Description                                     |
| ------------------ | ------- | ----------------------------------------------- |
| Location name      | string  | The canonical place the reading is for.         |
| Region             | string  | State, province or region.                      |
| Country            | string  | Country of the matched location.                |
| Latitude           | number  | Latitude of the matched location.               |
| Longitude          | number  | Longitude of the matched location.              |
| Local time         | string  | Current local time at the location.             |
| Time zone          | string  | IANA time zone of the location.                 |
| Condition          | string  | Plain-English summary of the weather.           |
| Condition icon URL | string  | Icon illustrating the condition.                |
| Temperature        | number  | Air temperature in the chosen units.            |
| Feels like         | number  | Apparent temperature in the chosen units.       |
| Humidity           | integer | Relative humidity as a percentage.              |
| Wind speed         | number  | Wind speed in the chosen units.                 |
| Wind direction     | string  | Compass direction the wind blows from.          |
| Precipitation      | number  | Precipitation in the chosen units.              |
| UV index           | number  | UV index.                                       |
| Is daytime         | boolean | Whether it is currently daylight there.         |
| Units              | string  | Which unit system the numbers above use.        |
| Last updated       | string  | When the provider last refreshed this reading.  |
| Air quality        | object  | Air-quality readings, when they were requested. |

### Get Weather Forecast

Get the forecast for the next few days at a place.

#### Inputs

| Field               | Type            | Required | Description                                                                                                                                     |
| ------------------- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Location            | string          | Yes      | The city, postcode, coordinates or IP address to look up.                                                                                       |
| Days                | integer         | Yes      | How many days to forecast, counting today as day 1. Minimum: 1. Maximum: 14. Default: 3.                                                        |
| Units               | select (string) | No       | Whether numbers come back in metric or imperial units. Available values: Metric (°C, kph, mm, km), Imperial (°F, mph, in, mi). Default: metric. |
| Specific date       | date            | No       | Return just one date instead of the whole run of days.                                                                                          |
| Hour of day         | integer         | No       | Return only one hour of the day instead of all 24. Minimum: 0. Maximum: 23.                                                                     |
| Condition language  | string          | No       | Language for the human-readable condition text.                                                                                                 |
| Include air quality | boolean         | No       | Add air-quality readings to the result. Default: false.                                                                                         |

#### Outputs

| Field         | Type          | Description                              |
| ------------- | ------------- | ---------------------------------------- |
| Location name | string        | The canonical place the forecast is for. |
| Country       | string        | Country of the matched location.         |
| Time zone     | string        | IANA time zone of the location.          |
| Units         | string        | Which unit system the numbers use.       |
| Days returned | integer       | How many forecast days came back.        |
| Forecast days | object\_array | One entry per forecast day.              |

### Get Historical Weather

Look up what the weather was on a past date at a place.

#### Inputs

| Field              | Type            | Required | Description                                                                                                                                     |
| ------------------ | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Location           | string          | Yes      | The city, postcode, coordinates or IP address to look up.                                                                                       |
| Date               | date            | Yes      | The past date to look up.                                                                                                                       |
| End date           | date            | No       | Optional last date of a range.                                                                                                                  |
| Units              | select (string) | No       | Whether numbers come back in metric or imperial units. Available values: Metric (°C, kph, mm, km), Imperial (°F, mph, in, mi). Default: metric. |
| Hour of day        | integer         | No       | Return only one hour of the day instead of all 24. Minimum: 0. Maximum: 23.                                                                     |
| Condition language | string          | No       | Language for the human-readable condition text.                                                                                                 |

#### Outputs

| Field         | Type          | Description                             |
| ------------- | ------------- | --------------------------------------- |
| Location name | string        | The canonical place the history is for. |
| Country       | string        | Country of the matched location.        |
| Units         | string        | Which unit system the numbers use.      |
| Days returned | integer       | How many days came back.                |
| Recorded days | object\_array | One entry per recorded day.             |

### Search Locations

Find the exact place to use in the other weather actions.

#### Inputs

| Field  | Type   | Required | Description                                    |
| ------ | ------ | -------- | ---------------------------------------------- |
| Search | string | Yes      | Part of a place name, postcode or coordinates. |

#### Outputs

| Field          | Type          | Description                          |
| -------------- | ------------- | ------------------------------------ |
| Matches        | integer       | How many places matched.             |
| Matched places | object\_array | The places that matched, best first. |

### Get Astronomy

Get sunrise, sunset and moon details for a place and date.

#### Inputs

| Field    | Type   | Required | Description                                               |
| -------- | ------ | -------- | --------------------------------------------------------- |
| Location | string | Yes      | The city, postcode, coordinates or IP address to look up. |
| Date     | date   | Yes      | The date to get sun and moon times for.                   |

#### Outputs

| Field             | Type    | Description                                      |
| ----------------- | ------- | ------------------------------------------------ |
| Location name     | string  | The canonical place these times are for.         |
| Country           | string  | Country of the matched location.                 |
| Date              | string  | The date these times apply to.                   |
| Sunrise           | string  | Local sunrise time.                              |
| Sunset            | string  | Local sunset time.                               |
| Moonrise          | string  | Local moonrise time, if the moon rises that day. |
| Moonset           | string  | Local moonset time, if the moon sets that day.   |
| Moon phase        | string  | Name of the moon phase.                          |
| Moon illumination | integer | Percentage of the moon lit.                      |
| Sun is up         | boolean | Whether the sun is currently up there.           |
| Moon is up        | boolean | Whether the moon is currently up there.          |

### Get Weather Alerts

Check for official weather warnings in force at a place.

#### Inputs

| Field    | Type   | Required | Description                                               |
| -------- | ------ | -------- | --------------------------------------------------------- |
| Location | string | Yes      | The city, postcode, coordinates or IP address to look up. |

#### Outputs

| Field         | Type          | Description                             |
| ------------- | ------------- | --------------------------------------- |
| Location name | string        | The canonical place the alerts are for. |
| Country       | string        | Country of the matched location.        |
| Alerts        | integer       | How many warnings are in force.         |
| Active alerts | object\_array | The warnings in force, if any.          |

## Important behavior

Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.

The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/integrations/catalog/weatherapi.com.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
