Spis treści

Getting All Reviews From the Official Google Maps API

Oficjalne API miejsc Google granice the number of reviews you can fetch from it to 5 reviews only. Despite many developers pytać for pagination and sorting parameters since 2015, the limitation still exists. Fortunately, there are some tools you can use from your code to get ratings & reviews in the right way.

The Ultimate Way of Fetching Reviews

Outscraper’s API, you can fetch any amount of reviews from any business. You can sort the reviews and paginate over the pages. It’s possible to ignore empty reviews by using the “ignoreEmpty” parameter, and there are many advanced parameters like cutoff, cutoffRating, etc.

Reviews API Examples

Podstawowy przykład pobierania 20 recenzje według domyślnego sortowania (najbardziej trafne recenzje).

				
					# fetch 20 most relevant reviews
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID&reviewsLimit=20&async=false" -H  "X-API-KEY: API_KEY"
				
			

ten sortować parameter might be one of the following: “najbardziej istotne” (default), “Najnowsza,” “najwyższa_ocena,” and “najniższa_ocena.”

				
					# fetch reviews with highest rating first
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID&reviewsLimit=20&sort=highest_rating&async=false" -H  "X-API-KEY: API_KEY"

# fetch reviews with lowest rating first
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID&reviewsLimit=20&sort=lowest_rating&async=false" -H  "X-API-KEY: API_KEY"

				
			

Dodatkowo Liczba recenzji parameter, you can specify odcięcieOcena. Parametr określa maksymalny for “lowest_rating” or the minimum for “highest_rating” ratings for reviews.

				
					# fetch reviews with 5 and 4 stars ratings only
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID&reviewsLimit=1000&sort=highest_rating&cutoffRating=4&async=false" -H  "X-API-KEY: API_KEY"


				
			

ten odciąć parametr pomoże Ci pobrać tylko najnowsze recenzje do określonej daty w przeszłości. Może być przydatne, gdy masz wszystkie recenzje w swojej bazie danych i chcesz pobrać tylko te opinie, które zostały dodane od czasu ostatniej aktualizacji.

				
					# fetch reviews till the specific date (cutoff)
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID&reviewsLimit=250&sort=newest&cutoff=1629269269&async=false" -H  "X-API-KEY: API_KEY"
				
			

You can use built-in pagination to fetch many pages of reviews. Use the pominąć parametr do kontrolowania, gdzie API zaczyna zwracać wyniki.

				
					# page 1, sorted by newest
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID&reviewsLimit=20&sort=newest&async=false" -H  "X-API-KEY: API_KEY"

# page 2, sorted by newest
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID&reviewsLimit=20&sort=newest&skip=20async=false" -H  "X-API-KEY: API_KEY"
				
			

Ujmujący wiele recenzje w jednym żądaniu mogą zająć trochę czasu. Aby zapobiec błędom przekroczenia limitu czasu z serwera WWW, zaleca się użycie asynchroniczny upraszanie. W ten sposób prześlesz swoje żądania do Outscraper i odzyskasz je później (zwykle w ciągu 1-3 minuty, depending on the number of reviews) with the Punkt końcowy żądań wyników.

A good practice is sending async requests and checking the results at 15-sec intervals. Check out this Implementacja Pythona Jeśli to konieczne.

				
					# step 1: submit the task and get request id
curl -X GET "https://api.app.outscraper.com/maps/reviews-v2?query=PLACE_ID_1&reviewsLimit=2000&sort=newest&async=true" -H  "X-API-KEY: API_KEY"

# step 2: retrieve the task results later (usually within 1-3 minutes, depends on the amount of reviews)
curl -X GET "https://api.app.outscraper.com/requests/REQUEST_ID"
				
			

Samouczek wideo

FAQ

Najczęściej zadawane pytania i odpowiedzi

Chociaż Google ogranicza ilość recenzji, które możesz pobrać za pomocą oficjalnego API, możesz użyć Interfejs API recenzji Map Google udostępnione przez Outscraper, aby uzyskać wszystkie recenzje z dowolnych miejsc.

Google Places API can be used for Google reviews. But there is only 5 review limit. If you want to download reviews without any limits, you can use an alternative service. Outscraper Google Maps Reviews API is one of these alternative services.

If the reviews you want to get don’t belong to your own Google Maps profile, you won’t be able to get all the reviews. You can get up to 5 reviews from other businesses. But with Outscraper Google Maps Reviews API, you can collect unlimited reviews without this limit.

Wyciąganie danych z Google za pomocą przeglądarek ma swoje plusy i minusy. Wprawdzie można stworzyć scrapera samemu, ale podczas skalowania może to pociągnąć za sobą duże wydatki na wykorzystanie serwerów z ogromną ilością procesorów do obsługi emulacji przeglądarek. Dodatkowo, powinna być osoba, która utrzymuje crawlera i aktualizuje go podczas zmian w witrynie Google.

Używając Outscraper PlatformaAPIlub SDKs Outscraper zapewnia najprostsze rozwiązanie dla firm i osób prywatnych, aby rozpocząć Scraping Recenzje z Google bez obsługi serwerów proxy, emulacji przeglądarki, i inwestowania w rozwój.

Kategorie: API

0 Komentarze

Dodaj komentarz

Symbol zastępczy awatara