Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
liteapi-travel
Advanced tools
The **liteAPI** can be used to to do the following Get room rates & availability for a set of hotels Select a specific hotel with room availability and make a booking Manage the bookings - retrieve and cancel existing bookings Get static content for hote
liteAPI The fastest way to build travel apps Launch your hospitality product in minutes. Effortlessly monetize by selling accommodations at over 2 million properties worldwide.
The liteAPI can be used to to do the following:
Don't have an account yet? Sign Up Here.
Install the package with:
npm install liteapi-travel
# or
yarn add liteapi-travel
The package needs to be configured with your account's apikey, which is available in the liteAPI Dashboard. Require it with the key's value:
const liteApi = require('liteapi-travel')(YOUR_API_KEY);
The API returns a list of city names from a specific country. The country codes must be in ISO-2 format. To get the country codes in ISO-2 for all countries please use the GET Country list endpoint
const countryCode = "IT";
const result = await liteApi.getCitiesByCountryCode(countryCode);
Name | Type | Description | Notes |
---|---|---|---|
countryCode | string | Country code in iso-2 format (example: US) | [required] |
An array of city objects containing the following properties:
Field | Type | Description |
---|---|---|
city | string | The name of the city. |
The API returns the list of countries available along with its ISO-2 code.
const result = await liteApi.getCountries();
This endpoint does not need any parameter.
An array of country objects containing the following properties:
Field | Type | Description |
---|---|---|
code | string | The country code in iso-2 format. |
name | string | The name of the country. |
The API returns all available currency codes along with its name and the list of supported countries that the currency applies to.
const result = await liteApi.getCurrencies();
This endpoint does not need any parameter.
An array of currency objects containing the following properties:
Name | Type | Description |
---|---|---|
code | string | The currency code. |
currency | string | The name of the currency. |
countries | Array | An array of countries where the currency is used. |
The API returns a list of hotels available based on different search criterion. The minimum required information is the county code in ISO-2 format.
const countryCode = "IT";
const cityName = "Rome";
//Optional values
const offset = 1000;
const limit = 1000;
const longitude = "-115.16988";
const latitude = "36.12510";
const distance = 1000;
const result = await liteApi.getHotels(countryCode, cityName);
To utilize optional values, you can invoke the function as follows:
const result = await liteApi.getHotels(countryCode, cityName, offset, limit, longitude, latitude, distance)
Name | Type | Description | Notes |
---|---|---|---|
countryCode | string | country code ISO-2 code - example (US) | [required] |
cityName | string | name of the city | [required] |
offset | number | specifies the number of rows to skip before starting to return rows | [optional] |
limit | number | limit number of results (max 1000) | [optional] |
longitude | string | longitude geo coordinates | [optional] |
latitude | string | latitude geo coordinates | [optional] |
distance | number | distance in meters (min 1000m) | [optional] |
An array of hotel objects containing the following properties:
Name | Type | Description |
---|---|---|
id | string | The unique identifier of the hotel. |
name | string | The name of the hotel. |
hotelDescription | string | The description of the hotel. |
currency | string | The currency used in the hotel. |
country | string | The country code of the hotel. |
city | string | The city where the hotel is located. |
latitude | number | The latitude coordinates of the hotel's location. |
longitude | number | The longitude coordinates of the hotel's location. |
address | string | The address of the hotel. |
zip | string | The postal code of the hotel. |
main_photo | string | The URL of the main photo of the hotel. |
stars | number | The star rating of the hotel. |
The hotel details API returns all the static contents details of a hotel or property if the hotel ID is provided. The static content include name, description, address, amenities, cancellation policies, images and more.
const hotelID = "lp24373";
const result = await liteApi.getHotelDetails(hotelID);
Name | Type | Description | Notes |
---|---|---|---|
hotelId | string | Unique ID of a hotel | [required] |
Name | Type | Description |
---|---|---|
id | string | The unique identifier of the hotel. |
name | string | The name of the hotel. |
hotelDescription | string | The description of the hotel. |
checkinCheckoutTimes | Object | An object containing the check-in and check-out times of the hotel. |
checkout | string | The check-out time of the hotel. |
checkin | string | The check-in time of the hotel. |
hotelImages | Array | An array of hotel image objects containing the following properties: |
url | string | The URL of the hotel image. |
thumbnailUrl | string | The thumbnail URL of the hotel image. |
caption | string | The caption of the hotel image. |
order | string | The order of the hotel image (null if not applicable). |
defaultImage | boolean | Indicates whether the hotel image is the default image or not. |
currency | string | The currency used in the hotel. |
country | string | The country code of the hotel. |
city | string | The city where the hotel is located. |
starRating | number | The star rating of the hotel. |
location | Object | An object containing the latitude and longitude coordinates of the hotel's location. |
latitude | number | The latitude coordinate of the hotel's location. |
longitude | number | The longitude coordinate of the hotel's location. |
address | string | The address of the hotel. |
zip | string | The postal code of the hotel. |
chainId | string | The unique identifier of the hotel chain. |
hotelFacilities | Array | An array of hotel facilities offered by the hotel. |
The API returns the IATA (International Air Transport Association) codes for all available airports along with the name of the airport, geographical coordinates and country code in ISO-2 format.
const result = await liteApi.getIataCodes();
This endpoint does not need any parameter.
An array of IATA objects with the following properties:
Name | Type | Description |
---|---|---|
code | string | The IATA code. |
name | string | The name of the IATA. |
latitude | number | The latitude coordinates of the IATA. |
longitude | number | The longitude coordinates of the IATA. |
countryCode | string | The country code of the IATA. |
liteAPI is a comprehensive and simple to implement Hotel Booking API. The booking flow consists of 3 section: Search, Book, and booking management.
Hotel Minimum Rates API is to search and return the minimum room rates that are available for a list of hotel ID's on the specified search dates.
For each hotel ID, the minimum room rate that is available is returned.
The API also has a built in loyalty rewards system. The system rewards return users who have made prior bookings.
If the search is coming from a known guest ID, the guest level is also returned along with the pricing that's appropriate for the guest level.
If it is a new user, the guest ID will be generated at the time of the first confirmed booking.
const checkin = "2023-07-15";
const checkout = "2023-07-16";
const currency = "USD";
const guestNationality = "US";
const hotelIdsList = ["lp3803c", "lp1f982", "lp19b70", "lp19e75"];
const adults = 2;
//Optional values
const childrenAges = [2,3];
const travelerID = "traveler1";
const result = await liteApi.getMinimumRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults);
To utilize optional values, you can invoke the function as follows:
const result = await liteApi.getMinimumRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults,childrenAges,travelerID);
Name | Type | Description | Notes |
---|---|---|---|
hotelIds | array of strings | List of hotelIds | [required] |
checkin | string | Check in data in YYYY-MM-DD format | [required] |
checkout | string | Check out data in YYYY-MM-DD format | [required] |
currency | string | Currency code - example (USD) | [required] |
guestNationality | string | Guest nationality ISO-2 code - example (SG) | [required] |
adults | number | Number of adult guests staying | [required] |
children | array of numbers | Number of children staying if any | [optional] |
guestId | string | Unique traveler ID if available | [optional] |
An array of hotel minimum rates objects with the following properties:
Name | Type | Description |
---|---|---|
hotelId | string | The ID of the hotel. |
currency | string | The currency code for the price. |
price | number | The price of the hotel. |
supplierId | number | The ID of the supplier. |
supplier | string | The name of the supplier. |
The Full Rates API is to search and return all available rooms along with its rates, cancellation policies for a list of hotel ID's based on the search dates.
For each hotel ID, all available room information is returned.
The API also has a built in loyalty rewards system. The system rewards return users who have made prior bookings.
If the search is coming from a known guest ID, the guest level is also returned along with the pricing that's appropriate for the guest level.
If it is a new user, the guest ID will be generated at the time of the first confirmed booking.
const checkin = "2023-07-15";
const checkout = "2023-07-16";
const currency = "USD";
const guestNationality = "US";
const hotelIdsList = ["lp3803c", "lp1f982", "lp19b70", "lp19e75"];
const adults = 2;
//Optional values
const childrenAges = [2,3];
const travelerID = "traveler1";
const result = await liteApi.getFullRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults);
To utilize optional values, you can invoke the function as follows:
const result = await liteApi.getFullRates(checkin, checkout, currency, guestNationality, hotelIdsList, adults,childrenAges,travelerID);
Name | Type | Description | Notes |
---|---|---|---|
hotelIds | array of strings | List of hotelIds | [required] |
checkin | string | Check in data in YYYY-MM-DD format | [required] |
checkout | string | Check out data in YYYY-MM-DD format | [required] |
currency | string | Currency code - example (USD) | [required] |
guestNationality | string | Guest nationality ISO-2 code - example (SG) | [required] |
adults | number | Number of adult guests staying | [required] |
children | array of numbers | Number of children staying if any | [optional] |
guestId | string | Unique traveler ID if available | [optional] |
An array of hotel full rates with the following properties:
Name | Type | Description |
---|---|---|
roomTypeId | string | The ID of the room type. |
supplier | string | The name of the supplier. |
supplierId | number | The ID of the supplier. |
rates | Array | An array of rate objects containing the pricing and details for each rate within the room type. |
rateId | string | The ID of the rate. |
name | string | The name of the rate. |
maxOccupancy | number | The maximum occupancy of the room. |
boardType | string | The type of board included (e.g., Bed Only). |
boardName | string | The name of the board (e.g., Bed Only). |
priceType | string | The type of pricing (e.g., commission). |
commission | Array | An array of commission objects containing the commission amount and currency. |
retailRate | Object | An object containing the retail rate information, including total price, MSP (Marked Selling Price), and taxes and fees. |
total | Array | An array of total price objects containing the amount and currency. |
msp | Array | An array of MSP (Marked Selling Price) objects containing the amount and currency. |
taxesAndFees | Array | An array of taxes and fees objects containing information about included or additional charges. |
cancellationPolicies | Object | An object containing cancellation policy information. |
cancelPolicyInfos | Array | An array of cancellation policy info objects containing information about cancellation time, amount, currency, and type. |
hotelRemarks | Array | An array of hotel remarks. |
refundableTag | string | The tag indicating if the rate is refundable or non-refundable. |
This API is used to confirm if the room and rates for the search criterion. The input to the endpoint is a specific rate Id coming from the GET hotel full rates availability API.
In response, the API generates a prebook Id, a new rate Id and contains information if price, cancellation policy or boarding information has changed.
const rateId = "NRYDCZRZHAZHYMRQGIZS2MBXFUYTK7BSGAZDGLJQG4WTCNT4GJ6HYVKTPRDVSWSEJVMVUV2HIUZUOS2OKJKEOWKZKRCU2QSXJVETGRCTJZKEMR2ZGNMFSTKKIRDUSWKEIVGVUUKHGRMVISZXIJJUOQK2IRDU2QSYI5CTGSCZLJGE6TBVJNLEON2DKZFU4NSGJNKTERKQKFNEKQ2NINCFAUK2IRCU6QSUKBJEWVCFKZJVST2KGZCEGTSSLFEEKWKEINHFUV2HKUZVIUKOJJNE6QSELBHVKQSEI5CVURCTJZBFER2BKJKEOTKKJZDUKWSEKNHEEUSHII3EMRKSKNHVAUK2IRAU2USUI5ATGVCDJVJFCR2FLFCECN2CKRIFCWKUJFHEEVCHLFJFMRKULJCEWSSEIU2ESWSTI5AVURCHJRFFCRZUK5KEGTKRPRKVGRD4PR6DCNRWFYYDC7BSGAZDGLJQG4WTCMT4IJHXYMJSHE2DCMD4GI";
const result = await liteApi.preBook(rateId)
Name | Type | Description | Notes |
---|---|---|---|
rateId | string | rate id retrieved from getFullRates response | [required] |
An object containing prebook information and room type details.
Name | Type | Description |
---|---|---|
prebookId | string | The ID of the prebook. |
hotelId | string | The ID of the hotel. |
currency | string | The currency used for pricing. |
termsAndConditions | string | The terms and conditions (if available). |
roomTypes | Array | An array of room type objects containing the following properties: |
rates | Array | An array of rate objects containing pricing and details for each rate within the room type. |
rateId | string | The ID of the rate. |
name | string | The name of the rate. |
maxOccupancy | number | The maximum occupancy of the room. |
boardType | string | The type of board included (e.g., Bed Only). |
boardName | string | The name of the board (e.g., Bed Only). |
priceType | string | The type of pricing (e.g., commission). |
commission | Object | An array of commission objects containing the commission amount and currency. |
retailRate | Object | An object containing the retail rate information, including total price, MSP (Marked Selling Price), and taxes and fees. |
total | Object | An array of total price objects containing the amount and currency. |
msp | Object | An array of MSP (Marked Selling Price) objects containing the amount and currency. |
taxesAndFees | Object | An array of taxes and fees objects containing information about included or additional charges. |
cancellationPolicies | Object | An object containing cancellation policy information. |
cancelPolicyInfos | Object | An array of cancellation policy info objects containing information about cancellation time, amount, and type. |
hotelRemarks | Array | An array of hotel remarks. |
refundableTag | string | The tag indicating if the rate is refundable or non-refundable. |
msp | number | The Marked Selling Price (MSP) for the prebook. |
commission | number | The commission amount for the prebook. |
price | number | The price of the prebook. |
priceType | string | The type of pricing (e.g., commission). |
priceDifferencePercent | number | The percentage difference between the retail rate and the Marked Selling Price (MSP). |
cancellationChanged | boolean | Indicates if there were changes to the cancellation policy. |
boardChanged | boolean | Indicates if there were changes to the board type. |
supplier | string | The name of the supplier. |
supplierId | number | The ID of the supplier. |
This API confirms a booking when the prebook Id and the rate Id from the pre book stage along with the guest and payment information are passed.
The guest information is an object that should include the guest first name, last name and email.
The payment information is an object that should include the name, credit card number, expiry and CVC number.
The response will confirm the booking along with a booking Id and a hotel confirmation code. It will also include the booking details including the dates, price and the cancellation policies.
const prebookId = "8iaO7PXBU";
const guestInfo = { guestFirstName: 'Kim', guestLastName: 'James', guestEmail: 'test@nlite.ml' };
const paymentMethod = "CREDIT_CARD";
const holderName = "Kim James";
const paymentInfo = { "card_number": "4242424242424242", "exp_month": 11, "exp_year": 23, "cvc": 123,"token":null }
const result = await liteApi.book(prebookId, guestInfo, paymentMethod, holderName, paymentInfo)
Name | Type | Description | Notes |
---|---|---|---|
prebookId | string | prebook id retrieved from prebook response | [required] |
guestInfo | object | traveler informations | [required] |
guestFirstName | string | traveler first name | [required] |
guestLastName | string | traveler last name | [required] |
guestEmail | string | traveler email | [required] |
paymentMethod | string | methodEnum: "CREDIT_CARD" or "STRIPE_TOKEN" | [required] |
holderName | string | name of the cardholder | [required] |
paymentInfo | object | payment informations | [required] |
card_number | string | the card number associated with the credit card | [required if paymentMethod is CREDIT_CARD] |
exp_month | number | the expiration month of the credit card | [required if paymentMethod is CREDIT_CARD] |
exp_year | number | the expiration year of the credit card | [required if paymentMethod is CREDIT_CARD] |
cvc | number | the card verification code (CVC) associated with the credit card | [required if paymentMethod is CREDIT_CARD] |
token | string | token provided by Stripe for the payment method. | [required if paymentMethod is STRIPE_TOKEN] |
An object containing booking information and room details.
Name | Type | Description |
---|---|---|
bookingId | string | The ID of the booking. |
clientReference | string | The client reference. |
supplierBookingId | string | The supplier booking ID. |
supplierBookingName | string | The supplier booking name. |
supplier | string | The supplier. |
supplierId | number | The ID of the supplier. |
status | string | The status of the booking. |
hotelConfirmationCode | string | The hotel confirmation code. |
checkin | string | The check-in date. |
checkout | string | The check-out date. |
hotel | object | An object containing hotel details. |
bookedRooms | array | An array of booked room objects. |
roomType | object | An object containing room type details. |
adults | number | The number of adults. |
children | number | The number of children. |
rate | object | An object containing rate details. |
maxOccupancy | number | The maximum occupancy. |
retailRate | object | An object containing the retail rate information, including total price. |
guestInfo | object | An object containing guest details. |
createdAt | string | The creation date of the booking. |
cancellationPolicies | object | An object containing cancellation policies information. |
cancelPolicyInfos | Object | An array of cancellation policy info objects containing information about cancellation time, amount, and type. |
hotelRemarks | Array | An array of hotel remarks. |
refundableTag | string | The tag indicating if the rate is refundable or non-refundable. |
price | number | The price of the booking. |
msp | number | The MSP (Merchant Service Provider) price. |
commission | number | The commission amount. |
currency | string | The currency of the booking. |
The API returns the list of booking Id's for a given guest Id.
const guestId = "FrT56hfty";
const result = await liteApi.getBookingListByGuestId(guestId)
Name | Type | Description | Notes |
---|---|---|---|
guestId | string | The Guest Id of the user | [required] |
An array containing objects with the following properties:
Name | Type | Description |
---|---|---|
bookingId | string | The booking ID. |
The API returns the status and the details for the a specific booking Id.
const bookingId = "uSQ6Zsc5R";
const result = await liteApi.retrievedBooking(bookingId);
Name | Type | Description | Notes |
---|---|---|---|
bookingId | string | The Booking Id that needs to be retrieved | [required] |
An object containing booking information and room details.
Name | Type | Description |
---|---|---|
bookingId | string | The booking ID. |
clientReference | string | The client reference. |
status | string | The booking status. |
hotelConfirmationCode | string | The hotel confirmation code. |
checkin | string | The check-in date. |
checkout | string | The check-out date. |
hotel | object | An object containing hotel details. |
bookedRooms | array | An array of booked room objects. |
roomType | object | An object containing room type details. |
adults | number | The number of adults. |
children | number | The number of children. |
rate | object | An object containing rate details. |
maxOccupancy | number | The maximum occupancy. |
boardType | string | The board type. |
boardName | string | The board name. |
retailRate | object | An object containing the retail rate information, including total price. |
guestInfo | object | An object containing guest information. |
createdAt | string | The creation date of the booking. |
cancellationPolicies | object | An object containing cancellation policy details. |
cancelPolicyInfos | Object | An array of cancellation policy info objects containing information about cancellation time, amount, and type. |
hotelRemarks | Array | An array of hotel remarks. |
refundableTag | string | The tag indicating if the rate is refundable or non-refundable. |
currency | string | The currency code. |
price | number | The price of the booking. |
This API is used to request a cancellation of an existing confirmed booking. Cancellation policies and conditions will be used to determine the success of the cancellation. For example a booking with non-refundable (NRFN) tag or a booking with a cancellation policy that was requested past the cancellation date will not be able to cancel the confirmed booking.
const bookingId = "K8Hvb-85O";
const result = await liteApi.cancelBooking(bookingId);
Name | Type | Description | Notes |
---|---|---|---|
bookingId | string | The booking Id of the booking you would like to cancel. | [required] |
Name | Type | Description |
---|---|---|
bookingId | string | The booking ID. |
status | string | The booking status. |
cancellation_fee | number | The cancellation fee. |
refund_amount | number | The refund amount. |
currency | string | The currency of the booking. |
The guests API returns the unique guest IDs
const result = await liteApi.getGuestsIds();
If you want to retrieve the guest IDs of a specific user based on their email, you can provide the email as an optional parameter:
const email = "johndoe@nlite.ml"; //Optional
const result = await liteApi.getGuestsIds(email);
Name | Type | Description | Notes |
---|---|---|---|
string | the guest Email | [optional] |
An array containing objects with the following properties:
Name | Type | Description |
---|---|---|
guestId | string | The guest ID. |
FAQs
The **liteAPI** can be used to to do the following Get room rates & availability for a set of hotels Select a specific hotel with room availability and make a booking Manage the bookings - retrieve and cancel existing bookings Get static content for hote
The npm package liteapi-travel receives a total of 17 weekly downloads. As such, liteapi-travel popularity was classified as not popular.
We found that liteapi-travel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.