Skip to main content

Get All Brands

Retrieve a list of brands with optional filtering, searching, and pagination.

HTTP Request

GET/api/shop/brands

Authorization

Authorization

  • Required: No
  • Permission: None (public access) or Authenticated users
  • Authentication: None or Token-based authentication

Query Parameters

ParameterTypeDefaultDescription
limitIntegerNumber of results to return per page. Default is 10.
offsetIntegerNumber of results to skip before returning results. Default is 0.
searchStringSearch in `name`.
orderingStringOrder results by. Options are `id`, `order`, `name`, `created_at`, `updated_at`.
has_imageBooleanFilter brands by image presence.
has_productsBooleanFilter brands with/without products.
id_minIntegerMinimum ID filter.
id_maxIntegerMaximum ID filter.
created_dateString (YYYY-MM-DD)Filter by creation date (e.g., `2023-01-01`).
updated_dateString (YYYY-MM-DD)Filter by last updated date (e.g., `2023-01-01`).
created_fromString (YYYY-MM-DD)Filter by creation date range start.
created_toString (YYYY-MM-DD)Filter by creation date range end.
updated_fromString (YYYY-MM-DD)Filter by last updated date range start.
updated_toString (YYYY-MM-DD)Filter by last updated date range end.

Example Requests

1import requests
2
3# List all brands
4response = requests.get('http://www.example.com/api/shop/brands')
5print(response.json())
6
7# List brands with filters
8response = requests.get('http://www.example.com/api/shop/brands?has_products=true&created_from=2023-01-01&created_to=2023-12-31')
9print(response.json())
10
11# Search for brands
12
13response = requests.get('http://www.example.com/api/shop/brands?search=apple')
14print(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 Brand objects

Brand Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the brand
orderIntegerDisplay order of the brand
imageObject or nullBrand image data (`id`, `url`, `name`)
nameStringBrand name
slugStringURL-friendly version of the brand name
descriptionStringBrand description
products_countIntegerNumber of products associated with this brand
created_atString (ISO 8601)Timestamp when brand was created
updated_atString (ISO 8601)Timestamp when brand was last updated

Image Data Structure

FieldTypeDescription
idIntegerUnique ID of the image
typeStringFile type (e.g., image/jpeg)
nameStringOriginal file name
sizeIntegerFile size in bytes
human_readable_sizeStringHuman readable file size (e.g., 2.5 MB)
fStringURL to access the image file
widthIntegerImage width in pixels
heightIntegerImage height in pixels
modeStringColor mode (e.g., RGB, CMYK)
thumbnailsList of thumbnail objectsImgae thumbnails

Thumbnail Data Structure

FieldTypeDescription
idIntegerUnique ID of the thumbnail (unique)
fStringURL to access the thumbnail file
sizeIntegerFile size in bytes (nullable)

Example Response

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"order": 1,
"image": {
"id": 1,
"type": "image",
"name": "logitech-logo",
"size": 2763,
"human_readable_size": "2.70 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/11/22/logitech.png",
"width": 287,
"height": 176,
"mode": "P",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
},
"name": "Logitech",
"slug": "logitech",
"description": null,
"products_count": 2,
"created_at": "2025-11-22T14:30:40.603896Z",
"updated_at": "2025-11-22T14:30:40.603901Z"
}
]
}

Notes

    • The image field may be null if no image is associated with the brand.
    • The description field may be empty if no description is available.
    • The products_count field indicates how many active products are associated with the brand.