Best fares, easy and straightforward integration

Designed with for developers

Countries

Introduction

Fetching the full list of countries is pretty straightforward.

You need to perform GET https://faresapi.com/api/v1/data/countries with proper authentication.

The response will be an array of objects, each of which contains the following information

  • id Country ID. You'll need this for Nationality and Phone Code
  • name String.
  • isoCode Two Letter Country Code
  • unCode Three Letter Country Code
  • phoneCode Phone Code, may be several codes at once.

Input

There are three options for submitting a country:

  • ID You can submit the Country ID
    Example: 1
  • ISO CODE You can submit the Country ISO CODE (two letter code)
    Example: TZ
  • PHONE CODE You can submit the Phone Code. Please note, that a leading plus sign is required.
    Example: +255
    Phone codes with dashes must be submitted like so: +1-868 (Trinidad and Tobago)
    Exceptions
    1. Countries where we have more than one phone number:
      • Puerto Rico: 1-787 and 1-939
      • Dominican Republic: 1-809 and 1-829
      These will either not work if you only send +1-787, or it may work if you send the full string.
      This feature is not guaranteed for those countries
    2. Multiple countries having the same phone number. In this case, the first matching record will be selected. If you just need the phone number, this may be just alright. Otherwise, please use the ID or the two-letter code.