# Weather API

> Weather is a current weather API that reports conditions for any city name or zip code: real-time temperature and wind speed with compass direction, in both metric and imperial units, with the location's coordinates, time zone and local time, day or night, and a UV risk level. Paid plans add a 7-day forecast with daily highs, lows, rain chance and conditions for the week ahead, and an optional hourly forecast.

**Endpoint:** `GET https://api.apiverve.com/v1/weatherforecast`  
**Category:** Weather  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/weatherforecast

## Overview

Use it as a real-time weather API for current conditions or as a weather forecast API for the week ahead. Query either a city name or a zip code to fetch real-time atmospheric readings. Responses supply temperature, wind speed, and compass heading in both metric and imperial measurements, the matched location's latitude, longitude, time zone and local time, whether it is day there, and the WHO UV risk band. Paid plans add a 7-day daily forecast with highs, lows, rain chance and precipitation totals, plus precipitation amounts, barometric pressure, apparent feels-like temperatures, visibility, and wind gust speeds.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/weatherforecast?city=San%20Francisco&forecast=true&hourly=true" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `city` | string | Yes | The city for which you want to get the current weather (e.g., San Francisco). A name shared by several places resolves to the best-known one (London is London, UK); add a state, province or country after a comma to pick another (e.g., Portland, Maine or London, Ontario). Korean and Japanese names with an administrative suffix (Seongnam-si, Shinjuku-ku) resolve too |
| `forecast` | boolean | No | Included by default. Set to false to omit the 7-day forecast and return current conditions only. |
| `hourly` | boolean | No | Set to true to add an hourly forecast: every hour from now through the end of the 7-day window.. default false. Premium field |

## Response fields

- `tempC` — number · Current temperature in degrees Celsius
- `tempF` — number · Current temperature in degrees Fahrenheit
- `windMph` — number · Wind speed in miles per hour
- `windKph` — number · Wind speed in kilometers per hour
- `windDegree` — number · Wind direction in degrees (0-360)
- `windDir` — string · Wind direction as compass point (N, S, E, W, etc.)
- `isDay` — boolean · Whether it is daytime at the location
- `uvRisk` — string · WHO exposure band for the UV index: low, moderate, high, very high or extreme
- `location` — object · The location the reading was matched to
  - `location.name` — string · Name of the matched location
  - `location.region` — string · Region or state of the matched location
  - `location.country` — string · Country of the matched location
  - `location.latitude` — number · Latitude of the matched location
  - `location.longitude` — number · Longitude of the matched location
  - `location.timezone` — string · IANA time zone of the location, e.g. America/Los_Angeles
  - `location.localTime` — string · Current local time at the location (YYYY-MM-DDTHH:mm)
- `pressureMb` — number · Atmospheric pressure in millibars · (premium)
- `pressureIn` — number · Atmospheric pressure in inches of mercury · (premium)
- `precipMm` — number · Precipitation amount in millimeters · (premium)
- `precipIn` — number · Precipitation amount in inches · (premium)
- `feelslikeC` — number · Apparent temperature in degrees Celsius · (premium)
- `feelslikeF` — number · Apparent temperature in degrees Fahrenheit · (premium)
- `visKm` — number · Visibility distance in kilometers · (premium)
- `visMiles` — number · Visibility distance in miles · (premium)
- `gustMph` — number · Wind gust speed in miles per hour · (premium)
- `gustKph` — number · Wind gust speed in kilometers per hour · (premium)
  - `forecast.0.date` — string · Forecast date in YYYY-MM-DD · (premium)
  - `forecast.0.condition` — string · Summary weather condition for the day (e.g., Sunny, Overcast) · (premium)
  - `forecast.0.maxtempC` — number · Highest temperature for the day in degrees Celsius · (premium)
  - `forecast.0.maxtempF` — number · Highest temperature for the day in degrees Fahrenheit · (premium)
  - `forecast.0.mintempC` — number · Lowest temperature for the day in degrees Celsius · (premium)
  - `forecast.0.mintempF` — number · Lowest temperature for the day in degrees Fahrenheit · (premium)
  - `forecast.0.avgtempC` — number · Average temperature for the day in degrees Celsius · (premium)
  - `forecast.0.avgtempF` — number · Average temperature for the day in degrees Fahrenheit · (premium)
  - `forecast.0.maxwindMph` — number · Maximum sustained wind speed for the day in miles per hour · (premium)
  - `forecast.0.maxwindKph` — number · Maximum sustained wind speed for the day in kilometers per hour · (premium)
  - `forecast.0.avghumidity` — number · Average relative humidity for the day as a percentage · (premium)
  - `forecast.0.uv` — number · Maximum UV index for the day · (premium)
  - `forecast.0.willItRain` — number · 1 if rain is expected during the day, 0 if not · (premium)
  - `forecast.0.chanceOfRain` — number · Probability of rain during the day as a percentage · (premium)
  - `forecast.0.willItSnow` — number · 1 if snow is expected during the day, 0 if not · (premium)
  - `forecast.0.chanceOfSnow` — number · Probability of snow during the day as a percentage · (premium)
  - `forecast.0.totalprecipMm` — number · Total precipitation for the day in millimeters · (premium)
  - `forecast.0.totalprecipIn` — number · Total precipitation for the day in inches · (premium)
  - `forecast.0.totalsnowCm` — number · Total snowfall for the day in centimeters · (premium)
  - `forecast.0.avgvisKm` — number · Average visibility for the day in kilometers · (premium)
  - `forecast.0.avgvisMiles` — number · Average visibility for the day in miles · (premium)
