# Weather Forecast API - Weather Company Hourly, 15-Day, History (`nabeelbaghoor/weather-forecast-hourly-daily-history-api`) Actor

Weather forecast and historical weather data from The Weather Company API on api.weather.com: current conditions (Currents On Demand), hourly and 3 to 15 day daily forecasts, 24 hour history and 30 day daily summaries by coordinates, airport, postal code or place ID. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/weather-forecast-hourly-daily-history-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Business, Integrations
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 current conditions returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Weather Forecast API - Weather Company Hourly, 15-Day, History

Pull current conditions, hourly and 15 day daily weather forecasts, and hourly and daily weather history from The Weather Company API (api.weather.com) with your own API key, as one clean dataset row per hour or day.

Works with the official Weather Company Data APIs: Currents On Demand, Daily Forecast (3, 5, 7, 10 and 15 days), Hourly Forecast (6 hours to 15 days), Historical Conditions Hourly and Historical Conditions Daily Summary. Give coordinates, airport codes, postal codes or place IDs, and the actor turns the API's parallel arrays into deduplicated rows you can download as JSON, CSV or Excel, schedule, or feed into dashboards, logistics and energy planning, retail demand models, Google Sheets and AI agents. Bring your own API key.

BYOK, not live-tested: every product, path, parameter and enum comes from The Weather Company's documentation on developer.weather.com, but the actor has not been run against a live Weather Company key, and the API gateway rejects unknown keys before routing, so the routes could not be confirmed with a test call.

### What it does

- **Daily forecast**: 3, 5, 7, 10 or 15 days, one row per day with high and low temperature, narrative, precipitation chance and amount (rain, snow, ice), sunrise, sunset, moonrise, moonset and moon phase, plus the day (7am to 7pm) and night (7pm to 7am) parts with cloud cover, humidity, wind, UV index, thunder risk and weather phrases.
- **Hourly forecast**: 6 hours to 15 days (360 hours), one row per hour with temperature, feels like, dew point, precipitation chance, type and amount, humidity, pressure, visibility, wind speed, gusts and direction, UV index and weather phrase.
- **Current conditions**: Currents On Demand, The Weather Company's blend of surface observations, radar, satellite, lightning and short range models at 4 km resolution, with temperature, feels like, 24 hour high and low, precipitation and snow over 1, 6 and 24 hours, pressure tendency, visibility, cloud ceiling and UV.
- **Hourly history**: the past 24 hours of observed weather, one row per hour.
- **Daily history**: the past 30 days of observed daily highs, lows, precipitation, rain, snow and day and night weather phrases.
- **Any location**: latitude and longitude, IATA or ICAO airport codes, postal codes with their country, or Weather Company place IDs, mixed freely in one run.
- **Units and languages**: English, Metric, Hybrid UK or Metric SI units, and translated narratives and phrases in about 90 language codes.
- **Pay only for results**: refused and empty locations are recorded as a free row that says why, never charged.

### How to get an API key

The Weather Company sells API access as data packages (for example the API Developer Package or the Standard Weather Data Package) through weathercompany.com, with documentation on developer.weather.com. Request a trial or a package, and The Weather Company issues an API key. Paste it into the API key field, or set the DATA_API_KEY secret. The API requires the key as the apiKey query parameter, so it is sent only to api.weather.com and is removed from everything the actor logs. Each product, and each forecast length, is licensed separately: a key opens only what your contract covers.

### Input

| Field | Modes | Description |
| --- | --- | --- |
| `mode` | all | `dailyForecast` (default), `hourlyForecast`, `current`, `historyHourly` or `historyDaily` |
| `locations` | all | One per line: `33.74,-84.39`, `ATL`, `KATL`, `30301:US`, `SW1A 1AA:GB` or a 64 character place ID |
| `dailyDuration` | daily forecast | `3day`, `5day`, `7day` (default), `10day`, `15day` |
| `hourlyDuration` | hourly forecast | `6hour`, `12hour`, `1day`, `2day` (default), `3day`, `10day`, `15day` |
| `units` | all | `m` Metric (default), `e` English, `h` Hybrid UK, `s` Metric SI |
| `language` | all | Language code for translated fields, default `en-US` |
| `maxResults` | all | Row ceiling for the run (default 100) |
| `requestsPerMinute` | all | Pacing, default 60 |
| `apiKey` | all | Your Weather Company API key (or the DATA_API_KEY secret) |

