/api/v1/metarsStudent PilotGet Metars By State
Gets METARs for airports in one or more states
Get all current METARs for a US state — useful for statewide weather maps, regional weather dashboards, and coverage analysis.
State-based queries return observations from every reporting station in the state, including small airports with Automated Weather Observing Systems (AWOS/ASOS).
Code Examples
curl \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://api.preflightapi.io/api/v1/metars?state=value&limit=25"curl \
-H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
"https://api.preflightapi.io/api/v1/metars?state=value&limit=25"Description
Pass state codes as a single comma-separated query parameter:
GET /api/v1/metars?state=TX — METARs for Texas airports
GET /api/v1/metars?state=TX,OK,LA — METARs for multiple statesReturns paginated results of MetarDto
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| state | query | string | Comma-separated two-letter state codes (e.g., TX or TX,OK,LA) |
| cursor | query | string? | Opaque cursor value from a previous response's pagination.nextCursor field. Omit or leave null to start from the first page. |
| limit | query | integer | Maximum number of items to return per page. Minimum 1, maximum 500, default 100. |
Response Schema
Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").
Human-readable error message suitable for display.
Additional error details (only included in development environment).
Name of the external service that failed (only included for 503 errors).
Field-level validation errors (only for validation failures).
UTC timestamp when the error occurred.
Correlation ID for tracing the request.
Request path that generated the error.