Blog for travel brands

API: An affiliate tool overview

APIs are currently available from 17 of the affiliate programs in the Travelpayouts affiliate network. Brands are constantly expanding the list of available APIs, as this tool is of great interest from partners, especially those with high volumes of traffic. On this page, you will learn what an API is, how it works, and why your brand should offer this tool to your partners.

What is an API?

An API is an application programming interface through which a partner can access data. To put it simply, this is a software solution through which a publisher can obtain some data from your brand. For example, about the availability of a car in a certain location, the cost of an excursion, and so on.

Partners need an API to work with your brand as flexibly as possible. With this tool, partners can get the data they need and then interpret it in the format they want. This data can be used not only on websites, but also in mobile applications.

By offering an API to your partners, you will be able to attract owners of websites with high volumes of traffic to your partner program. Such partners often need an API, as they use a tool to build their own services. For example, they use raw data, process it, and provide the user with structured information.

An API for your business is an opportunity to build long-term relationships with large partners, including both individual webmasters and businesses that need technological solutions to monetize their traffic.

Examples of how an API works

The best way to understand how an API works is through examples.

WeAtlas

Let’s take a look at WeAtlas as an example. Through the API, partners send a GET request, which includes everything they want to receive in response. The request looks like this:

curl -X GET ‘http://api.travelpayouts.com/weatlas/v1/search_prices_by_iata?code=ROM&from_date=2021-12-01T08:00&to_date=2021-12-05T08:00&currency=USD&adults_count=2&children_count=11&language=en-H’X-Access-Token: unique token

In this request, the partner shares the following information:

  • code – IATA-code of the country or city
  • currency – the currency in which the offer price will be returned
  • date – return offset for the specific date
  • limit – the total number of offers on the page
  • adults_count – the number of adults
  • children_count – the number of children
  • language – the language in which the data will be returned

In response, the webmaster receives information:

{

 “data”: [

   {

     “price”: 18,

     “currency”: “USD”,

     “content”: “Sightseeing tour of Moscow (blue route)”,

     “excursion_type”: “Tour”,

     “activity_type”: “Group”,

     “city_iata”: “MOW”,

     “country_iata”: “RU”,

     “link”: “https://weatlas.com/excursions/11979?aid=10690&utm_source=Travelpayouts&utm_content=11979”,

     “photo”: “”,

     “duration”: “2 hours”,

     “available_dates”: [

       “2021-06-01T15:15:00+03:00”,

       “2021-06-03T15:15:00+03:00”

     ]

    }

 }

The response received can be interpreted by webmasters at their own discretion. For example, certain data points are displayed in specific places within the interface, some data is inserted into the search form, a link is formed with the help of some data, etc.

Discover Cars

Discover Cars’ API works in the same way as that of WeAtlas, but in addition to GET requests, it also supports POST requests. Details on the difference between these two methods can be found here.

Tip: It is good practice to prepare detailed documentation for partners. For example, Discover Cars posted detailed information about working with the API on their official website.

How the API is accessed

Typically, brands only open APIs on demand. There is not a single brand in the Travelpayouts affiliate network that provides an API with real-time data without prior moderation.

Often, specific requirements are set for who has access to the tool. For example, Discover Cars has the following requirements:

  • Minimum of 50,000 visitors per month
  • The travel related topic of the website
  • Language and region does not matter
  • The brand prefers classic OTA websites, any search engines with traffic (such as services), sites that sell travel services, and so on

Moderated access is better not only because of the increasing load that comes with each new request, but also for scoring the purpose of the usage of the API tool.

For example, if you are not ready to offer data for a service that does not sell your services, you can deny access to the API. Some partners may use the data not to sell your services or goods, but to generate their own data. For example, through an API, a website about the weather can receive a list of airports in the country via a flight ticket affiliate program, without any subsequent intentions to sell tickets.

A token is used to validate API requests. The server responds to the peer request only if the token is correct and access is allowed. Therefore, any request can contain the identification data of the partner, as well as, if necessary, other data (website, etc.)

If necessary, for example, in the case of a violation of the terms, it is possible to terminate the partner’s access to the API.

How to develop an API tool

An API is a solution that only works on your side. The Travelpayouts team will advise your web development team and share our own best practices. The complexity and development time depends on the actual technologies used by your company.

Contact your manager for detailed information.

Alternative Solution

An API is a unique and maximally flexible tool that has no alternatives. If API access is impossible to offer, in addition to the API tool, you can provide a data feed to your partners.

For example, Omio provides data in a file that includes:

  • id – a unique identifier for the direction in the Omio system
  • title – title of the direction
  • link – link to search results by direction
  • price – cost
  • currency – currency
  • description – additional description

Partners can use this data to work with content. However, this data is not a replacement for the API, as it is not updated in real-time. Datasets also help affiliates interact with your brand.

As a rule, APIs are in demand from partners who develop their own brand and have a large audience. For such partners, an API is the best tool, as it allows you to advertise brand services and products as flexibly as possible.

It is not necessary to offer an API at the inception of your affiliate program, but in the process of developing an affiliate program, it is ideal to add this tool. We at Travelpayouts are ready to advise your brand on API and other features. Connect your brand to the platform if you are not yet with us and attract customers through an affiliate marketing channel.