Example: a 15 day forecast for Atlanta and London Heathrow in metric units.

```json
{
    "mode": "dailyForecast",
    "locations": ["33.74,-84.39", "LHR"],
    "dailyDuration": "15day",
    "units": "m"
}
```

### Example output

An illustrative daily forecast row, shaped like the documented Daily Forecast response (values are an example, not real data). Every field the API returns for the day is kept; only some are shown.

```json
{
    "mode": "dailyForecast",
    "modeLabel": "Daily forecast",
    "recordType": "dailyForecast",
    "location": "33.74,-84.39",
    "locationType": "geocode",
    "duration": "7day",
    "unitSystem": "m",
    "found": true,
    "timeLocal": "2026-10-17T07:00:00-0400",
    "timeUtc": "2026-10-17T11:00:00.000Z",
    "conditions": "Mostly Sunny",
    "tempNow": null,
    "tempHigh": 27,
    "tempLow": 12,
    "feelsLike": null,
    "humidityPct": 40,
    "windSpeedValue": 13,
    "windFrom": "WSW",
    "precipChancePct": 3,
    "precipAmount": 0,
    "dayOfWeek": "Saturday",
    "narrative": "Mostly sunny. Highs in the upper 20s and lows in the low teens.",
    "temperatureMax": 27,
    "temperatureMin": 12,
    "calendarDayTemperatureMax": 27,
    "qpfSnow": 0,
    "sunriseTimeLocal": "2026-10-17T07:48:10-0400",
    "sunsetTimeLocal": "2026-10-17T19:02:44-0400",
    "moonPhase": "Waxing Crescent",
    "day": { "daypartName": "Saturday", "wxPhraseLong": "Mostly Sunny", "precipChance": 3, "uvIndex": 5, "windPhrase": "Winds WSW at 10 to 15 km/h." },
    "night": { "daypartName": "Saturday night", "wxPhraseLong": "Clear", "precipChance": 2, "uvIndex": 0, "windPhrase": "Winds light and variable." },
    "expirationTimeUtc": 1792234800,
    "retrievedAt": "2026-10-16T21:00:00.000Z",
    "note": null
}
```

### FAQ

#### What is The Weather Company API?

The Weather Company (the business behind weather.com and Weather Underground, owned by Francisco Partners) sells weather data through REST APIs on api.weather.com. Its point APIs return current conditions from Currents On Demand, daily and hourly forecasts, historical conditions, alerts, lifestyle indices and more for any latitude and longitude, airport, postal code or place ID, authenticated with an API key.

#### Do I need my own Weather Company API key?

Yes. This is a bring-your-own-key actor: it calls The Weather Company with your key, under your licence and terms. A missing, rejected or exhausted key ends the run cleanly with a status message that explains what to change, and nothing is charged.

#### Why does my key work for a 7 day forecast but not a 15 day forecast?

The Weather Company licenses every forecast length as its own product, and a key that is not authorized for a length is answered with 401 Unauthorized. The API Developer Package covers the 7 day daily and 1 day hourly forecasts and Currents On Demand; 15 day forecasts belong to the Enhanced Forecast package. Pick a length your contract covers.

#### How far back does the weather history go?

Historical Conditions Hourly returns the past 24 hours and Historical Conditions Daily Summary the past 30 days, both from the Currents On Demand system. Older archives (History on Demand) are a separate Weather Company product that this actor does not call.

#### Can I look up weather by airport or postal code?

Yes. A 3 letter code such as ATL is read as an IATA airport, a 4 letter code such as KATL as an ICAO airport, and a postal code needs its country after a colon, such as 30301:US or 75001:FR. Coordinates and place IDs work too.

#### Why is the first day's high temperature empty in the afternoon?

After 3pm local time The Weather Company nulls the current day's daytime high, since it has already happened. The actor then fills tempHigh from calendarDayTemperatureMax, the midnight to midnight high, as the documentation recommends.

#### What do I pay?

Pay per result: 0.01 USD per current conditions row and 0.005 USD per forecast or history hour or day. Refused and empty locations are never charged. Your Weather Company licence is billed separately by The Weather Company, and each location is one API call against it.

#### What happens if my key is wrong or my allowance runs out?

