Skip to main content
GET
/
review_analytics
/
metrics
Get Review metrics
curl --request GET \
  --url https://api.partoo.co/v2/review_analytics/metrics \
  --header 'x-APIKey: <api-key>'
import requests

url = "https://api.partoo.co/v2/review_analytics/metrics"

headers = {"x-APIKey": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-APIKey': '<api-key>'}};

fetch('https://api.partoo.co/v2/review_analytics/metrics', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.partoo.co/v2/review_analytics/metrics",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "x-APIKey: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.partoo.co/v2/review_analytics/metrics"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-APIKey", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.partoo.co/v2/review_analytics/metrics")
  .header("x-APIKey", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.partoo.co/v2/review_analytics/metrics")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-APIKey"] = '<api-key>'

response = http.request(request)
puts response.read_body
{ "page": 1, "count": 2, "max_page": 1, "data": [ { "dimension": "59b2645db12ff60643ef832c", "dimension_name": "Business 1", "dimension_info": { "address_full": "190 rue Championnet", "city": "Paris", "zipcode": "75018", "code": "PTOCODE1" }, "metrics": { "average_rating": 2.31 } }, { "dimension": "60b2645fb12ff60643ef8344", "dimension_name": "Business 2", "dimension_info": { "address_full": "190 rue Championnet", "city": "Paris", "zipcode": "75018", "code": "PTOCODE2" }, "metrics": { "average_rating": 4.31 } } ] }

Authorizations

x-APIKey
string
header
required

The authentication system on Partoo API is using API Key that should be put in the header of the request (the name of the header is x-APIKey). An api_key is linked to a user. This user's role will give you different access level to the API features.

Query Parameters

metrics
enum<string>
required

List of analytics to return. At least one in that list.

Available options:
average_rating,
rating_distribution,
reviews_count,
reply_time,
reply_means,
average_rating_distribution,
rank
dimensions
enum<string>

How the returned data will be aggregated. If no dimension is given, the request will return the sum of each metric for all requested days and businesses.

Available options:
day,
week,
month,
year,
business,
group,
user,
tag
order_by
string

See above for the list of all orders available. At most one in the list.

  • - before a field to order_by DESC, nothing for ASC
Example:

"-average_rating"

business__in
string[]

Filter by business ids

Business id

business__notin
string[]

Filter by all allowed businesses except the ones given in business__notin

Business id

groups
integer[]

Filter by groups ids

Group id

tags
integer[]

Restrict the data returned on reviews that have been assigned the specified tags.

Tag id

update_date__gte
string<datetime>

Restrict the data returned on reviews which update_date are after the given date.

update_date__lte
string<datetime>

Restrict the data returned on reviews which update_date are before the given date.

page
integer
default:1

The page number you want to request.

Required range: x >= 1
per_page
integer
default:30

The maximum number of result items to return in a page.

Response

OK

page
integer

Current page number

Example:

1

max_page
integer

Last page number

Example:

10

count
integer

Number of resources complying with filters

Example:

287

data
object[]