# Weatherunderground — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Get real-time weather data and 10-day forecasts for any location, with access to current conditions like temperature, humidity, and wind speed. Search for locations and receive detailed weather narratives to plan your day or week ahead.

**Category:** Weather | **Website:** [weatherunderground.com/](https://weatherunderground.com/) | **Docs:** [parse.bot/marketplace/988c7b53-9c2c-47b9-a27d-6b30db321173/weatherunderground-com-api](https://parse.bot/marketplace/988c7b53-9c2c-47b9-a27d-6b30db321173/weatherunderground-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/weatherunderground/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get current conditions

Get current weather observations for a specific location using its geocode. Returns temperature, wind speed, wind direction, humidity, cloud cover, visibility, pressure, precipitation amounts, and a human-readable weather phrase. Geocode is obtained from search_locations.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `geocode` | string | Yes | Latitude,longitude string obtained from search_locations (e.g., '40.713,-74.006'). |
| `units` | string | No | Unit system: 'e' for Imperial (°F, mph, inches), 'm' for Metric (°C, kph, mm). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/weatherunderground/get-current-conditions \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"geocode":"<string>","units":"<string>"}'
```

### Get forecast

Get a detailed 10-day daily weather forecast for a specific location. Returns arrays of daily values including day of week, temperature highs/lows, narrative descriptions, and detailed daypart (day/night) forecasts with precipitation chances, wind, and conditions. Geocode is obtained from search_locations.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `geocode` | string | Yes | Latitude,longitude string obtained from search_locations (e.g., '40.713,-74.006'). |
| `units` | string | No | Unit system: 'e' for Imperial (°F, mph), 'm' for Metric (°C, kph). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/weatherunderground/get-forecast \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"geocode":"<string>","units":"<string>"}'
```

### Search locations

Search for locations by city name, zip code, or address. Returns matching locations with geocode coordinates and place IDs. Use the geocode from results as input to get_current_conditions and get_forecast.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | City, zip code, or address to search for (e.g., 'New York', '90210', 'Los Angeles'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/weatherunderground/search-locations \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.