# searchAirports

**Identifier:** `aviationstack_searchAirports`

**Provider:** [Aviationstack](https://kirha.com/providers/aviationstack.md)

Search for airports by name, city, or IATA/ICAO code to find airport information and codes.

## Run it with the CLI

```bash
kirha tools run aviationstack_searchAirports \
  --input '{
    "query": "Los Angeles"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "aviationstack_searchAirports",
  "input": {
    "query": "Los Angeles"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "limit": {
      "default": 10,
      "maximum": 100,
      "minimum": 1,
      "type": "number"
    },
    "query": {
      "description": "Search query: airport name, city, or IATA/ICAO code (e.g., 'Los Angeles', 'LAX', 'JFK')",
      "type": "string"
    }
  },
  "required": [
    "query"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "airports": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "airportName": {
            "type": "string"
          },
          "cityIataCode": {
            "type": "string"
          },
          "countryIso2": {
            "type": "string"
          },
          "countryName": {
            "type": "string"
          },
          "iataCode": {
            "type": "string"
          },
          "icaoCode": {
            "type": "string"
          },
          "latitude": {
            "maximum": 90,
            "minimum": -90,
            "type": "number"
          },
          "longitude": {
            "maximum": 180,
            "minimum": -180,
            "type": "number"
          },
          "timezone": {
            "type": "string"
          }
        },
        "required": [
          "airportName",
          "countryName",
          "countryIso2"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "context": {
      "type": "string"
    },
    "ids": {
      "description": "Airport IATA codes, usable as airportIata in getAirportTimetable",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "totalResults": {
      "type": "number"
    }
  },
  "required": [
    "context",
    "airports",
    "totalResults",
    "ids"
  ],
  "type": "object"
}
```

## Related tools

Other Aviationstack tools that this tool refers to, or that refer to it.

- [`getAirportTimetable`](https://kirha.com/providers/aviationstack/getAirportTimetable.md)

-----

[All Aviationstack tools](https://kirha.com/providers/aviationstack.md) · [< Back to tools list](https://kirha.com/tools.md)