> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spidra.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Look Up Airports

> Find airport and city codes for the Google Flights templates.

The Google Flights templates take airports as codes (`"LOS"`, `"LHR"`). Search for one by name, city or code with `q`, or look up codes you already have with `codes=JFK,LHR`.

```bash theme={null}
curl "https://api.spidra.io/api/templates/lookups/airports?q=lagos" \
  -H "Authorization: Bearer $SPIDRA_API_KEY"
```

```json theme={null}
{
  "status": "success",
  "airports": [
    {
      "code": "LOS",
      "kind": "airport",
      "name": "Murtala Muhammed International Airport",
      "city": "Lagos",
      "country": "NG",
      "countryName": "Nigeria",
      "region": "LA"
    }
  ]
}
```

`kind` is `city` for a code that covers every airport in a city (such as `LON` for London). Lookups are free, up to 240 a minute.


## OpenAPI

````yaml GET /templates/lookups/airports
openapi: 3.1.0
info:
  title: Spidra API
  version: 1.0.0
  description: >-
    Public API endpoints for web scraping via Spidra. Authenticate with
    `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.spidra.io/api
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /templates/lookups/airports:
    get:
      tags:
        - Templates
      summary: Look Up Airports
      description: >-
        Airport and city codes for the flight templates' `airport` inputs.
        Search by name, city or code, or look up codes you already have.
      parameters:
        - name: q
          in: query
          required: false
          schema:
            type: string
          description: Search text, such as `lagos` or `LHR`.
        - name: codes
          in: query
          required: false
          schema:
            type: string
          description: >-
            Comma-separated codes to look up, such as `JFK,LHR` (up to 25). Used
            instead of `q`.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 25
          description: Most matches for `q`.
      responses:
        '200':
          description: The airports.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  airports:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                        kind:
                          type: string
                          description: >-
                            `airport`, or `city` for a code that covers every
                            airport in a city.
                        name:
                          type: string
                        city:
                          type: string
                        country:
                          type: string
                        countryName:
                          type: string
                        region:
                          type: string
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
      required:
        - status
        - message
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.