Skip to main content
curl --request GET 'https://api.mayar.id/hl/v2/merchants/reviews/stats' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "total": 42,
        "average": 4.7,
        "stats": [
            { "rating": 5, "percentage": 76, "totalRating": 32 },
            { "rating": 4, "percentage": 17, "totalRating": 7 },
            { "rating": 3, "percentage": 5, "totalRating": 2 },
            { "rating": 2, "percentage": 2, "totalRating": 1 },
            { "rating": 1, "percentage": 0, "totalRating": 0 }
        ]
    }
}
Endpoint:
https://api.mayar.id/hl/v2/merchants/reviews/stats

Authorization

Authorization
string
required
Example:Authorization | Bearer Paste-Your-Api-Key-Here
Statistics count only ACTIVE reviews across the entire store. When there are no active reviews, data is returned as an empty object ({}).

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code returned by the API.
messages
string
Status message that describes the API response.
data
object
Aggregated store-wide rating statistics. Empty object when there are no active reviews.

data Structure (Object)

total
number
Total number of active reviews across the store.
average
number
Average rating across all active reviews, rounded to one decimal place.
stats
array of object
Per-rating breakdown, one entry for each rating from 5 down to 1.
stats.rating
number
Rating value (1–5) this breakdown entry refers to.
stats.percentage
number
Percentage of total reviews that gave this rating.
stats.totalRating
number
Number of reviews that gave this rating.