Airlabs Suggest API

Autocomplete and search

OpenAPI Specification

airlabs-suggest-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: AirLabs Aviation Data Airlines Suggest API
  description: Real-time global flight tracking, airport schedules, flight delays, airline and airport databases, aircraft fleets, routes, nearby airports, and autocomplete suggestions. All responses are JSON wrapped in a `{request, response}` envelope. Authentication via `api_key` query parameter.
  version: v9
  termsOfService: https://airlabs.co/terms
  contact:
    name: AirLabs
    url: https://airlabs.co
    email: info@airlabs.co
  license:
    name: Proprietary
    url: https://airlabs.co/terms
servers:
- url: https://airlabs.co/api/v9
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Suggest
  description: Autocomplete and search
paths:
  /suggest:
    get:
      summary: Autocomplete / search suggestions
      description: Returns matching airports, cities, and airlines for a search query. Minimum query length is 2 characters.
      tags:
      - Suggest
      operationId: suggest_suggestenvelope
      parameters:
      - name: search
        in: query
        required: true
        description: Search query (min 2 chars)
        schema:
          type: string
      - $ref: '#/components/parameters/FieldsParam'
      - $ref: '#/components/parameters/LimitParam'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuggestEnvelope'
        '400':
          description: Bad request — missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized — missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden — plan limit reached or feature not available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Too many requests — rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RequestMeta:
      type: object
      description: Echo of the request and processing metadata
      properties:
        lang:
          type: string
        currency:
          type: string
        time:
          type: number
        id:
          type: string
        server:
          type: string
        host:
          type: string
        pid:
          type: integer
        version:
          type: integer
        method:
          type: string
        params:
          type: object
          additionalProperties: true
    SuggestResponse:
      type: object
      description: Grouped suggestion results
      properties:
        airports:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Airport name
              iata_code:
                type: string
                description: Airport IATA code
              icao_code:
                type: string
                description: Airport ICAO code
              city:
                type: string
                description: City name
              city_code:
                type: string
                description: City IATA code
              country_code:
                type: string
                description: Country ISO 2 code
              country:
                type: string
                description: Country name
              lat:
                type: number
                format: float
                description: Latitude
              lng:
                type: number
                format: float
                description: Longitude
        cities:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: City name
              city_code:
                type: string
                description: City IATA code
              country_code:
                type: string
                description: Country ISO 2 code
              country:
                type: string
                description: Country name
              lat:
                type: number
                format: float
                description: Latitude
              lng:
                type: number
                format: float
                description: Longitude
        airlines:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                description: Airline name
              iata_code:
                type: string
                description: Airline IATA code
              icao_code:
                type: string
                description: Airline ICAO code
    SuggestEnvelope:
      type: object
      properties:
        request:
          $ref: '#/components/schemas/RequestMeta'
        response:
          $ref: '#/components/schemas/SuggestResponse'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Error description
            code:
              type: string
              description: Error code
  parameters:
    LimitParam:
      name: _limit
      in: query
      required: false
      description: Maximum number of results to return
      schema:
        type: integer
        minimum: 1
        maximum: 1000
    FieldsParam:
      name: _fields
      in: query
      required: false
      description: Comma-separated list of response fields to return
      schema:
        type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: api_key
      description: API key. Sign up at https://airlabs.co/signup
externalDocs:
  description: Full documentation
  url: https://airlabs.co/docs/