Geo Autocomplete

The Geo Autocomplete API returns a list of location predictions for text-based geographic search queries.

API Information

Target Audience
Sabre Travel Network
Current Version
v1
Authentication
Sessionless Token
Method/Endpoint
GET /v1/lists/utilities/geoservices/autocomplete/ HTTP/1.1

In detail: the API uses the full word or substring to search across all locations to match against a geographic search query. By default, it returns an on-the-fly list of up to five of the most relevant location predictions to aid the traveler in selecting a desired place. A location can be an airport, city, or rail station.

Optional search preferences are available to sort and filter results, including the ability to specify a category (such as "AIR" for airports, "CITY" for city name and "RAIL" for rail stations) and a limit on the number of search results to return per category.

Ready to try the APIs?

Ready to get your hands dirty?

 Register Try the APIs

Ready to launch?

Ready to step up to the production level service? We're standing by to fit you for your spacesuit.

Request Production Key

Sample use case

You could use this API to provide autocomplete functionality for text-based airport name searches. From this data, travelers can select from a list of places that most closely match their search query. For example, if "Dall" is typed, then "Dallas/Fort Worth International" and "Dallas Love Field" airport information will be returned.

Geographic data response

The response is sorted by relevance and contains geographic details about each search result (place), including: a name, category, location information (such as geographical coordinates, a postal address, city, state and country), an ID (such as an airport, multi-airport city (MAC) code or Sabre ID), a rank and a confidence factor. A confidence factor indicates the degree of accuracy in the latitude and longitude (as provided by the geocoding entity). A rank (from 1-900) indicates the population density or traffic volume of the place. A city is ranked by population (900 indicates a large population). An airport is ranked by the number of nonstop flights served from the airport (900 indicates high traffic).

Note: Geographic information, including latitude and longitude, is provided by a third party geocoding entity. Sabre makes no representation or warranty regarding the accuracy of the geographic information provided by the geocoding entity.

Request

Query parameters

query

string, required

The full word or substring to be autocompleted

A minimum of three characters is required

category

optional, string

Retrieves places that are associated with this specified category

Valid values:

  • AIR - Airports
  • CITY - Cities
  • RAIL - Rail stations
limit

optional, number

The number of search results to return per category

Default value: 5 (places)

Valid values: 1 to 30

Sample code

Request

The following example demonstrates a text-based airport name search for locations that begin with "Dall." The following optional parameters are also specified: a category of AIR (for airports).

https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=Dall&category=AIR

Response

{
    Response: {
        responseHeader: {
            status: 0,
            QTime: 4
        },
        grouped: {
            category: AIR: {
                matches: 181,
                doclist: {
                    numFound: 10,
                    start: 0,
                    docs: [{
                        name: "Dallas/Fort Worth Intl.",
                        city: "Dallas",
                        country: "US",
                        countryName: "United States Of America",
                        stateName: "Texas",
                        state: "TX",
                        category: "AIR",
                        id: "DFW",
                        dataset: "AIR",
                        datasource: "INNOVATA",
                        confidenceFactor: "1",
                        latitude: "32.896111",
                        longitude: "-97.041111",
                        iataCityCode: "QDF",
                        ranking: 884
                    }, {
                        name: "Love Field, Dallas",
                        city: "Dallas",
                        country: "US",
                        countryName: "United States Of America",
                        stateName: "Texas",
                        state: "TX",
                        category: "AIR",
                        id: "DAL",
                        dataset: "AIR",
                        datasource: "INNOVATA",
                        confidenceFactor: "1",
                        latitude: "32.846944",
                        longitude: "-96.851389",
                        iataCityCode: "QDF",
                        ranking: 826
                    }, {
                        name: "Dallas NAS Hensley Field",
                        city: "Enfidha",
                        country: "US",
                        countryName: "United States Of America",
                        stateName: "Texas",
                        state: "TX",
                        category: "AIR",
                        id: "NBE",
                        dataset: "AIR",
                        datasource: "INNOVATA",
                        confidenceFactor: "1",
                        latitude: "32.733333",
                        longitude: "-96.966667",
                        iataCityCode: "NBE",
                        ranking: 413
                    }, {
                        name: "Dallas North",
                        city: "Dallas",
                        country: "US",
                        countryName: "United States Of America",
                        stateName: "Texas",
                        state: "TX",
                        category: "AIR",
                        id: "DNE",
                        dataset: "AIR",
                        datasource: "INNOVATA",
                        confidenceFactor: "1",
                        latitude: "33.078611",
                        longitude: "-96.738056",
                        iataCityCode: "DFW",
                        ranking: 0
                    }, {
                        name: "The Dalles",
                        city: "The Dalles",
                        country: "US",
                        countryName: "United States Of America",
                        stateName: "Oregon",
                        state: "OR",
                        category: "AIR",
                        id: "DLS",
                        dataset: "AIR",
                        datasource: "INNOVATA",
                        confidenceFactor: "1",
                        latitude: "45.618611",
                        longitude: "-121.166111",
                        iataCityCode: "DLS",
                        ranking: 0
                    }]
                }
            }
        }
    },
    Links: [{
        rel: "self",
        href: "https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=Dall&category=AIR"
    }, {
        rel: "linkTemplate",
        href: " https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=<query>&limit=<limit>&category=<category>"
    }]
}

Request

The following example demonstrates a text-based airport name search for locations that begin with "Dallas." The following optional parameters are also specified: a limit of up to 3 (results per category).

https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=Dallas&limit=3 

Response

{
    "Response": {
        "responseHeader": {
            "status": 0,
            "QTime": 4
        },
        "grouped": {
            "category:AIR": {
                "matches": 45,
                "doclist": {
                    "numFound": 9,
                    "start": 0,
                    "docs": [{
                        "name": "Dallas/Fort Worth Intl.",
                        "city": "Dallas",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Texas",
                        "state": "TX",
                        "category": "AIR",
                        "id": "DFW",
                        "dataset": "AIR",
                        "datasource": "INNOVATA",
                        "confidenceFactor": "1",
                        "latitude": "32.896111",
                        "longitude": "-97.041111",
                        "iataCityCode": "QDF",
                        "ranking": 884
                    }, {
                        "name": "Love Field, Dallas",
                        "city": "Dallas",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Texas",
                        "state": "TX",
                        "category": "AIR",
                        "id": "DAL",
                        "dataset": "AIR",
                        "datasource": "INNOVATA",
                        "confidenceFactor": "1",
                        "latitude": "32.846944",
                        "longitude": "-96.851389",
                        "iataCityCode": "QDF",
                        "ranking": 826
                    }, {
                        "name": "Dallas NAS Hensley Field",
                        "city": "Enfidha",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Texas",
                        "state": "TX",
                        "category": "AIR",
                        "id": "NBE",
                        "dataset": "AIR",
                        "datasource": "INNOVATA",
                        "confidenceFactor": "1",
                        "latitude": "32.733333",
                        "longitude": "-96.966667",
                        "iataCityCode": "NBE",
                        "ranking": 413
                    }]
                }
            }
        }
    },
    "Links": [{
        "rel": "self",
        "href": "https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=Dallas&limit=3&category=AIR"
    }, {
        "rel": "linkTemplate",
        "href": "https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=<query>&limit=<limit>&category=<category>"
    }]
}

Request

The following example demonstrates a text-based airport name search for locations that begin with "Dallas." The following optional parameters are also specified: a category of AIR (for airports), a limit of up to 3 (results per category).

https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=Dallas&category=AIR&limit=3

Response

