Skip to main content

List Product Comments

Retrieves a list of comments for a specific product with filtering and ordering capabilities.

HTTP Request​

GET/api/shop/products/:slug/comments

Authorization​

Authorization

  • Required: No
  • Permission: Public
  • Authentication: None

Path Parameters​

ParameterTypeRequiredDescription
slugstringYesURL-friendly product identifier

Query Parameters​

ParameterTypeDefaultDescription
limitinteger—Number of results to return per page (default: 10)
offsetinteger—Number of results to skip before returning results (default: 0)
orderingstring—Order results by (`rating`, `created_at`, `updated_at`)
rating_mininteger—Minimum rating filter (1-5)
rating_maxinteger—Maximum rating filter (1-5)
id_mininteger—Minimum ID filter
id_maxinteger—Maximum ID filter
created_datestring—Filter by creation date (e.g., 2023-01-01)
updated_datestring—Filter by last updated date (e.g., 2023-01-01)
created_fromstring—Filter by creation date range start (e.g., 2023-01-01)
created_tostring—Filter by creation date range end (e.g., 2023-01-31)
updated_fromstring—Filter by last updated date range start (e.g., 2023-01-01)
updated_tostring—Filter by last updated date range end (e.g., 2023-01-31)

Example Requests​

1import requests
2
3# List product comments with filters
4response = requests.get('http://www.example.com/api/shop/products/iphone-14-pro/comments', params={
5  'limit': 20,
6  'ordering': '-created_at',
7  'rating_min': 4
8})
9print(response.json())
10
11# List all 5-star reviews
12response = requests.get('http://www.example.com/api/shop/products/iphone-14-pro/comments', params={
13  'rating_min': 5,
14  'rating_max': 5,
15  'ordering': '-created_at'
16})
17print(response.json())

Response Fields​

FieldTypeDescription
countIntegerTotal number of categories
nextStringURL for the next page of results
previousStringURL for the previous page of results
resultsArray[Object]Array of related product comment objects

Product Comment Object Structure

FieldTypeDescription
idintegerUnique ID of the comment
ratingintegerRating given (1-5: Worst, Bad, Average, Good, Best)
contentstringComment content (max 500 characters)
userobjectUser details (read-only)
truncated_contentstringShortened version of content
created_atstring (ISO 8601)Timestamp when comment was created
updated_atstring (ISO 8601)Timestamp when comment was last updated

User Data Structure

FieldTypeDescription
idintegerUnique ID of the user
avatarstringURL of the user avatar image
full_namestringFull name of the user