How to get a signature for hotels search API

The query in the hotels search API shall be as follows:

http://engine.hotellook.com/api/v2/search/start.json?iata=HKT&checkIn=2020-12-10&checkOut=2020-12-13&adultsCount=2&customerIP=192.168.1.1&childrenCount=1&childAge1=10&lang=ru&currency=USD&waitForResult=0&marker=16886&signature=a9cf959983a2cdf88fc9012328c47494

With the following query parameters:

  • iata=HKT;
  • checkIn=2020-12-10;
  • checkOut=2020-12-13;
  • adultsCount=2;
  • customerIP=77.111.247.75;
  • childAge1 = 10;
  • childrenCount=1;
  • lang=ru;
  • currency=USD;
  • waitForResult=0.

Let’s sort them alphabetically:

  • adultsCount=2;
  • checkIn=2020-12-10;
  • checkOut=2020-12-13;
  • childAge1=10;
  • childrenCount=1;
  • currency=USD;
  • customerIP=77.111.247.75;
  • iata=HKT;
  • lang=ru;
  • waitForResult=0.

Next, fix the values of the assorted parameters using colons and add the affiliate security token and marker (they can be found in each affiliate’s personal account) before them:

WriteHereYourToken:WriteHereYourMarker:2:2020–12–10:2020–12–13:10:1:USD:77.111.247.75:HKT:ru:0

This string is used for signature creation. As a result, we have the following: 9961b6ecb56d45935667141b79cfbc28.

To create a query, take the query parameters, add the affiliate’s security token and marker, and fix using & into the search string:

http://engine.hotellook.com/api/v2/search/start.json?iata=HKT&checkIn=2020-12-10&checkOut=2020-12-13&adultsCount=2&customerIP=192.168.1.1&childrenCount=1&childAge1=10&lang=ru&currency=USD&waitForResult=0&marker=16886&signature=878c8cdd72222323d925dd8e8a37c6b1

Was this article helpful?

Have more questions? Submit a request