Collecting reviews
There are two ways to collect reviews written for a particular place:
Following a nimble_reviews_link
nimble_reviews_linkPreviously, we discussed how to search for places or directly request a place with a place_id, both of which produce a relevant nimble_reviews_link that can be used to request reviews for the relevant place. For example, for the following reviews link:
https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8A request that executes the above reviews link would look like:
curl --location --request GET 'https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8' \
--header 'Authorization: Basic <credential string>'import requests
url = f"https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8"
headers = {
'Authorization': 'Basic <credential string>'
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
const axios = require('axios');
const url = `https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8`;
const headers = {
'Authorization': 'Basic <credential string>'
};
axios.get(url, { headers })
.then(response => {
console.log(response.status);
console.log(response.data);
})
.catch(error => {
console.error(error);
});
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8"
headers := map[string]string{
"Authorization": "Basic <credential string>",
}
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println(err)
return
}
for key, value := range headers {
req.Header.Set(key, value)
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
// Read the response body if needed
// body, err := ioutil.ReadAll(resp.Body)
// fmt.Println(string(body))
}
Using a place_id or data_id
place_id or data_idIf you have a place_id or data_id from a previous search, place request, or independently from another source, you can use it to directly gather reviews left for that place. For example:
curl --location --request POST 'https://api.webit.live/api/v1/realtime/serp' \
--header 'Authorization: Basic <credential string>' \
--header 'Content-Type: application/json' \
--data-raw '{
"search_engine": "google_maps_reviews",
"place_id": "desired-place-id"
}'import requests
url = 'https://api.webit.live/api/v1/realtime/serp'
headers = {
'Authorization': 'Basic <credential string>',
'Content-Type': 'application/json'
}
data = {
"search_engine": "google_maps_reviews",
"place_id": "desired-place-id"
}
response = requests.post(url, headers=headers, json=data)
print(response.status_code)
print(response.json())
const axios = require('axios');
const url = 'https://api.webit.live/api/v1/realtime/serp';
const headers = {
'Authorization': 'Basic <credential string>',
'Content-Type': 'application/json'
};
const data = {
"search_engine": "google_maps_reviews",
"place_id": "desired-place-id"
};
axios.post(url, data, { headers })
.then(response => {
console.log(response.status);
console.log(response.data);
})
.catch(error => {
console.error(error);
});
package main
import (
"bytes"
"fmt"
"net/http"
"encoding/json"
)
func main() {
url := "https://api.webit.live/api/v1/realtime/serp"
payload := []byte(`{
"search_engine": "google_maps_reviews",
"place_id": "desired-place-id"
}`)
headers := map[string]string{
"Authorization": "Basic <credential string>",
"Content-Type": "application/json",
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(payload))
if err != nil {
fmt.Println(err)
return
}
for key, value := range headers {
req.Header.Set(key, value)
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
// Read the response body if needed
// body, err := ioutil.ReadAll(resp.Body)
// fmt.Println(string(body))
}
Request options
search_engine
Required
Enum: google_maps_search | google_maps_place | google_maps_reviews
The search engine from which to collect results.
place_id/data_id
Required
String
A string used by Google to identify a particular place. place_id and data_id cannot both be used in a single request.
sort
Optional
Enum:
relevant |
newest |
lowest_rating | highest_rating
Defines the order in which Google Maps reviews are returned.
domain
Optional
String
Search through a custom top-level domain of Google. eg: "co.uk"
country
Optional (default = all)
String
Country used to access the target URL, use ISO Alpha-2 Country Codes i.e. US, DE, GB
locale
Optional (default = en)
String
String | LCID standard locale used for the URL request. Alternatively, user can use auto for automatic locale based on country targeting.
parse
Optional (default = true)
Enum: true | false
Instructs Nimble whether to structure the results into a JSON format or return the raw HTML.
Response
200 - OK
{
"status": "success",
"html_content":"Protobuff output",
"status_code": 200,
"headers": {
...
},
"parsing": {
"status": "success",
"entities": {
"Review": [
{
"description": "Sample review body",
"entity_type": "Review",
"paging_token_id": "some-token-id",
"photos": [
{
"image_url": "wwww-sample-url.com",
"position": 0,
"source_type": "photos:gmm_ios_review_post"
}
],
"rating": "5",
"relative_time": "2 months ago",
"review_like_count": 0,
"review_maps_link": "sample-review-url",
"review_timestamp": 1670529025279,
"source_type": "",
"user_image_link": "sample-image-url",
"user_link": "sample-user-url",
"user_review_count": 66,
"user_title": "Local Guide · 66 reviews",
"username": "sample-user"
},
{
...
},
...
]
},
"total_entities_count": 10,
"entities_count": {
"Review": 10
},
"metrics": {}
},
"url": "https://www.google.com/maps/preview/review/listentitiesreviews?authuser=0&pb=!1m2!1y9926595081738493951!2y3398227499087174845!2m1!2i10!3e1!4m6!3b1!4b1!5b1!6b1!7b1!20b0!5m2!1scjHpY_DuJqSr5NoP8P6wuAo!7e81",
"nimble_links": {
"next_page": "https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8&paging_token_id=CAESBkVnSUlDZw%3D%3D"
}
}When requesting reviews, the returned HTML will always be a Google Protobuff output. This is a result of Google Maps' output. We recommend always using the parsed data for maximum simplicity.
Traversing paginated reviews
Some providers automatically paginate reviews so that only a certain number are displayed at once. If surplus reviews exist, an attribute named next_page will be present in Nimble's response which can be used to request the next batch of reviews.
In the above response, the next_page attribute contains the full address needed to request the next page's batch of reviews:
https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8&paging_token_id=CAESBkVnSUlDZw%3D%3DThe below example demonstrates how to use the provided next_page URL in a request:
curl --location --request GET 'https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8&paging_token_id=CAESBkVnSUlDZw%3D%3D' \
--header 'Authorization: Basic <credential string>'import requests
url = f"https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8&paging_token_id=CAESBkVnSUlDZw%3D%3D"
headers = {
'Authorization': 'Basic <credential string>'
}
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
const axios = require('axios');
const url = `https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8&paging_token_id=CAESBkVnSUlDZw%3D%3D`;
const headers = {
'Authorization': 'Basic <credential string>'
};
axios.get(url, { headers })
.then(response => {
console.log(response.status);
console.log(response.data);
})
.catch(error => {
console.error(error);
});
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.webit.live/api/v1/realtime/serp?search_engine=google_maps_reviews&csrf_token=cjHpY_DuJqSr5NoP8P6wuAo&place_id=ChIJ_58pLKJZwokRvRwO5eftKC8&paging_token_id=CAESBkVnSUlDZw%3D%3D"
headers := map[string]string{
"Authorization": "Basic <credential string>",
}
req, err := http.NewRequest("GET", url, nil)
if err != nil {
fmt.Println(err)
return
}
for key, value := range headers {
req.Header.Set(key, value)
}
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
// Read the response body if needed
// body, err := ioutil.ReadAll(resp.Body)
// fmt.Println(string(body))
}
500 Error
{
"status": "error",
"task_id": "<task_id>",
"msg": "can't download the query response - please try again"
}400 Input Error
{
"status": "failed",
"msg": error
}Response Codes
200
OK.
400
The requested resource could not be reached.
401
Unauthorized/invalid credental string.
500
Internal service error.
501
An error was encountered by the proxy service.
Last updated
