Custom Connector
WeatherAPI Connector
Global
The WeatherAPI Connector provides a robust interface to WeatherAPI’s services — current conditions, forecasts, historical weather, astronomy data, and more. It supports detailed weather information, location search, alerts, sports forecasts, time zones, and IP-based location lookups.
Overview
Integration Overview
This document provides a comprehensive guide for each endpoint, its purpose, configuration, and workflow support using the WeatherAPI Connector. The connector forwards HTTP GET requests to WeatherAPI. Configure the base URL via CONNECTOR_ENV_WEATHERAPI_BASE_URL and include the WeatherAPI key in the request header.
- get_current_weather. Retrieves current weather conditions.
- get_forecast_weather. Retrieves weather forecasts for specified days.
- get_historical_weather. Retrieves past weather data for a given date.
- get_future_weather. Retrieves future weather predictions.
- get_marine_weather. Retrieves marine-related weather forecasts.
- get_astronomy_data. Retrieves astronomy data like sunrise, sunset, and moon phases.
- search_locations. Searches locations by name or query string.
- get_alerts. Retrieves active weather alerts.
- get_sports_weather. Retrieves weather data for sporting events or venues.
- get_timezone_info. Retrieves time zone information for a location.
- get_ip_lookup. Performs IP-based geolocation lookup.
Documentation
Detailed Integration Documentation
Current Weather Retrieval
| Action | get_current_weather |
|---|---|
| Purpose | Retrieves current weather conditions for a specified location. |
| Configuration | Configure the base URL via CONNECTOR_ENV_WEATHERAPI_BASE_URL; include the WeatherAPI key in the request header. |
| Parameters | Required: q – location query (e.g. “London”, “90210”, or “latitude,longitude”). Optional: lang – language code (e.g. en, fr). |
| Output | Successful: JSON with temperature, wind speed, humidity, and condition text. Failure: 400/401/404/500. |
| Workflow example | Execute a GET request to /current.json?q=London and display current conditions. |
Forecast Weather Retrieval
| Action | get_forecast_weather |
|---|---|
| Purpose | Retrieves forecasted weather data for the specified location and days. |
| Parameters | Required: q – location query. days – number of forecast days. Optional: alerts (boolean), aqi (boolean). |
| Workflow example | GET /forecast.json?q=London&days=3&alerts=yes&aqi=yes |
Historical Weather Retrieval
| Action | get_historical_weather |
|---|---|
| Purpose | Retrieves historical weather data for a given location and date. |
| Parameters | Required: q – location query. dt – date (YYYY-MM-DD). |
| Workflow example | GET /history.json?q=London&dt=2024-09-01 |
Future Weather Retrieval
| Action | get_future_weather |
|---|---|
| Purpose | Retrieves future (experimental) weather forecasts. |
| Parameters | q – location query. dt – date in the future (YYYY-MM-DD). |
| Workflow example | GET /future.json?q=London&dt=2025-09-01 |
Marine Weather Retrieval
| Action | get_marine_weather |
|---|---|
| Purpose | Retrieves marine weather forecasts for oceans or seas. |
| Parameters | Required: q – marine location coordinates (latitude,longitude). |
| Workflow example | GET /marine.json?q=36.7783,-119.4179 |
Astronomy Data Retrieval
| Action | get_astronomy_data |
|---|---|
| Purpose | Retrieves astronomy data (sunrise, sunset, moon phases) for a location and date. |
| Parameters | Required: q – location query. dt – date (optional, defaults to current). |
| Workflow example | GET /astronomy.json?q=London&dt=2024-09-23 |
Location Search
| Action | search_locations |
|---|---|
| Purpose | Searches for locations matching a query string. |
| Parameters | Required: q – location name or query string. |
| Workflow example | GET /search.json?q=Paris |
Alerts Retrieval
| Action | get_alerts |
|---|---|
| Purpose | Retrieves active weather alerts for a location. |
| Parameters | Required: q – location query. |
| Workflow example | GET /alerts.json?q=London |
Sports Weather Retrieval
| Action | get_sports_weather |
|---|---|
| Purpose | Retrieves weather data for sports venues or events. |
| Parameters | Optional: q – location or venue query. |
| Workflow example | GET /sports.json?q=London |
Timezone Info Retrieval
| Action | get_timezone_info |
|---|---|
| Purpose | Retrieves time zone information for a location. |
| Parameters | Required: q – location query. |
| Workflow example | GET /timezone.json?q=London |
IP Lookup
| Action | get_ip_lookup |
|---|---|
| Purpose | Performs IP-based location lookup to retrieve location and time zone data. |
| Parameters | Required: q – IP address or auto:ip. |
| Workflow example | GET /ip.json?q=auto:ip |
Example Workflow: Forecast and Alerts Integration
| Retrieve forecast | Execute get_forecast_weather with q=London&days=3 and display a 3-day forecast. |
|---|---|
| Retrieve alerts | Execute get_alerts with q=London and display alerts alongside forecast data. |
| Show astronomy | Execute get_astronomy_data with q=London and display sunrise/sunset times. |
| Time zone info | Execute get_timezone_info with q=London and adjust time displays accordingly. |
Support
For technical support, contact custom-connectors-support@isolutions.sa.