Giter VIP home page Giter VIP logo

airbnb-api's Introduction

Hello ๐Ÿ‘‹

I'm Halmon Lui, a Fullstack Software Engineer at Indeed, a hackathon addict and a climbing addict.

If I'm not at my desk, I'm on top of a rock (or at least trying to be).

Visit my website at https://halmonlui.com

Currently working on an exciting project come check it out!

Halmon's github stats

airbnb-api's People

Contributors

halmonlui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

airbnb-api's Issues

getSpecificListing: Photos

Background
https://www.airbnb.com/rooms/26667415

Scroll down to reviews section and notice the images of the stay.:

image

This images can be accessed using this URL: https://www.airbnb.com/rooms/26667415/photos

image

  • Make sure to set window size to 500, 951 so the page loads with mobile view.
  • 26667415 is the ID of the listing
  • Append the '/photos' to the end of the original URL

If you inspect the image, we have an image src URL
image

Reference selenium_scrape_language_ids.ipynb for a general idea on how to do this. If you have any questions always feel free to ask on the discord!

Specs

  • We want to create a jupyter notebook function that takes in the listing ID (look at the end of the URL: 26667415) and return the images in an Array format seen below.

  • Selenium is probably not needed for this, can probably request window size in the fetch header (viewport-width maybe?).
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers

  • Don't need to create a Flask endpoint, only the helper function in a jupyter notebook. Another issue will be opened for that.

[
"https://a0.muscache.com/im/pictures/5aa90401-1b1f-4775-8a76-82b77c6c30a8.jpg?aki_policy=large",
"https://a0.muscache.com/im/pictures/5aa90401-1b1f-4775-8a76-82b77c6c30a8.jpg?aki_policy=large",
"https://a0.muscache.com/im/pictures/5aa90401-1b1f-4775-8a76-82b77c6c30a8.jpg?aki_policy=large",
"https://a0.muscache.com/im/pictures/5aa90401-1b1f-4775-8a76-82b77c6c30a8.jpg?aki_policy=large",
...
]

We used the same link here, but they should be the unique src link of each image

getSpecificListing: Summary Text

Background
https://www.airbnb.com/rooms/26667415

Scroll down to reviews section and notice the summary of the stay.:

image

This summary can be accessed using this URL: https://www.airbnb.com/rooms/26667415/description

  • Make sure to set window size to 500, 951 so the page loads with mobile view.
  • 26667415 is the ID of the listing
  • Append the '/description' to the end of the original URL

Reference selenium_scrape_language_ids.ipynb for a general idea on how to do this. If you have any questions always feel free to ask on the discord!

Specs

  • We want to create a jupyter notebook function that takes in the listing ID (look at the end of the URL: 26667415) and return the summary text JSON format seen below.

  • Selenium is probably not needed for this, can probably request window size in the fetch header (viewport-width maybe?).
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers

  • Don't need to create a Flask endpoint, only the helper function in a jupyter notebook. Another issue will be opened for that.

{
"Summary": "- Early check-in / late check-out almost always available!
- Restaurants, bar, hookah and grocery just 2 blocks away!
- Shuttle from your front door to 6TH STREET downtown nightlife until 3:20 AM for $1
- 4K TV w/ Chromecast
- Say It to Play It! Play your music or a movie with just your voice!
- Basic cable by Pluto TV
- Party responsibly without worry of noise complaints!
- Private Pool for Condos"
}

getExperiences Investigation/Reverse Engineer

Background
We want to be able to request for the experiences page with all of the filter options just like we can right now with /getListings.

image
image

Luckily we only have 4 available filters for experiences unlike the many we have for getListings. We also only have 2 search options (location and dates)

image
Here's an image of the type of research done to get the parameters used in getListings.

Specs
If you take this ticket, let me know so I can give you permission to edit the table.

Find out what parameter names are used to allow the user to search by city/state, date, and each filter. Add all of this information to the spreadsheet as it will be referenced to develop the scripts/endpoints later on.

https://www.airbnb.com/s/Boston--MA/experiences?place_id=ChIJGzE9DS1l44kRoOhiASS_fHg&refinement_paths%5B%5D=%2Fexperiences&search_type=unknown&tab_id=experience_tab&map_toggle=false&query=Boston%2C%20MA
You can see a bunch of the parameters in the URL itself when you click on filters and search options with '&query=' or '&tab_id='. Find out what all of these do

Links that may help you out:
Reverse engineer an API

getExperiences: Categories

Background
https://www.airbnb.com/s/Boston--MA/experiences?place_id=ChIJGzE9DS1l44kRoOhiASS_fHg&refinement_paths%5B%5D=%2Fexperiences&search_type=unknown&tab_id=experience_tab&map_toggle=false&query=Boston%2C%20MA

Click link and scroll down to categories as seen in image below:
image
Notice the arrow to view more categories

Specs
We want to be able to get all the category names as well as the number of experiences there are. Create a Jupyter notebook script to do this. We do not know the total number of categories so be prepared for an n number of cataegories. Return a JSON object in the following format:

A Flask endpoint is not needed yet. This will be added in a separate issue.

[
  {
    "category": "Art and culture",
    "num_experiences": 32
  },
  {
    "category": "Art and culture",
    "num_experiences": 32
  },
  {
    "category": "Art and culture",
    "num_experiences": 32
  },
  ...
]

getExperiences: Languages

Background
https://www.airbnb.com/s/Boston--MA/experiences?place_id=ChIJGzE9DS1l44kRoOhiASS_fHg&refinement_paths%5B%5D=%2Fexperiences&search_type=unknown&tab_id=experience_tab&map_toggle=false&query=Boston%2C%20MA

image

Click into the link and notice the Languages Offered filter seen above.
We are unsure if the languages and IDs offered are different than that of Listings so we are going to create a script to look into it.

Specs
Create a Jupyter Notebook function that returns all of the languages offered and their unique IDs in a JSON object. This should be very similar to the existing /getLanguages endpoint and notebook.
Compare results with the ones from /getLanguages and see if there are any differences. Reference the selenium_scrape_language_ids.ipynb when developing this.

getSpecificListing: Amenities

Background
https://www.airbnb.com/rooms/26667415

Scroll down to reviews section and notice the summary of the stay.:

image

This summary can be accessed using this URL: https://www.airbnb.com/rooms/26667415/amenities

  • 26667415 is the ID of the listing
  • Append the '/amenities' to the end of the original URL

Reference selenium_scrape_language_ids.ipynb for a general idea on how to do this. If you have any questions always feel free to ask on the discord!

Specs

  • We want to create a jupyter notebook function that takes in the listing ID (look at the end of the URL: 26667415) and return the summary text JSON format seen below (says '...' at the bottom but we want to retrieve all of the amenities and put them in the array.

  • Selenium is not needed for this

  • Don't need to create a Flask endpoint, only the helper function in a jupyter notebook. Another issue will be opened for that.

[
{"amenity": "Wifi", "note": "Continuous access in the listing"},
{"amenity": "Cable TV", "note": Null},
...
]

(BLOCKED) getSpecificListing

Background
https://www.airbnb.com/rooms/26667415

Click into link and notice all of the data there is about the listing.

Specs
We want to add an endpoint to retrieve specific listing data by ID and return a giant JSON object with all of the data in it. To do this we're going to first need a bunch of working jupyter notebooks with scripts that scrape each part of the individual listing. These are under the getSpecificListing Projects label and Milestone.

Some of the subcategories include:
Get specific listing summary
Get specific listing photos
Get specific listing amenities
Get specific listing sleeping arrangements
Get specific listing review breakdown
Get specific listing reviews
Get specific listing Things to know
Get specific listing calendar availability

getSpecificListing: Review Breakdown

Background
https://www.airbnb.com/rooms/26667415

Scroll down to reviews section and notice the breakdown of the review categories:

image

Reference selenium_scrape_language_ids.ipynb for a general idea on how to do this. If you have any questions always feel free to ask on the discord!

Specs
We want to create a jupyter notebook function that takes in the listing ID (look at the end of the URL: 26667415) and return the reviews breakdown in JSON format seen below.

Don't need to create a Flask endpoint, only the helper function in a jupyter notebook. Another issue will be opened for that.

{
"Cleanliness": 4.8,
"Accuracy": 4.8,
"Communication": 4.9,
"Location": 4.8,
"Check-in": 4.8,
"Value": 4.8
}

getHouseRules

We need to get house rules + their IDs from the filters. Return in a json format.

Create a jupyter notebook for it and then add it to the flask server/documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.