A 401 (wrong key, or a product your licence does not cover) or a 403 (key not authorized, or allowance used up) ends the run cleanly with the API's own words. Rate limits (429) and server errors are waited out and retried. A location the API refuses (400) or has no data for (204) becomes a free row with the reason, and the run moves on.

### Pricing

| Event | Price | Charged for |
| --- | --- | --- |
| `current-conditions` | 0.01 USD | Each location's current observation |
| `forecast-or-history-period` | 0.005 USD | Each forecast or history hour or day |

### Keyword map

weather API, weather forecast API, The Weather Company API, weather.com API, api.weather.com, Weather Company Data, 15 day forecast, 10 day forecast, hourly weather forecast, current weather conditions, Currents On Demand, historical weather data, weather history API, past 30 days weather, airport weather, weather by zip code, weather by coordinates, precipitation forecast, temperature forecast, wind forecast, UV index.

### Terms and data use

Use of The Weather Company APIs is governed by the content licence agreement you sign with The Weather Company, which decides the products, forecast lengths and call volumes your key may use. The public trial terms (weathercompany.com/weather-data-service-trial-evaluation-terms) limit trial keys to internal evaluation, forbid production use, sublicensing, distribution to third parties and derivative works, and require deleting all data within five business days after the trial ends. The API documentation sets cache lifetimes through Cache-Control max-age headers and an expirationTimeUtc field that can be used to expire records. Run this actor with your own key, keep the results within what your licence allows, and check retention and redistribution with The Weather Company before storing or sharing the data. This actor is not affiliated with or endorsed by The Weather Company.

# Actor input Schema

## `mode` (type: `string`):

Daily forecast gives one row per day (3 to 15 days) with day and night parts. Hourly forecast gives one row per hour (6 hours to 15 days). Current conditions gives one row per location from Currents On Demand. Hourly history gives the past 24 hours, one row per hour. Daily history gives the past 30 days, one row per day. Each product and each forecast duration must be on your Weather Company licence.

## `locations` (type: `array`):

One location per line: latitude,longitude (33.74,-84.39), a 3 letter IATA airport code (ATL), a 4 letter ICAO airport code (KATL), a postal code with its 2 letter country code (30301:US, SW1A 1AA:GB) or a 64 character Weather Company place ID. Each location is one API request.

## `dailyDuration` (type: `string`):

Daily forecast only. Each length is a separately licensed product: a key that does not cover it is refused.

## `hourlyDuration` (type: `string`):

Hourly forecast only. Each length is a separately licensed product: 2 days is in the Core package, 15 days in the Enhanced Forecast package.

## `units` (type: `string`):

Unit system for temperatures, precipitation, wind speed, pressure and visibility.

## `language` (type: `string`):

Language code for translated fields such as narratives, weather phrases, day names and wind directions, for example en-US, en-GB, de-DE, fr-FR, es-MX, ja-JP or zh-CN.

## `maxResults` (type: `integer`):

The most rows this run returns and charges for. A 15 day hourly forecast is 360 rows per location.

## `requestsPerMinute` (type: `integer`):

Pacing. A rate limit answer is waited out and retried.

## `apiKey` (type: `string`):

Your own Weather Company API key for api.weather.com. Stored as a secret and sent only to api.weather.com as the apiKey parameter the API requires; it is never logged. You can instead set the DATA_API_KEY environment secret.

## Actor input object example

```json
{
  "mode": "dailyForecast",
  "locations": [
    "33.74,-84.39",
    "JFK"
  ],
  "dailyDuration": "7day",
  "hourlyDuration": "2day",
  "units": "m",
  "language": "en-US",
  "maxResults": 100,
  "requestsPerMinute": 60
}
```

# Actor output Schema

## `records` (type: `string`):

One row per observation, hour or day.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locations": [
        "33.74,-84.39",
        "JFK"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/weather-forecast-hourly-daily-history-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "locations": [
        "33.74,-84.39",
        "JFK",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/weather-forecast-hourly-daily-history-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locations": [
    "33.74,-84.39",
    "JFK"
  ]
}' |
apify call nabeelbaghoor/weather-forecast-hourly-daily-history-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/weather-forecast-hourly-daily-history-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dahNzhJChbZky5GUj/builds/9KGM7qxTqu5pG8hcU/openapi.json
