Table of Contents

Getting All Reviews From the Official Google Maps API

API chính thức của Google địa điểm Hạn mức the number of reviews you can fetch from it to 5 reviews only. Despite many developers hỏi 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

Với 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

Ví dụ cơ bản về tìm nạp 20 đánh giá theo cách sắp xếp mặc định (đánh giá có liên quan nhất).

				
					# 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"
				
			

Các loại parameter might be one of the following: “liên quan nhất” (default), “mới nhất,” “đánh giá cao nhất,” and “thấp nhất.”

				
					# 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"

				
			

Ngoài các đánh giá parameter, you can specify cutoffRating. Tham số chỉ định tối đa for “lowest_rating” or the tối thiểu 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"


				
			

Các cắt tham số sẽ giúp bạn chỉ tìm nạp các bài đánh giá mới nhất cho đến ngày cụ thể trong quá khứ. Có thể hữu ích khi bạn có tất cả các bài đánh giá trong cơ sở dữ liệu của mình và chỉ muốn tìm nạp các bài đánh giá đã được thêm vào kể từ lần cập nhật cuối cùng của bạn.

				
					# 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 nhảy tham số để kiểm soát nơi API bắt đầu trả về kết quả.

				
					# 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"
				
			

Tìm nạp nhiều đánh giá trong một yêu cầu có thể mất thời gian. Để tránh lỗi hết thời gian chờ từ máy chủ web, bạn nên sử dụng không đồng bộ các yêu cầu. Bằng cách này, bạn sẽ gửi các yêu cầu của mình tới Outscraper và truy xuất chúng sau đó (thường là trong 1-3 phút, depending on the number of reviews) with the Yêu cầu điểm cuối Kết quả.

A good practice is sending async requests and checking the results at 15-sec intervals. Check out this Triển khai Python Nếu cần.

				
					# 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"
				
			

Video Tutorial

Câu hỏi thường gặp

Các câu hỏi và câu trả lời thường gặp nhất

Mặc dù, Google giới hạn số lượng bài đánh giá bạn có thể tìm nạp bằng API chính thức của nó, bạn có thể sử dụng API đánh giá Google Maps được cung cấp bởi Outscraper để nhận tất cả các đánh giá từ mọi nơi.

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.

Extracting data from Google with browsers has its pros and cons. Although you can develop the scraper by yourself, during scaling, it might lead to big expenses for using servers with huge amounts of CPUs in order to handle browser emulations. Additionally, there should be a person who maintains the crawler and updates it during Google site changes.

Bằng cách sử dụng Outscraper PlatformAPI, or SDKs Outscraper provides the easiest solution for businesses and individuals to start Scraping Reviews from Google without handling proxies, browser emulation, and investing in developing.

Categories: API

0 Comments

Trả lời

Trình giữ chỗ hình đại diện