Hey there all. The coding yesterday to get the CSV was pretty quick and dirty, so would need some massaging to be put into a workable format. I did it in ColdFusion just because I had some similar code on a client’s server already written to get it done quicker, but I could migrate the code to PHP.
I used this http://airbnbapi.com primarily the “View Listing Info”. I had hoped that maybe the “Listing Search” would work via the “disaster_id” that AirBnB posted, or the $0 or something, but after a few unsuccessful guesses and tries I just moved forward.
I started with a scrape of the listing ID from the HTML code on all 35 pages, literally just loading that HTML, looking for the “data-url” of “/rooms/XXXX” and collected a list of all those IDs.
I should say here that while we can work fast doing things this way, it’s definitely worth trying to engage AirBnB directly too to see if there’s a better way to get this data, and it’s also possible there’s a way to use the API to grab that list directly.
Anyway, then looping through that ID list, called the API for the listing info, it returns the full JSON for that listing, example here:
Then just parsed out the fields necessary, putting together a few things dynamically…the URLs, checking for pets, etc.
If this is going to be something to continue using, and also if AirBnB can’t provide the information directly then it’d definitely make sense to systemize it, have the parsed data saved into a database instead, process to regularly re-scape, check for new IDs, etc.
I’m happy to provide whatever I can, just let me know how you’re working, what you’d need me to do, etc. There are some things with the API to check, if there are any limitations with the client ID being used there, and then for more complex things like pulling calendar data, an access token is also necessary, and I haven’t tried doing that to see what’s returned. Again, did it very quick and dirty so would need to check more of that.