Airport codes api autocomplete - parameters

The Javascript library provided in the sample code should be used to manage the requests to the endpoint. It is helpful to know how it works in case you need to write any custom code that we haven't provided.

Endpoint

For this API request, you will need to hit the following endpoint.

https://www.air-port-codes.com/api/v1/autocomplete

Headers

In order to be granted access to the API, all of your requests must include an APC-Auth header that includes your API Key. An APC-Auth-Secret header can also be supplied for special cases where a referrer cannot be found, however, in most cases it will not be necessary.

Name Action Description
APC-Auth Required Your unique 10 digit alphanumeric Air-Port-Codes API key. This can be located in your account settings.
APC-Auth-Secret Optional Your unique 15 digit alphanumeric Air-Port-Codes API secret. You should NOT need to use this from Javascript unless you are running the script outside of a server, from an app or local testing (file://...). In most cases you won't need to use this if you add a proper domain to your account. It is more secure without it!

Parameters

In order to be granted access to the API, all of your requests must include a 'key' parameter that includes your API Key found in your Air-port-codes account. A 'secret' parameter can also be supplied for special cases where a referrer cannot be found, such as if you are testing locally, however, in most cases it will not be necessary.

Results will be ordered based on size of airport with larger airports first and smaller ones last.

Name Action Description
term Required The search term used for the lookup. The term searches against the airport name, city, state, country and iata (airport) code.
limit Optional The maximum number of results to return. The default maximum is 10.
size Optional The servicing area size of the airports to use. The default is 0 which means any servicing size of airport will be returned. Valid options are: 0-any, 1-local and up, 2-regional and up, 3-international and up, 5-airport groups only (eg. All New York City Airports). You can also pass in multiple sizes pipe separated (eg. 1|2|3).
type Optional The type of listings to be returned. Multiple options are allowed with pipe (|) separation. Valid options are: a-airports, h-heliport, s-seaplanes, r-railway, g-group. Only the first letter is necessary such as (a|g|r). A group simply refers to all the airports within a city. Such as NYC would contain all New York City airports. Default is (a|g).
countries Optional Restrict the results to specific countries. Valid options are: 2 letter iso country abreviations (us|ca). Multiple countries are allowed with pipe (|) separation.