Statistics Display

🚧

Only API keys on our Conversations PRR platform are eligible to use this API version. Refer to the Platforms section of our Platform & API Concepts documentation to learn which platform your API keys are on.

Returns Product-based Review Statistics. This method has been optimized and was created for inline ratings display.

Examples

🚧

Demonstration purposes only. Do not reuse the API passkeys below in your application.

Requesting native review statistics for one product

https://stg.api.bazaarvoice.com/data/statistics.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&filter=productid:test1&stats=NativeReviews

Requesting review statistics for one product

https://stg.api.bazaarvoice.com/data/statistics.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&filter=productid:test1&stats=Reviews

Requesting native review and review statistics for one product

https://stg.api.bazaarvoice.com/data/statistics.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&filter=productid:test1&stats=Reviews,NativeReviews

Requesting native review and review statistics for multiple products

https://stg.api.bazaarvoice.com/data/statistics.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&filter=productid:test1,test2,test3,test4&stats=Reviews,NativeReviews

Requesting statistics on North American content for a given product

https://stg.api.bazaarvoice.com/data/statistics.json?apiversion=5.4&passkey=kuy3zj9pr3n7i0wxajrzj04xo&filter=productid:eq:test1&stats=NativeReviews,Reviews&filter=contentlocale:eq:en_US,es_MX,en_CA,fr_CA

Parameters

NameDescriptionRequiredDefault Value
PassKeyAPI key is required to authenticate API user and check permission to access particular client's data.Yes
ApiVersionThe API version, e.g. 5.4.Yes
FilterFilter criteria for content of the query. Must be Product IDs.Yes
StatsThe content type for which statistics should be included. Currently available types:

- Reviews: returns statistics for all content, including syndicated content (if enabled on your API key) and product family content.
- NativeReviews: returns statistics only for content submitted on your site; Syndicated content and product family content are excluded.
Yes
CallbackCallback function name used with JSONP. Value is a string consisting of the following characters: a-z,A-Z,0-9,_ (excluding comma). See the JSONP tutorial for more information.No

Filter options

  • Each filter argument specifies the attribute to filter on followed by a comma-separated list of values. For instance, "Filter=ProductId:eq:Product1,Product2" returns statistics for Product1 and Product2.
  • If a filter value contains a comma or a colon, that character needs to be escaped with a backslash (\, or \:). If a filter value contains an ampersand (&), the ampersand must be encoded in the filter value by replacing & with %26.

The following table lists the attributes available for filtering.

NameDescription
ContentLocaleLocale of the content on which to calculate the statistics. A wildcard character "*" can be used to define the value, e.g., "en*" returns all content in English (en_US, en_CA, en_GB, etc.). The two valid operators for this filter are equals (eq) and not equals (neq).
ProductIdThe indentifier for the products that will be returned in the results. This filter is required. A limit of 100 ProductIds exists when used in the Filter.

Response format

This is a sample response for requesting native review and review statistics for a product:

{
    "Errors": [],
    "HasErrors": false,
    "Includes": {},
    "Limit": 10,
    "Locale": "en_US",
    "Offset": 0,
    "Results": [
        {
            "ProductStatistics": {
                "NativeReviewStatistics": {
                    "AverageOverallRating": 5,
                    "OverallRatingRange": 5,
                    "TotalReviewCount": 1
                },
                "ProductId": "test3",
                "ReviewStatistics": {
                    "AverageOverallRating": 3.8333,
                    "OverallRatingRange": 5,
                    "TotalReviewCount": 6
                 },
         }
    ],
    "TotalResults": 1
}

Response elements

NameDescription
IncludesAlways empty
HasErrorsBoolean indicating if the response had errors or not
OffsetDataset offset used for pagination (passed as URL parameter in a query request). The maximum supported value is 300000.
TotalResultsTotal number of records matched.
ErrorsError section is populated instead of other fields if there is an error with a query syntax or problem executing a query.
ResultsSection containing an array of primitive type object references matched by a query.

Error codes

ValueDescription
ERROR_PARAM_INVALID_API_KEYInvalid API Key value
ERROR_PARAM_INVALID_FILTER_ATTRIBUTEInvalid filter attribute name
ERROR_PARAM_INVALID_INCLUDEDInvalid parameter value
ERROR_PARAM_INVALID_CALLBACKInvalid JsonP callback function name
ERROR_REQUEST_LIMIT_REACHEDRate limiting error, i.e. too many requests per time interval
ERROR_UNSUPPORTEDFor unsupported features, clients etc.
ERROR_ACCESS_DENIED_Insufficien_t privileges to perform the operation
ERROR_UNKNOWNUnknown error (internal server error, for instance)