{
    "Response": {
        "responseHeader": {
            "status": 0,
            "QTime": 15
        },
        "grouped": {
            "category:AIR": {
                "matches": 45,
                "doclist": {
                    "numFound": 9,
                    "start": 0,
                    "docs": [{
                        "name": "Dallas/Fort Worth Intl.",
                        "city": "Dallas",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Texas",
                        "state": "TX",
                        "category": "AIR",
                        "id": "DFW",
                        "dataset": "AIR",
                        "datasource": "INNOVATA",
                        "confidenceFactor": "1",
                        "latitude": "32.896111",
                        "longitude": "-97.041111",
                        "iataCityCode": "QDF",
                        "ranking": 884
                    }, {
                        "name": "Love Field, Dallas",
                        "city": "Dallas",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Texas",
                        "state": "TX",
                        "category": "AIR",
                        "id": "DAL",
                        "dataset": "AIR",
                        "datasource": "INNOVATA",
                        "confidenceFactor": "1",
                        "latitude": "32.846944",
                        "longitude": "-96.851389",
                        "iataCityCode": "QDF",
                        "ranking": 826
                    }, {
                        "name": "Dallas NAS Hensley Field",
                        "city": "Enfidha",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Texas",
                        "state": "TX",
                        "category": "AIR",
                        "id": "NBE",
                        "dataset": "AIR",
                        "datasource": "INNOVATA",
                        "confidenceFactor": "1",
                        "latitude": "32.733333",
                        "longitude": "-96.966667",
                        "iataCityCode": "NBE",
                        "ranking": 413
                    }]
                }
            },
            "category:CITY": {
                "matches": 45,
                "doclist": {
                    "numFound": 34,
                    "start": 0,
                    "docs": [{
                        "name": "Dallas",
                        "city": "Dallas",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Texas",
                        "state": "TX",
                        "category": "CITY",
                        "id": "26506087",
                        "dataset": "CITY",
                        "datasource": "OSM",
                        "confidenceFactor": "1",
                        "latitude": "32.780105",
                        "longitude": "-96.800008",
                        "ranking": 176
                    }, {
                        "name": "Dallas",
                        "city": "Dallas",
                        "country": "US",
                        "countryName": "United States Of America",
                        "stateName": "Oregon",
                        "state": "OR",
                        "category": "CITY",
                        "id": "150933242",
                        "dataset": "CITY",
                        "datasource": "OSM",
                        "confidenceFactor": "1",
                        "latitude": "44.918921",
                        "longitude": "-123.31587",
                        "ranking": 53
                    }, {
                        "name": "Dallas",
                        "city": "Dallas",
                        "country": "CA",
                        "countryName": "Canada",
                        "stateName": "Manitoba",
                        "state": "MB",
                        "category": "CITY",
                        "id": "52557302",
                        "dataset": "CITY",
                        "datasource": "OSM",
                        "confidenceFactor": "1",
                        "latitude": "51.383333",
                        "longitude": "-97.483333",
                        "ranking": 51
                    }]
                }
            },
            "category:Rail": {
                "matches": 45,
                "doclist": {
                    "numFound": 2,
                    "start": 0,
                    "docs": [{
                        "name": "Dallas",
                        "stateName": "TX",
                        "state": "TX",
                        "category": "Rail:Amtrak",
                        "id": "DAL",
                        "dataset": "Rail",
                        "datasource": "RAIL",
                        "confidenceFactor": "1",
                        "description": "Union Station",
                        "latitude": "32.776094",
                        "longitude": "-96.807235",
                        "ranking": 1
                    }, {
                        "name": "Dallas",
                        "stateName": "TX",
                        "state": "TX",
                        "category": "Rail:Amtrak",
                        "id": "DAG",
                        "dataset": "Rail",
                        "datasource": "RAIL",
                        "confidenceFactor": "1",
                        "description": "Greyhound Station",
                        "latitude": "32.778637",
                        "longitude": "-96.804121",
                        "ranking": 1
                    }]
                }
            }
        }
    },
    "Links": [{
        "rel": "self",
        "href": "https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=Dallas&limit=3"
    }, {
        "rel": "linkTemplate",
        "href": "https://api.havail.sabre.com/v1/lists/utilities/geoservices/autocomplete?query=<query>&limit=<limit>&category=<category>"
    }]
}

Errors

An HTTP status code is always returned. For information about the error response format, see the: Sabre APIs: errors page.

400 BAD REQUEST

Required string parameter 'query' is not present

query is missing.

query is missing a value.

Unable to convert '{specified value}' to required type 'number'

The value provided in limit is not a valid data type.

Docs Navigation