# Forecast — 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 National Weather Service station metadata plus the latest and recent weather observations (temperature, wind, pressure, humidity, and METAR text) for a specified station ID.

**Category:** Weather | **Website:** [forecast.weather.gov/](https://forecast.weather.gov/) | **Docs:** [parse.bot/marketplace/a20c9f16-86c2-498d-a219-6a98e3e528eb/forecast-weather-gov-api](https://parse.bot/marketplace/a20c9f16-86c2-498d-a219-6a98e3e528eb/forecast-weather-gov-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-forecast-weather-gov-api-a20c9f16/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_latest_observation

Get the most recent weather observation for a specified NWS station. Returns detailed meteorological data including temperature, dewpoint, wind, pressure, humidity, precipitation, and cloud layers. Each station reports every 5-15 minutes; the latest observation is the most recent report available.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `station_id` | string | No | NWS station identifier, a 4-character ICAO code (e.g. KATT, KDFW, KHOU, KJFK). Thousands of stations exist across the US. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-forecast-weather-gov-api-a20c9f16/get_latest_observation \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"station_id":"<string>"}'
```

### get_observations

Get multiple recent weather observations for a station. Returns an array of observation objects ordered from most recent to oldest. Supports a limit parameter to control how many observations are returned (capped at 100). The response includes a next_cursor URL for fetching additional pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Maximum number of observations to return. Capped at 100. |
| `station_id` | string | No | NWS station identifier, a 4-character ICAO code (e.g. KATT, KDFW, KHOU, KJFK). Thousands of stations exist across the US. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-forecast-weather-gov-api-a20c9f16/get_observations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","station_id":"<string>"}'
```

### get_station_info

Get metadata about a weather station including its name, geographic coordinates, elevation, timezone, and forecast URL. Useful for discovering station capabilities and location before querying observations.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `station_id` | string | No | NWS station identifier, a 4-character ICAO code (e.g. KATT, KDFW, KHOU, KJFK). Thousands of stations exist across the US. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-forecast-weather-gov-api-a20c9f16/get_station_info \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"station_id":"<string>"}'
```
