Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't get more than 300 listings. #15

Open
malong204-dev opened this issue May 14, 2020 · 7 comments
Open

I can't get more than 300 listings. #15

malong204-dev opened this issue May 14, 2020 · 7 comments

Comments

@malong204-dev
Copy link

When I search for listings using the get_homes() method, I can't get more than 300 listings.
Even though there are more listings and I increase the page number, it doesn't return after 300th listing.
Is there any way to get all listings?

@AtelierCartographique
Copy link

I actually have a similar problem but with only 50 listings. Has anyone found the reason why?

@malong204-dev
Copy link
Author

50 is the maximum number for one page. to get more listings, you have to set items_offset parameter.

@malong204-dev
Copy link
Author

But though I set items_offset to 300, it doesn't return 301th~350th listings.

@AtelierCartographique
Copy link

Even with "api.get_homes('toronto, ontario', items_per_grid = 50, offset = 51)", I can't seem to get more results...

@seanpdwyer7
Copy link

@malong204-dev You will have to iterate through each page utilizing a for loop. I would suggest utilizing a function to help get all of the listing within a single market. i.e.

def get_listing(market_name, page)
              city=[]
              for i in range(page):
                   city.append(get_api_function_name(market_name, i)
                   print(i)
             df = pd.concat(city)
             return df

@tcardim
Copy link

tcardim commented Oct 28, 2020

So, I just ran with offset from 0 to 400 with increments of 50. Offsets 300, 350, and 400 all gave the same data. As explained in the readme, the maximum number of listings you can get for a particular city using get_homes() method is 306. I understood items_per_grid as items per page, but in reality the items per page is 50. You cannot get more listings than 306 no matter if you loop or adjust the offset.

Does anyone have a solution around this? My goal (as likely everyone else's) is to get all the listings for a particular city.

Thank you in advance if anyone has the answer and is kind enough to share!

@klane
Copy link

klane commented Nov 13, 2020

@tcardim My workaround was to run more localized queries using different neighborhoods within the city. If you look at the JSON output, you will find a couple neighborhood fields you can use to build up a set of distinct neighborhoods that the API might recognize (some produced no results for me). Using this strategy, I was able to find a few thousand unique listings. However, I was searching within a major US city and I cannot say if this will work elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants