Airspace
GET/api/v1/airspaces/by-classesPrivate Pilot

Get By Classes

Gets controlled airspaces filtered by airspace class (B, C, or D).

Query airspace boundaries by class (B, C, D, E) within a geographic area — essential for route planning and airspace awareness applications.

US airspace is divided into controlled classes: Class A (above FL180), Class B (major airports like JFK, LAX), Class C (busy airports with radar), Class D (airports with control towers), and Class E (general controlled airspace). VFR pilots need clearance to enter B and C airspace.

Code Examples

curl \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://api.preflightapi.io/api/v1/airspaces/by-classes?classes=value&limit=25"
{
  "data": [
    {
      "name": "NEW YORK CLASS B",
      "airspaceClass": "B",
      "lowerAltFtMsl": 0,
      "upperAltFtMsl": 7000,
      "boundary": {
        "type": "Polygon",
        "coordinates": [[ [-74.2, 40.4], [-73.5, 40.4], [-73.5, 40.9], [-74.2, 40.9], [-74.2, 40.4] ]]
      }
    }
  ]
}

Field Reference

airspaceClass
Airspace classification: B (busiest airports, clearance required), C (radar service, contact required), D (control tower), E (general controlled). Each has different VFR entry requirements.
lowerAltFtMsl / upperAltFtMsl
The vertical extent of this airspace shelf in feet MSL. Class B airspace typically has multiple shelves at different altitudes (like an upside-down wedding cake).
boundary
GeoJSON Polygon describing the horizontal boundary. Render directly on web maps using Leaflet, Mapbox GL, or Google Maps Data Layer.

Description

GET /api/v1/airspaces/by-classes?classes=B — all Class B airspaces
GET /api/v1/airspaces/by-classes?classes=B,C,D — Class B, C, and D airspaces

Returns paginated results of AirspaceDto

Parameters

NameInTypeDescription
classesquerystringComma-separated airspace classes: B, C, or D
cursorquerystring?Opaque cursor value from a previous response's pagination.nextCursor field. Omit or leave null to start from the first page.
limitqueryintegerMaximum number of items to return per page. Minimum 1, maximum 500, default 100.

Response Schema

200Returns the paginated airspacesPaginatedResponseOfAirspaceDto
400If the classes parameter is emptyApiErrorResponse
codestring

Machine-readable error code (e.g., "AIRCRAFT_NOT_FOUND").

messagestring

Human-readable error message suitable for display.

detailsstringnullable

Additional error details (only included in development environment).

servicestringnullable

Name of the external service that failed (only included for 503 errors).

validationErrorsRecord<string, string[]>nullable

Field-level validation errors (only for validation failures).

timestampstring

UTC timestamp when the error occurred.

traceIdstringnullable

Correlation ID for tracing the request.

pathstringnullable

Request path that generated the error.

Boundaries are returned as GeoJSON

The boundary field contains GeoJSON polygons you can render directly on a map using Leaflet, Mapbox, or Google Maps.

Search Documentation

Search docs, endpoints, and schemas