{
  "openapi": "3.0.1",
  "info": {
    "title": "Airport Database API - IATA, ICAO, Flight Distance, METAR",
    "description": "Airport database and flight distance API in one actor. No API key, no login, no proxy: open data (OurAirports, aviationweather.gov). Look up airports by IATA or ICAO code, name or country, find airports near a point, get distance and flight time, plus live METAR/TAF.",
    "version": "0.1",
    "x-build-id": "Gtg86e5rNaS8fXraG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/martin10291~airports-flight-distance/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-martin10291-airports-flight-distance",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/martin10291~airports-flight-distance/runs": {
      "post": {
        "operationId": "runs-sync-martin10291-airports-flight-distance",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/martin10291~airports-flight-distance/run-sync": {
      "post": {
        "operationId": "run-sync-martin10291-airports-flight-distance",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to do",
            "enum": [
              "distance",
              "lookup",
              "search",
              "nearby",
              "weather"
            ],
            "type": "string",
            "description": "distance = great-circle distance, bearing and estimated flight time for routes like JFK-LHR. lookup = full airport details by IATA/ICAO code. search = find airports by text, country or type. nearby = airports around a latitude/longitude. weather = latest METAR (and optional TAF) for airports.",
            "default": "distance"
          },
          "routes": {
            "title": "Routes (distance mode)",
            "type": "array",
            "description": "Airport pairs as IATA or ICAO codes, for example JFK-LHR, SOF-VAR, LAX-NRT. Accepted separators: dash, 'to', '>' or space.",
            "default": [
              "JFK-LHR",
              "SOF-VAR",
              "LAX-NRT"
            ],
            "items": {
              "type": "string"
            }
          },
          "codes": {
            "title": "Airport codes (lookup and weather mode)",
            "type": "array",
            "description": "IATA (3 letters, e.g. JFK) or ICAO (4 characters, e.g. EGLL) codes. For weather mode, ICAO codes of any station also work.",
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Search text (search mode)",
            "type": "string",
            "description": "Text to find in airport name, city, code or keywords, for example 'heathrow', 'varna' or 'international'. Can be combined with country and type filters."
          },
          "country": {
            "title": "Country (search mode)",
            "type": "string",
            "description": "Two-letter ISO country code, for example US, GB, BG, DE. Empty = all countries."
          },
          "types": {
            "title": "Airport types (search and nearby mode)",
            "type": "array",
            "description": "Filter by type: large_airport, medium_airport, small_airport, heliport, seaplane_base, balloonport, closed. Empty = all open airport types in search mode, and large/medium/small airports in nearby mode.",
            "items": {
              "type": "string"
            }
          },
          "latitude": {
            "title": "Latitude (nearby mode)",
            "type": "number",
            "description": "Latitude of the center point in decimal degrees, for example 43.2321 (Varna).",
            "default": 43.2321
          },
          "longitude": {
            "title": "Longitude (nearby mode)",
            "type": "number",
            "description": "Longitude of the center point in decimal degrees, for example 27.8251 (Varna).",
            "default": 27.8251
          },
          "radiusKm": {
            "title": "Radius in km (nearby mode)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Search radius around the point in kilometers.",
            "default": 150
          },
          "scheduledServiceOnly": {
            "title": "Only airports with scheduled service (nearby mode)",
            "type": "boolean",
            "description": "Keep only airports that have scheduled passenger flights. Turn off to also see small airfields.",
            "default": true
          },
          "includeTaf": {
            "title": "Include TAF forecast (weather mode)",
            "type": "boolean",
            "description": "Also return the latest TAF (terminal aerodrome forecast) for each station, raw text.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new or changed results since last run",
            "type": "boolean",
            "description": "For monitoring: weather mode returns only METARs that changed since the last run, other modes return only airports or routes not seen before for this Monitor ID. Each result is paid for once.",
            "default": false
          },
          "monitorId": {
            "title": "Monitor ID",
            "type": "string",
            "description": "Separate memory for different watch lists (used with only-new mode).",
            "default": "default"
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Hard limit on results saved (and paid for).",
            "default": 100
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}