- `forecastSummary` — object · Derived read of the whole forecast window — when rain is expected and which way the temperature is trending · (premium)
  - `forecastSummary.rainExpectedOn` — string · Date of the first day at or above a 50 percent chance of rain, or null if none · (premium)
  - `forecastSummary.daysWithRain` — number · Number of days in the window at or above a 50 percent chance of rain · (premium)
  - `forecastSummary.tempTrend` — string · Direction of travel across the window: warming, cooling, or steady · (premium)
  - `forecastSummary.tempTrendC` — number · Change in average temperature across the window in degrees Celsius · (premium)
  - `forecastSummary.maxChanceOfRain` — number · Highest daily chance of rain across the window as a percentage · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "tempC": 13.3,
    "tempF": 55.9,
    "windMph": 4.7,
    "windKph": 7.6,
    "windDegree": 273,
    "windDir": "W",
    "isDay": false,
    "uvRisk": "low",
    "location": {
      "name": "San Francisco",
      "region": "California",
      "country": "United States of America",
      "latitude": 37.775,
      "longitude": -122.4183,
      "timezone": "America/Los_Angeles",
      "localTime": "2026-10-27T21:05"
    },
    "pressureMb": 1022,
    "pressureIn": 30.17,
    "precipMm": 0,
    "precipIn": 0,
    "feelslikeC": 13,
    "feelslikeF": 55.3,
    "visKm": 16,
    "visMiles": 9,
    "gustMph": 7.2,
    "gustKph": 11.6,
    "forecast": [
      {
        "date": "2026-09-21",
        "condition": "Sunny",
        "maxtempC": 22.5,
        "maxtempF": 72.5,
        "mintempC": 13.3,
        "mintempF": 56,
        "avgtempC": 17.7,
        "avgtempF": 63.9,
        "maxwindMph": 4.7,
        "maxwindKph": 7.6,
        "avghumidity": 48,
        "uv": 4,
        "willItRain": 0,
        "chanceOfRain": 4,
        "willItSnow": 0,
        "chanceOfSnow": 0,
        "totalprecipMm": 0,
        "totalprecipIn": 0,
        "totalsnowCm": 0,
        "avgvisKm": 10,
        "avgvisMiles": 6
      },
      {
        "date": "2026-09-22",
        "condition": "Sunny",
        "maxtempC": 22.8,
        "maxtempF": 73,
        "mintempC": 16.5,
        "mintempF": 61.7,
        "avgtempC": 19.7,
        "avgtempF": 67.5,
        "maxwindMph": 4.7,
        "maxwindKph": 7.6,
        "avghumidity": 63,
        "uv": 3.9,
        "willItRain": 0,
        "chanceOfRain": 8,
        "willItSnow": 0,
        "chanceOfSnow": 0,
        "totalprecipMm": 0.02,
        "totalprecipIn": 0,
        "totalsnowCm": 0,
        "avgvisKm": 10,
        "avgvisMiles": 6
      },
      {
        "date": "2026-09-23",
        "condition": "Overcast",
        "maxtempC": 22.8,
        "maxtempF": 73.1,
        "mintempC": 14.1,
        "mintempF": 57.4,
        "avgtempC": 18.4,
        "avgtempF": 65.2,
        "maxwindMph": 15.7,
        "maxwindKph": 25.2,
        "avghumidity": 70,
        "uv": 3.1,
        "willItRain": 1,
        "chanceOfRain": 76,
        "willItSnow": 0,
        "chanceOfSnow": 0,
        "totalprecipMm": 5.97,
        "totalprecipIn": 0.23,
        "totalsnowCm": 0,
        "avgvisKm": 9.9,
        "avgvisMiles": 6
      },
      {
        "date": "2026-09-24",
        "condition": "Partly Cloudy",
        "maxtempC": 18,
        "maxtempF": 64.5,
        "mintempC": 10.5,
        "mintempF": 50.8,
        "avgtempC": 14.3,
        "avgtempF": 57.7,
        "maxwindMph": 11,
        "maxwindKph": 17.6,
        "avghumidity": 64,
        "uv": 3.5,
        "willItRain": 0,
        "chanceOfRain": 11,
        "willItSnow": 0,
        "chanceOfSnow": 0,
        "totalprecipMm": 0.03,
        "totalprecipIn": 0,
        "totalsnowCm": 0,
        "avgvisKm": 10,
        "avgvisMiles": 6
      },
      {
        "date": "2026-09-25",
        "condition": "Sunny",
        "maxtempC": 21.3,
        "maxtempF": 70.3,
        "mintempC": 12,
        "mintempF": 53.6,
        "avgtempC": 16,
        "avgtempF": 60.8,
        "maxwindMph": 6.5,
        "maxwindKph": 10.4,
        "avghumidity": 56,
        "uv": 6,
        "willItRain": 0,
        "chanceOfRain": 4,
        "willItSnow": 0,
        "chanceOfSnow": 0,
        "totalprecipMm": 0,
        "totalprecipIn": 0,
        "totalsnowCm": 0,
        "avgvisKm": 10,
        "avgvisMiles": 6
      },
      {
        "date": "2026-09-26",
        "condition": "Sunny",
        "maxtempC": 22,
        "maxtempF": 71.5,
        "mintempC": 13,
        "mintempF": 55.3,
        "avgtempC": 17.1,
        "avgtempF": 62.8,
        "maxwindMph": 8.9,
        "maxwindKph": 14.4,
        "avghumidity": 62,
        "uv": 6,
        "willItRain": 0,
        "chanceOfRain": 8,
        "willItSnow": 0,
        "chanceOfSnow": 0,
        "totalprecipMm": 0,
        "totalprecipIn": 0,
        "totalsnowCm": 0,
        "avgvisKm": 10,
        "avgvisMiles": 6
      },
      {
        "date": "2026-09-27",
        "condition": "Overcast",
        "maxtempC": 19.3,
        "maxtempF": 66.8,
        "mintempC": 12.8,
        "mintempF": 55.1,
        "avgtempC": 16.3,
        "avgtempF": 61.3,
        "maxwindMph": 6.9,
        "maxwindKph": 11.2,
        "avghumidity": 67,
        "uv": 4,
        "willItRain": 0,
        "chanceOfRain": 36,
        "willItSnow": 0,
        "chanceOfSnow": 0,
        "totalprecipMm": 0.32,
        "totalprecipIn": 0.01,
        "totalsnowCm": 0,
        "avgvisKm": 10,
        "avgvisMiles": 6
      }
    ],
    "forecastSummary": {
      "rainExpectedOn": "2026-09-23",
      "daysWithRain": 1,
      "tempTrend": "cooling",
      "tempTrendC": -2.1,
      "maxChanceOfRain": 76
    }
  }
}
```

## Use cases

- **Delivery Route Planning** — When high winds threaten courier safety, dispatch software checks live wind speeds and compass direction across delivery zones before assigning routes, and reads the coming week of forecasts to reschedule ahead of bad days.
- **Travel Booking Portals** — Travel sites display real-time temperatures for destination cities alongside a 7-day outlook so travelers know what conditions to expect across their whole stay.
- **Smart Home Thermostats** — Home automation platforms read outdoor temperatures for local zip codes to adjust heating and cooling cycles throughout the day.
- **Outdoor Event Management** — Organizers monitor current wind speeds and temperatures by city to decide when to secure temporary staging, and use daily rain chance to pick a date or trigger a postponement early.
- **Field Service Scheduling** — Dispatchers check daily rain chance and precipitation totals for the week ahead to slot outdoor jobs like roofing or landscaping onto dry days.

## SDKs

- **npm** — `npm install @apiverve/weatherforecast` (https://www.npmjs.com/package/@apiverve/weatherforecast)
- **NuGet** — `dotnet add package APIVerve.API.Weather` (https://www.nuget.org/packages/APIVerve.API.Weather)
- **Source** — https://github.com/apiverve/weatherforecast-api

## More

- Full reference: https://docs.apiverve.com/ref/weatherforecast
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
