After using the data returned from the AirBnB listings search API (#25), I realized that the returned information was not informative nor specific enough to be rendered back to the user. Retrospectively, the AirBnB get listing info API (#39) returns a lot more informative and well-formatted data -- a win/win for the user, and me (the programmer)
As a result, I've decided to incorporate the two AirBnB API's by
First - getting the group of listings that corresponds to the user's searching needs/requests
Second - while iterating through the array of returned listings...
get the iterated listing's unique AirBnB id
call the AirBnB get listing info API with the extracted AirBnB id
only select & save the necessary info from each returned result into an object
Third - push the object into an array & repeat
when there are no more listings, return the new array to the Search Component
Example of the two AirBnB responses & how to extract price information
// getting the price info from AirBnB's get listings search response
pricing_quote: {
checkin: null,
checkout: null,
guests: 1,
listing_currency: "EUR",
localized_currency: "USD",
localized_nightly_price: 53,
localized_service_fee: 0,
localized_total_price: 0,
nightly_price: 51,
service_fee: 0,
total_price: 0
},
// getting the price info from AirBnB's get listing Info response
price_formatted: "$600",
After using the data returned from the AirBnB listings search API (#25), I realized that the returned information was not informative nor specific enough to be rendered back to the user. Retrospectively, the AirBnB get listing info API (#39) returns a lot more informative and well-formatted data -- a win/win for the user, and me (the programmer)
As a result, I've decided to incorporate the two AirBnB API's by
Example of the two AirBnB responses & how to extract price information