To use this API you need an API key, which you can get here
Note. The user needs to create an account on makcorps.com, after which they can only use the API.
Required modules:
Requests
pip install requests
Implementation
This API will search based on city name. Suppose that if you search for the city of London, the output JSON will compare the prices of different hotels in that city from different suppliers along with their name. The best price will also be shown for the seller price.
Below is the implementation:
|
Exit :
price comparison data for a random date of city london is: {’comparison’: [{’ vendor1-price’: ’US $ 217’, ’vendor3-price’:’ US $ 246’, ’vendor2-price’:’ US $ 217’, ’vendor3’:’ travelup.com’, ’vendor1’:’ Travelocity’, ’Hotel’:’ Park Plaza Westminster Bridge London’, ’Best-price’:’ US $ xa0246US $ xa0215Booking.com’, ’vendor2’:’ Orbitz.com’}, {’vendor1-price’:’ ’,’ vendor3-price’: ’’ , ’vendor2-price’:’ ’,’ vendor3’: ’Travelocity’,’ vendor1’: ’Expedia.com’,’ Hotel’: ’Travelodge London Covent Garden’,’ Best-price’: ’US $ xa074Travelodge’ , ’vendor2’:’ Hotels.com’}, {’vendor1-price’:’ US $ 167’, ’vendor3-price’:’ US $ 183’, ’vendor2-price’:’ US $ 171’, ’vendor3’: ’Nustay.com’,’ vendor1’: ’ParkGrandLondon’,’ Hotel’: ’Park Grand Lo ndon Kensington’, ’Best-price’:’ US $ xa0170Booking.com’, ’vendor2’:’ Travelocity’}, {’vendor1-price’:’ ’,’ vendor3-price’: ’’, ’vendor2-price ’:’ ’,’ vendor3’: ’Orbitz.com’,’ vendor1’: ’Expedia.com’,’ Hotel’: ’Travelodge London City hotel’,’ Best-price’: ’US $ xa056Travelodge’,’ vendor2 ’:’ Nustay.com’}, {’vendor1-price’:’ US $ 205’, ’vendor3-price’:’ US $ 232’, ’vendor2-price’:’ US $ 185’, ’vendor3’:’ ZenHotels. com’, ’vendor1’:’ Booking.com’, ’Hotel’:’ The Tower Hotel’, ’Best-price’:’ US $ xa0206Orbitz.com’, ’vendor2’:’ Trip.com’}, {’ vendor1-price’: ’US $ 77’,’ vendor3-price’: ’US $ 94’,’ vendor2-price’: ’US $ 87’,’ vendor3’: ’Nustay.com’,’ vendor1’: ’Official Site’ , ’Hotel’:’ Point A Hotel, London Kings Cross St Pancras’, ’Best-price’:’ US $ xa087Orbitz.com’, ’vendor2’:’ Booking.com’}, {’vendor1-price’:’ US $ 224’, ’vendor3-price’:’ US $ 242’, ’vendor2-price’:’ US $ 217’, ’vendor3’:’ travelup.com’, ’vendor1’:’ Orbitz.com’, ’Hotel’: ’Strand Palace Hotel’,’ Best-price’: ’US $ xa0223Booking.com’,’ vendor2’: ’ZenHotels.com’}]}