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
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | Integer | — | Number of results to return per page. Default is 10. |
| offset | Integer | — | Number of results to skip before returning results. Default is 0. |
| search | String | — | Search in `name`. |
| ordering | String | — | Order results by. Options are `id`, `order`, `name`, `created_at`, `updated_at`. |
| has_image | Boolean | — | Filter brands by image presence. |
| has_products | Boolean | — | Filter brands with/without products. |
| id_min | Integer | — | Minimum ID filter. |
| id_max | Integer | — | Maximum ID filter. |
| created_date | String (YYYY-MM-DD) | — | Filter by creation date (e.g., `2023-01-01`). |
| updated_date | String (YYYY-MM-DD) | — | Filter by last updated date (e.g., `2023-01-01`). |
| created_from | String (YYYY-MM-DD) | — | Filter by creation date range start. |
| created_to | String (YYYY-MM-DD) | — | Filter by creation date range end. |
| updated_from | String (YYYY-MM-DD) | — | Filter by last updated date range start. |
| updated_to | String (YYYY-MM-DD) | — | Filter by last updated date range end. |
Example Requests
- 🐍 Python
- 🌐 Curl
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())1# List all brands
2curl "http://www.example.com/api/shop/brands"
3
4# List brands with filters
5curl "http://www.example.com/api/shop/brands?has_products=true&created_from=2023-01-01&created_to=2023-12-31"
6
7# Search for brands
8curl "http://www.example.com/api/shop/brands?search=apple"Response Fields
| Field | Type | Description |
|---|---|---|
| count | Integer | Total number of categories |
| next | String | URL for the next page of results |
| previous | String | URL for the previous page of results |
| results | Array[Object] | Array of Brand objects |
Brand Object Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the brand |
| order | Integer | Display order of the brand |
| image | Object or null | Brand image data (`id`, `url`, `name`) |
| name | String | Brand name |
| slug | String | URL-friendly version of the brand name |
| description | String | Brand description |
| products_count | Integer | Number of products associated with this brand |
| created_at | String (ISO 8601) | Timestamp when brand was created |
| updated_at | String (ISO 8601) | Timestamp when brand was last updated |
Image Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the image |
| type | String | File type (e.g., image/jpeg) |
| name | String | Original file name |
| size | Integer | File size in bytes |
| human_readable_size | String | Human readable file size (e.g., 2.5 MB) |
| f | String | URL to access the image file |
| width | Integer | Image width in pixels |
| height | Integer | Image height in pixels |
| mode | String | Color mode (e.g., RGB, CMYK) |
| thumbnails | List of thumbnail objects | Imgae thumbnails |
Thumbnail Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the thumbnail (unique) |
| f | String | URL to access the thumbnail file |
| size | Integer | File 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
imagefield may be null if no image is associated with the brand. - The
descriptionfield may be empty if no description is available. - The
products_countfield indicates how many active products are associated with the brand.