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

# Get completion rate stats from your businesses

> This endpoint works in the same way as the [operation/searchBusinesses](/api-reference/businesses/search-for-businesses) endpoint, but instead of returning data on all returned businesses, this endpoint returns completion rate statistics aggregated across all businesses.

The statistics returned are the average completion rate for all businesses that fit the given filters, as well as the count of businesses with a low, medium, and high respectively. The thresholds for low, medium, and high can be found below in the response details.

Note that this endpoint works in the exact same way as [operation/searchBusinesses](/api-reference/businesses/search-for-businesses) (with the exception of parameters that format the output, such as `order_by` and pagination), but the return value is different.




## OpenAPI

````yaml /assets/openapi/openapi-bundled.yaml get /business/search/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:
  /business/search/stats:
    get:
      tags:
        - Businesses
      summary: Get completion rate stats from your businesses
      description: >
        This endpoint works in the same way as the
        [operation/searchBusinesses](/api-reference/businesses/search-for-businesses)
        endpoint, but instead of returning data on all returned businesses, this
        endpoint returns completion rate statistics aggregated across all
        businesses.


        The statistics returned are the average completion rate for all
        businesses that fit the given filters, as well as the count of
        businesses with a low, medium, and high respectively. The thresholds for
        low, medium, and high can be found below in the response details.


        Note that this endpoint works in the exact same way as
        [operation/searchBusinesses](/api-reference/businesses/search-for-businesses)
        (with the exception of parameters that format the output, such as
        `order_by` and pagination), but the return value is different.
      operationId: searchBusinessesStats
      parameters:
        - $ref: '#/components/parameters/query_filter_by_fuzzy_query_on_business'
        - $ref: '#/components/parameters/query_business__in'
        - $ref: '#/components/parameters/query_filter_by_org_id'
        - $ref: '#/components/parameters/query_filter_by_groups'
        - $ref: '#/components/parameters/query_filter_by_country'
        - $ref: '#/components/parameters/query_filter_by_business_name'
        - $ref: '#/components/parameters/query_filter_by_business_status'
        - $ref: '#/components/parameters/query_filter_by_zipcode'
        - $ref: '#/components/parameters/query_filter_by_city'
        - $ref: '#/components/parameters/query_filter_by_business_code'
        - $ref: >-
            #/components/parameters/query_filter_by_business_modification_timestamp
        - $ref: '#/components/parameters/query_filter_by_business_features__in'
        - $ref: '#/components/parameters/query_filter_by_business_features__notin'
        - $ref: >-
            #/components/parameters/query_filter_by_business_subscription_to_review_management
        - $ref: >-
            #/components/parameters/query_filter_by_business_subscription_to_presence_management
        - $ref: >-
            #/components/parameters/query_filter_by_business_subscription_to_review_booster
        - $ref: >-
            #/components/parameters/query_filter_by_business_subscription_to_messages
        - $ref: >-
            #/components/parameters/query_filter_by_business_completion_rate__gte
        - $ref: >-
            #/components/parameters/query_filter_by_business_completion_rate__lte
        - $ref: '#/components/parameters/query_filter_by_business_completion_rate'
        - $ref: '#/components/parameters/query_filter_by_business_promo'
        - $ref: '#/components/parameters/query_filter_by_connected_to_gmb_location'
        - $ref: >-
            #/components/parameters/query_filter_by_connected_to_facebook_location
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  average_completion_rate:
                    description: >-
                      The average completion rate of all businesses that fit the
                      filters given in paramers.
                    type: integer
                    example: 72
                  counts:
                    type: object
                    properties:
                      low:
                        type: integer
                        example: 2
                        description: >-
                          The number of businesses that fit the filters given in
                          paramers with a completion score of <=33.
                      mid:
                        type: integer
                        example: 10
                        description: >-
                          The number of businesses that fit the filters given in
                          paramers with a completion score of >33 and <=66.
                      high:
                        type: integer
                        example: 22
                        description: >-
                          The number of businesses that fit the filters given in
                          paramers with a completion score of >66.
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
components:
  parameters:
    query_filter_by_fuzzy_query_on_business:
      in: query
      name: query
      schema:
        type: string
      required: false
      description: Parameter to fuzzy search businesses on city, zipcode and name
    query_business__in:
      in: query
      name: business__in
      description: >-
        Filter by business ids. Use a comma-separated list to provide multiple
        ids.
      schema:
        type: array
        example: >-
          a1c9f37b4deca92f83b61d02,9f4e2a8c0d73b154e621bc97,c73b15e9fa42d60b3a8c21ef
        items:
          $ref: '#/components/schemas/BusinessId'
          description: ''
    query_filter_by_org_id:
      in: query
      name: org_id
      schema:
        type: integer
      required: false
      description: >
        Filter by organization ID. Only `PROVIDER` users can use this filter. If
        you are not a `PROVIDER`, this will default to the ID of your
        organization.
    query_filter_by_groups:
      in: query
      name: groups
      schema:
        type: array
        items:
          type: integer
      required: false
      description: >
        Filter by groups, using the access logic with the and/or depending on
        the groups sections


        See [the Groups and Sections
        description](/guides/api/resources/organizations/groups)
      example: 1,2,3
    query_filter_by_country:
      in: query
      name: country
      schema:
        type: string
      required: false
      description: Filter by country - ISO 3166 alpha2 code (i.e. “FR” for France)
    query_filter_by_business_name:
      in: query
      name: name
      schema:
        type: string
      required: false
      description: Filter by name
    query_filter_by_business_status:
      in: query
      name: status
      schema:
        $ref: '#/components/schemas/BusinessStatusFilter'
    query_filter_by_zipcode:
      in: query
      name: zipcode
      schema:
        type: string
      required: false
      description: Filter by zipcode
    query_filter_by_city:
      in: query
      name: city
      schema:
        type: string
      required: false
      description: Filter by city
    query_filter_by_business_code:
      in: query
      name: code
      schema:
        type: string
      required: false
      description: Filter by code
    query_filter_by_business_modification_timestamp:
      in: query
      name: modified__gte
      deprecated: false
      schema:
        type: number
      required: false
      description: Filter by modified attribute (modified >= modified_gte)
    query_filter_by_business_features__in:
      in: query
      name: features__in
      schema:
        allOf:
          - $ref: '#/components/schemas/FeatureEnum'
        description: >
          Filter businesses that have all the features provided, separated by
          commas.
        type: string
        example: diffusion,review_management
    query_filter_by_business_features__notin:
      in: query
      name: features__notin
      schema:
        allOf:
          - $ref: '#/components/schemas/FeatureEnum'
        description: >
          Filter businesses that *do not* have all the features provided,
          separated by commas.
        type: string
        example: diffusion,review_management
    query_filter_by_business_subscription_to_review_management:
      in: query
      deprecated: false
      name: subscribed_to_rm
      schema:
        type: boolean
      required: false
      description: >
        Filter by current subscription to `review_management`.

        - If `true`, only businesses subscribed to `review_management` will be
        included.

        - If `false`, only businesses *not* subscribed to `review_management`
        will be included.


        Equivalent to using `features__in=review_management`.
    query_filter_by_business_subscription_to_presence_management:
      in: query
      deprecated: false
      name: subscribed_to_pm
      schema:
        type: boolean
      required: false
      description: >
        Filter by current subscription to `presence_management`.

        - If `true`, only businesses subscribed to `presence_management` will be
        included.

        - If `false`, only businesses *not* subscribed to `presence_management`
        will be included.


        Equivalent to using `features__in=diffusion`.
    query_filter_by_business_subscription_to_review_booster:
      in: query
      deprecated: false
      name: subscribed_to_rb
      schema:
        type: boolean
      required: false
      description: >
        Filter by current subscription to `review_booster`.

        - If `true`, only businesses subscribed to `review_booster` will be
        included.

        - If `false`, only businesses *not* subscribed to `review_booster` will
        be included.


        Equivalent to using `features__in=review_invite`.
    query_filter_by_business_subscription_to_messages:
      in: query
      deprecated: false
      name: subscribed_to_bm
      schema:
        type: boolean
      required: false
      description: >
        Filter by current subscription to `messages`.

        - If `true`, only businesses subscribed to `messages` will be included.

        - If `false`, only businesses *not* subscribed to `messages` will be
        included.


        Equivalent to using `features__in=messages`.
    query_filter_by_business_completion_rate__gte:
      in: query
      name: completion_rate__gte
      deprecated: false
      schema:
        type: integer
        minimum: 0
        maximum: 100
      required: false
      description: >-
        Filter by `completion_rate` attribute (`completion_rate >=
        completion_rate__gte`)
    query_filter_by_business_completion_rate__lte:
      in: query
      name: completion_rate__lte
      deprecated: false
      schema:
        type: integer
        minimum: 0
        maximum: 100
      required: false
      description: >-
        Filter by `completion_rate` attribute (`completion_rate <=
        completion_rate__lte`)
    query_filter_by_business_completion_rate:
      in: query
      name: completion_rate
      deprecated: false
      schema:
        type: string
        enum:
          - low
          - mid
          - high
        example: low,mid
      required: false
      description: >-
        Filter by `completion_rate` attribute. You can separate the values by a
        comma, as done in the example.
    query_filter_by_business_promo:
      in: query
      name: has_promo
      deprecated: true
      schema:
        type: boolean
      required: false
      description: >
        - If `true`, include only businesses having promotional offers.

        - If `false`, include only businesses *not* having any promotional
        offer.
    query_filter_by_connected_to_gmb_location:
      in: query
      name: connected_to_gmb_location
      schema:
        type: boolean
      required: false
      description: >
        - If `true`, only businesses currently linked to a Google location will
        be included.

        - If `false`, only businesses *not* linked to any Google location will
        be included.
    query_filter_by_connected_to_facebook_location:
      in: query
      name: connected_to_facebook_location
      schema:
        type: boolean
      required: false
      description: >
        - If `true`, only businesses currently linked to a Facebook location
        will be included.

        - If `false`, only businesses *not* linked to any Facebook location will
        be included.
  responses:
    '400':
      description: Your request is incorrect
      content:
        application/json:
          schema:
            description: |
              Error that occcurs when your request is incorrect
            properties:
              errors:
                type: object
                description: The detail of the error encountered
                properties:
                  json:
                    type: object
    '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
  schemas:
    BusinessId:
      description: Business id
      type: string
      example: 5409c35a97bbc544d8e26737
    BusinessStatusFilter:
      description: >
        Defines the current status of the business.

        - `Open` indicates the business is up and running.  

        - `Closed` means that the business has definitely closed.  

        - `Opening Soon` indicates the business is open with an opening date set
        in the future.  

        - `Temporarily closed` means that the business is temporarily closed.


        ⚠️ To get all businesses with the status `open`, regardless of whether
        the `opening_date` has passed yet or not, submit both the `open` and
        `opening_soon` options in the filter: `status=open,opening_soon`.
      type: string
      enum:
        - open
        - closed
        - opening_soon
        - closed_temporarily
      default: open
      example: open
    FeatureEnum:
      enum:
        - diffusion
        - feedback_management
        - messages
        - posts
        - review_invite
        - review_management
  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

````