# Weatherspark — 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 historical weather data, current METAR reports, and monthly climate summaries for any location by searching WeatherSpark's comprehensive weather database. Access detailed weather insights including temperature trends, precipitation patterns, and atmospheric conditions to power weather-dependent applications and analysis.

**Category:** Weather | **Website:** [weatherspark.com/](https://weatherspark.com/) | **Docs:** [parse.bot/marketplace/23fbb480-803b-4aad-ada8-82dd73cb3e42/weatherspark-com-api](https://parse.bot/marketplace/23fbb480-803b-4aad-ada8-82dd73cb3e42/weatherspark-com-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-weatherspark-com-api-23fbb480/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_metar_reports

Retrieve historical METAR weather reports and daily weather statistics for a specific location and date. Returns raw METAR observation strings and parsed daily summary statistics. Each METAR report contains the full decoded observation including station identifier, time, wind, visibility, and remarks.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `city_slug` | string | Yes | City slug obtained from search_locations results (e.g. 'Birmingham-Alabama-United-States'). |
| `date` | string | Yes | Date in YYYY-MM-DD format or 'today'. |
| `location_id` | string | Yes | Numeric location ID as a string, obtained from search_locations results (e.g. '14538'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-weatherspark-com-api-23fbb480/get_metar_reports \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city_slug":"<string>","date":"<string>","location_id":"<string>"}'
```

### get_weather_details

Extract aggregated monthly weather data, climate summary, and textual analysis for a location. Returns average temperatures, precipitation, wind speed, solar energy, and other climate metrics broken down by month, plus detailed textual weather descriptions. One request per location; no date parameter — data covers year-round averages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `city_slug` | string | Yes | City slug obtained from search_locations results (e.g. 'Birmingham-Alabama-United-States'). |
| `location_id` | string | Yes | Numeric location ID as a string, obtained from search_locations results (e.g. '14538'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-weatherspark-com-api-23fbb480/get_weather_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city_slug":"<string>","location_id":"<string>"}'
```

### search_locations

Search for locations by name to find their IDs and city slugs. Returns a list of matching locations with metadata including country, call signs, and URL slugs needed for other endpoints. Pagination is not supported; results are capped by the server (typically ~10 matches).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | City name or location query (e.g. 'Birmingham', 'New York'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-weatherspark-com-api-23fbb480/search_locations \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
