问题
I am trying to find all "restaurants" or "insurance agencies" for example, in a city or country. Okay, maybe a country is too broad but mainly large cities.
I am using the Google Places API and python but I see that you can only use a "radius" parameter or "rankby=distance". The problem is that, according to the docs, I believe that each query can only return 20 results on 3 pages, or 60 results (correct me if I am wrong). So if I wanted to find all the restaurants in New York for example, I would have to start at the center or something and set "rankby=distance" so that it would give me the 60 closest results within a set radius. But then I don't know what my next query would be...
Any ideas how to go about doing this?
回答1:
Unfortunately you can't get more than 60 results from the Google Places API; at least not without breaking the terms of service:
Unless you have received prior written authorization from Google (or, as applicable, from the provider of particular Content), you must not: (d) use the Products in a manner that gives you or any other person access to mass downloads or bulk feeds of any Content, including but not limited to numerical latitude or longitude coordinates, imagery, and visible map data
Furthermore, as you can read here:
It's in large part a licensing issue. But it's also because the goal of the Places API is not to facilitate scraping or aggregation of Google Places data in the way you describe. Any application that does so is almost certainly not compliant with the Google Maps or Google Maps API Terms of Service, and is likely to be blocked from using the API or other Google services at any time. The Places API is intended to allow apps to offer their users a way to discover of identify Places nearby. There is a practical limit to the number of search results that a user will scan through and consider. I don't believe it's necessary to offer users 200 results, and I suspect that doing so would only serve to increase development of applications that scrape Google Places data, without adding significant benefit or utility to the types of apps the API is intended to serve, and that we wish to encourage.
As a further reference, have also a look at this answer.
回答2:
I made such a tool a while ago https://github.com/Pithikos/Geoexplorer. You can see here how it looks like.
I even have a working example with Google Places that you can use if you have an API key.
git clone https://github.com/Pithikos/Geoexplorer.git
- Add your API key in the file examples/google_radar_search.py
python3 examples/google_radar_search.py
- Open GUI/index.html in a browser
This will look for groceries named "ICA" in a big area in Sweden. You can configure the area being scanned at config.py and your search queries in google_radar_search.py.
This should run fine on any Ubuntu after 13.10. If you use Windows or an earlier version read here (the Install dependencies section).
You can also add any other service you like by using the API. Keep in mind to not violate Google's or any other company's policy when using it. I made this solely to test which service would give me the best results before deciding which of them to use.
回答3:
Use Radar Search. Check the documentation here.
You can get 200 results in one go but it will take 5 reqests from your quota. The results have less details as compared to nearby search but you can always get that by using place details search.
Hope this helps.
Notice: Radar search is deprecated as of June 30, 2018. After that time, this feature will no longer be available.
回答4:
Unfortunately Google does not want people to be able to do this, and so they design their API to prevent people from doing things like this. However there are alternatives. If you want to do this with API access Factual is the leader; they have 102 million entries in 50 countries.
回答5:
I created crawler on top of Google Map search, you can use it for this use case. You can check the crawler here.
回答6:
from my understanding .. we would recommend use cross api reference in my scenario in would use nesting of async WCF call to area divided by limited call laid down by google
来源:https://stackoverflow.com/questions/14026759/how-to-get-all-places-or-specific-type-of-place-such-as-a-restaurant-in-a-city