nderkach / airbnb-python

A Python wrapper around the Airbnb API (unofficial)
Do What The F*ck You Want To Public License
186 stars 66 forks source link

Set location and then get listings for that Latitude and Longitude #6

Closed hemangsk closed 5 years ago

hemangsk commented 6 years ago

Hey!

Thanks for the really awesome package. I've a minor doubt regarding the usage, we want to set the location and then get listings for that particular location. As far as I understand, the package sends user_id to fetch the listings presently. Could you please suggest a way which I can get listings for any given set of Lat-Long, instead of sending user_id which will only get listings for the current location.

Thanks a ton!

nderkach commented 6 years ago

Hey!

At the moment the package doesn't support searching for listings in a given location.

I've done some research and it seems that there at least two way to do that with a mobile app:

  1. Search queries (e.g. "San Francisco, CA, United States"). This would require a call to their location name autocomplete endpoint. This is performed when you type in the search box on the top of the iOS app.
  2. Search within a coordinate rectangle (defined by SW/NE lat/lng). This is performed when you switch to the map mode.

Which one is more useful?

mferrantini commented 6 years ago

Hi nderkach, +1 for coordinates 👍

nderkach commented 5 years ago

I've pushed an update which allows you to search by both coordinates and with a query.

For example:

from airbnb import Api
api = Api()
api.get_homes(gps_lat=55.6123352, gps_lng=37.7117917)
hemangsk commented 5 years ago

Thank you so much 🎉 :) 🙏