Skip to content
Scrappa Get API key
FlightStats API 1 credit / request

FlightStats Search API Documentation

GET https://scrappa.co/api/flightstats/search

FlightStats Search API Documentation Search carriers or airports by name and get the codes for the flight and airport endpoints. Set type to airline or airport. An empty result costs no credit. Cost: 1 credit per successful request.

FlightStats Search API Documentation 1 credit / request

Endpoint

Request preview
GET
https://scrappa.co/api/flightstats/search
Auth header
x-api-key
Cost
1 credit / request
query = coffee shops type = example
Response preview
200 OK
{
    "data": {
        "type": "airline",
        "count": 4,
        "query": "lufth",
        "results": [
            {
                "code": "LH",
                "iata": "LH",
                "name": "Lufthansa"
            },
            {
                "code": "CL",
                "iata": "CL",
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

2 required parameters needed before sending a request.

query string Required

Name or code to search, at least 2 characters, e.g. lufthansa.

Example value coffee shops
type string Required

airline or airport.

Example value example

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "type": "airline",
        "count": 4,
        "query": "lufth",
        "results": [
            {
                "code": "LH",
                "iata": "LH",
                "name": "Lufthansa"
            },
            {
                "code": "CL",
                "iata": "CL",
                "name": "Lufthansa CityLine"
            },
            {
                "code": "GEC",
                "iata": "GEC",
                "name": "Lufthansa Cargo"
            },
            {
                "code": "LHX",
                "iata": "LHX",
                "name": "Lufthansa City Airlines"
            }
        ]
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

A parameter is missing or invalid. This response is not billable.

{
    "errors": {
        "type": [
            "The type is one of airline, airport."
        ]
    },
    "message": "The request validation failed"
}
503

Upstream Unavailable

FlightStats could not be read after retries. This response is not billable. Retry later.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "search"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "FlightStats is temporarily unavailable. Please retry."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.