> ## Documentation Index
> Fetch the complete documentation index at: https://developers.partoo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Global reviews statistics

> This endpoint let you view the global reviews statistics for all your businesses subscribed to
**Review Management**.

You can use the following filters:
  - by date (statistics before and/or after a date)
  - by businesses (businesses id in list or not in list)
  - by keywords

The response is aggregated according to the previously selected filters.

In order to get analytics evolution overtime returned by specific time range, please refer to
**Qualitative Evolution** and **Quantitative Evolution** endpoints.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml get /reviews/stats
openapi: 3.1.0
info:
  title: Partoo Rest API
  version: v2
  license:
    name: © Copyright Partoo
    url: https://www.partoo.co/en/gtu-api/
  x-logo:
    url: >-
      https://partoo-client-images.s3.amazonaws.com/logo-partoo-restapi-white.png
  description: >
    ## Introduction

    The Partoo Rest API allows you to automate all the actions that are possible
    to do in the Partoo Web Application.


    The Partoo Rest API can be used for many different purposes:
      - Create/update/delete your businesses & users if you are a client.
      - Create/subscribe/manage organizations, businesses & users if you are a reseller.
      - Retrieve data on businesses you have access to if you are a publisher.
      - ...
servers:
  - url: https://api.partoo.co/v2
    description: Production server
  - url: https://api.sandbox.partoo.co/v2
    description: Sandbox server (dev environment for clients & partners)
security:
  - ApiKeyAuth: []
paths:
  /reviews/stats:
    get:
      tags:
        - Review analytics
      summary: Global reviews statistics
      description: >
        This endpoint let you view the global reviews statistics for all your
        businesses subscribed to

        **Review Management**.


        You can use the following filters:
          - by date (statistics before and/or after a date)
          - by businesses (businesses id in list or not in list)
          - by keywords

        The response is aggregated according to the previously selected filters.


        In order to get analytics evolution overtime returned by specific time
        range, please refer to

        **Qualitative Evolution** and **Quantitative Evolution** endpoints.
      operationId: getReviewAnalytics
      parameters:
        - $ref: '#/components/parameters/query_review_business__in'
        - $ref: '#/components/parameters/query_keywords'
        - $ref: '#/components/parameters/query_review_update_date__gte'
        - $ref: '#/components/parameters/query_review_update_date__lte'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewsStatisticsResponse'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
      deprecated: true
components:
  parameters:
    query_review_business__in:
      in: query
      name: business__in
      description: |
        Filter by business ids

        Return the reviews of the businesses given in list.
      schema:
        type: array
        items:
          $ref: '#/components/schemas/BusinessId'
    query_keywords:
      in: query
      name: keywords
      description: >
        Filter by keywords


        Return all the reviews with not-nullable content, that contain the
        provided list of keywords.


        **Note:** This is the content of the review and not the content of the
        reply.


        The filter accepts both simple and composed words.

        To indicate it's a composed keyword, add the `+` as separator.

        For example:

        - `keywords=bonjour` returns all reviews containing the keyword
        `bonjour`

        - `keywords=good+service` returns all reviews containing the combined
        keyword **good service**, without splitting the keyword. No reviews
        containing just **good** or just **service** will be returned.

        - `keywords=bonjour,good+service`: returns all reviews that contain
        either just **bonjour**, either just **good service** or both keywords
        at the same time.
      schema:
        type: array
        items:
          type: string
        example: bonjour,good+service
    query_review_update_date__gte:
      in: query
      name: update_date__gte
      description: >
        Filter by `update_date`


        Return all the reviews whose `update_date` >= `given_date`.


        For example : `update_date__gte=2019-01-01T00:00:00` will return all
        reviews from the first January of 2019

        until today.


        **Note** : The update dates are stored in UTC.
      schema:
        type: string
        format: datetime
        example: '2017-08-01T00:00:00'
    query_review_update_date__lte:
      in: query
      name: update_date__lte
      description: >
        Filter by `update_date`


        Return all the reviews whose `update_date` <= `given_date`.


        For example : `update_date__lte=2020-01-01T00:00:00` will return all
        reviews from the date of the first review

        until the first january of 2020.


        **Note** : The update dates are stored in UTC.
      schema:
        type: string
        format: datetime
        example: '2017-08-02T00:00:00'
  schemas:
    ReviewsStatisticsResponse:
      type: object
      properties:
        answer_time:
          type: number
          format: float
          description: >
            Average reviews answer time in seconds. Only measured for reviews
            with a comment from Google

            partner.

            It returns the time between the update date of a review and the
            creation date of its comments.
          example: 10493.90997409
        average:
          type: number
          format: float
          description: |
            Average reviews rating.
          maximum: 5
          minimum: 0
          example: 3.0394
        treated:
          type: number
          format: integer
          description: |
            Total number of treated reviews.
          example: 9
        not_treated:
          type: number
          format: integer
          description: |
            Total number of non treated reviews.
          example: 10
        answered:
          type: number
          format: integer
          description: |
            Total number of answered reviews (reviews with a comment).
          example: 8
        satisfied:
          type: number
          format: integer
          description: >
            Total number of reviews of type *satisfied*.


            *Satisfied* reviews are defined by a rating of 4 or more for
            google_my_business and tripadvisor or recommended

            for facebook.
          example: 10
        neutral:
          type: number
          format: integer
          description: >
            Total number of reviews of type *neutral*.


            *Neutral* reviews are defined by a rating of 3 for
            google_my_business and tripadvisor.
          example: 6
        dissatisfied:
          type: number
          format: integer
          description: >
            Total number of reviews of type *dissatisfied*.


            *Dissatisfied* reviews are defined by a rating of 2 or less for
            google_my_business and tripadvisor

            or not recommended for facebook.
          example: 3
        total:
          type: number
          format: integer
          description: |
            Total number of reviews.
          example: 19
    BusinessId:
      description: Business id
      type: string
      example: 5409c35a97bbc544d8e26737
  responses:
    '401':
      description: You are not authenticated
      content:
        application/json:
          schema:
            description: Error that occurs when you are not authenticated
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authentication:
                    type: string
                    default: User not authenticated
    '403':
      description: |
        You are not allowed to perform this action
      content:
        application/json:
          schema:
            description: >
              Error that occurs when you are authenticated but you are trying to
              perform an action you are not allowed to perform
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  authorization:
                    type: string
                    default: Operation not allowed
    '404':
      description: Resource does not exist
      content:
        application/json:
          schema:
            description: >-
              Error that occcurs when you are trying to reach a resource that
              does not exist
            type: object
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: string
                    default: Resource not found
  securitySchemes:
    ApiKeyAuth:
      description: >
        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.
      type: apiKey
      in: header
      name: x-APIKey

````