Skip to content

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

Open

Description

@malong204-dev

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?

Activity

  1. AtelierCartographique commented on May 16, 2020

    @AtelierCartographique

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

  2. malong204-dev commented on May 16, 2020

    @malong204-dev
    Author

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

  3. malong204-dev commented on May 16, 2020

    @malong204-dev
    Author

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

  4. AtelierCartographique commented on May 17, 2020

    @AtelierCartographique

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

  5. spd713 commented on Jun 19, 2020

    @spd713

    @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
    
  6. tcardim commented on Oct 28, 2020

    @tcardim

    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!

  7. klane commented on Nov 13, 2020

    @klane

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions