Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save smj10j/a2f1b5e9faa550028874 to your computer and use it in GitHub Desktop.
Save smj10j/a2f1b5e9faa550028874 to your computer and use it in GitHub Desktop.
Airbnb Availability Printed on DOM from JSON Response
// Requires jQuery
// Running from https://www.airbnb.com/rooms/4469705 works
// JSFiddle example of installing as a bookmarklet: http://jsfiddle.net/smj10j/sjwko4bp/
var listingId = window.location.pathname.replace('/rooms/','');
var calData = {};
$.getJSON('https://www.airbnb.com/api/v1/listings/'+listingId+'/calendar?key=d306zoyjsyarp7ifhu67rjxn52tv0t20', function(data) {
calData = data.calendar;
calData.dates.forEach(function(date) {
$('body').append('<div>'+
date.date + ' ' +
(date.price_local ? (date.price_local+'/night') : '') +
'</div>');
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment