Custom Connector
Weatherstack Connector
Global
The Weatherstack Connector facilitates seamless integration with the Weatherstack API, providing access to real-time, historical, and forecast weather data, plus location autocomplete for various location identifiers. It acts as a proxy supporting current weather, historical weather, weather forecasts, and location autocomplete.
Overview
Integration Overview
This document provides a detailed guide for each integration point, its purpose, configuration, and workflow support using the Weatherstack Connector.
- getCurrentWeather. Retrieves current weather data for one or multiple locations.
- getHistoricalWeather. Retrieves historical weather data for specific dates (back to 2008).
- getForecastWeather. Retrieves weather forecast data for up to 14 days into the future.
- getLocationAutocomplete. Retrieves location data for search queries to pinpoint specific locations.
Documentation
Detailed Integration Documentation
Current Weather Retrieval
| Action | getCurrentWeather |
|---|---|
| Purpose | Retrieves current weather data for one or multiple locations specified by various identifiers (city name, ZIP code, coordinates, IP address). |
| Parameters | Required: apiKey – your API key (register at weatherstack.com). query – location identifier(s) (e.g. “New York”, “99501”, “40.7831,-73.9712”, “fetch:ip”, or “London;Singapore;Shanghai” for multiple). Optional: None. |
| Configuration | Configure the base URL via CONNECTOR_ENV_WEATHERSTACK_BASE_URL. |
| Output | Successful: JSON with result, request, location, and current (temperature, weather_descriptions, humidity). Multiple locations return an array. Failure: error details (invalid-query). |
| Workflow example | Execute getCurrentWeather with apiKey and query=New York, then display current weather in an application. |
Historical Weather Retrieval
| Action | getHistoricalWeather |
|---|---|
| Purpose | Retrieves historical weather data for a specific date or date range (back to 2008) for one or multiple locations. |
| Parameters | Required: apiKey, query. Optional: historical_date (one or semicolon-separated dates), historical_date_start, historical_date_end, hourly (0 or 1). |
| Configuration | Configure the connector with the correct base URL. |
| Output | Successful: JSON with result, request, location, current, and historical (date, mintemp, maxtemp, hourly). Failure: error details (invalid-date). |
| Workflow example | Execute getHistoricalWeather with query=New York, historical_date=2015-01-21, hourly=1, then use the data for historical analysis. |
Weather Forecast Retrieval
| Action | getForecastWeather |
|---|---|
| Purpose | Retrieves weather forecast data for up to 14 days into the future for one or multiple locations. |
| Parameters | Required: apiKey, query. Optional: forecast_days (integer, e.g. 7). |
| Configuration | Configure the connector with the correct base URL. |
| Output | Successful: JSON with result, request, location, current, and forecast (date, mintemp, maxtemp). Failure: error details (invalid-query). |
| Workflow example | Execute getForecastWeather with query=New York and forecast_days=7 for planning or forecasting applications. |
Location Autocomplete Retrieval
| Action | getLocationAutocomplete |
|---|---|
| Purpose | Retrieves location data for search queries to pinpoint specific locations. |
| Parameters | Required: apiKey, query (location search query, e.g. “London”). Optional: None. |
| Configuration | Configure the connector with the correct base URL. |
| Output | Successful: JSON with result, request, and results (location objects: name, country, lat, lon). Failure: error details (invalid-query). |
| Workflow example | Execute getLocationAutocomplete with query=London, then use the identifiers to fetch weather data for specific locations. |
Example Workflow: Weather Data Retrieval and Location Selection
| Retrieve location data | Use getLocationAutocomplete with query=London to fetch location identifiers. |
|---|---|
| Query current weather | Execute getCurrentWeather with query=London to display conditions in a dashboard. |
| Explore historical weather | Execute getHistoricalWeather with historical_date=2015-01-21 and hourly=1 for research or trend analysis. |
| Fetch forecast | Execute getForecastWeather with forecast_days=7 for a weather forecasting application. |
Support
For technical support, contact custom-connectors-support@isolutions.sa.