Obstacles
GET/api/v1/obstacles/state/{stateCode}Private Pilot

Get By State

Gets obstacles in a specific state.

Code Examples

curl \
  -H "Ocp-Apim-Subscription-Key: YOUR_API_KEY" \
  "https://api.preflightapi.io/api/v1/obstacles/state/NY?limit=25&minHeightAgl=25"

Description

GET /api/v1/obstacles/state/TX — all obstacles in Texas
GET /api/v1/obstacles/state/TX?minHeightAgl=1000 — obstacles 1000+ ft AGL in Texas

Returns paginated results of ObstacleDto

Parameters

NameInTypeDescription
stateCode*pathstringTwo-letter state code (e.g., TX, CA)
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.
minHeightAglqueryinteger?Optional minimum height AGL in feet — only return obstacles at or above this height

Response Schema

200Returns the obstaclesPaginatedResponseOfObstacleDto
400If the state code 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.

Search Documentation

Search docs, endpoints, and schemas