---
title: "Get nearest METAR station observations."
method: GET
path: "/v1/observations/nearest"
tags: ["Observations"]
---

# Get nearest METAR station observations.

`GET /v1/observations/nearest`

## Request

- Base URL: `https://api.smarterweather.com`
- URL: `https://api.smarterweather.com/v1/observations/nearest`
- Auth: HTTP bearer

Returns the N nearest METAR stations to a point, deduplicated to
the latest observation per station (within the last 2 hours),
sorted by distance.

Pass one location: `lat` and `lon`, `zip`, or `location`. A request
without one returns `400`; a ZIP or name that does not resolve
returns `404`; while location lookup is unavailable, a `zip` or
`location` request returns `503` with `Retry-After`.

A point outside the 50 US states and DC returns `404`
`outside-coverage` with `next_steps`.

## Query parameters

- `lat` number, double
- `lon` number, double
- `zip` string
- `location` string
- `n` integer

## Response `200`

GeoJSON FeatureCollection of nearest METAR observations.

## Other responses

- `400`: Bad request.
- `404`: Resource not found: a location that cannot be resolved (unknown ZIP, unrecognised free-text location), no upstream data for the location, or a missing resource. On a route that checks coverage (its description says so), a location outside the 50 US states and DC returns type `https://smarterweather.com/errors/outside-coverage`; that and the location-not-found problem carry `next_steps` (`recommended = coverage`).
- `502`: Bad gateway. The service received an invalid response from an upstream data source. Transient; clients should retry with backoff.
- `503`: Service unavailable. An upstream dependency is unavailable or shedding load (type `service-unavailable`). Transient; retry with backoff and honor any `Retry-After` header.
- `504`: Gateway timeout. An upstream data source did not respond within the service's budget.

---

[API](https://skmtc.dev/smarterweather/apis/smarter-weather-api.md) · [All operations](https://skmtc.dev/smarterweather/apis/smarter-weather-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smarterweather/apis/smarter-weather-api/revisions/520d55a696e4?raw)
