Retrieve a Category
Retrieves detailed information about a specific category by its id.
HTTP Request
GET/api/shop/categories/:id
Authorization
Authorization
- Required: No
- Permission: Public (read-only)
- Authentication: Optional (affects `is_favorite` field)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | Category id |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Without authentication
4response = requests.get('http://www.example.com/api/shop/categories/10')
5print(response.json())
6
7# With authentication
8response = requests.get('http://www.example.com/api/shop/categories/10', headers={
9 'Authorization': 'Token <your_api_key>'
10})
11print(response.json())1# Without authentication
2curl "http://www.example.com/api/shop/categories/10"
3
4# With authentication
5curl "http://www.example.com/api/shop/categories/10" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the category |
| order | Integer | Display order of the category |
| image | Object | Category image data (`id`, `url`, `name`, etc.) |
| parent | Integer | Category parent id |
| name | String | Category name |
| slug | String | URL-friendly category identifier |
| description | String | Extra descriptions of the category |
| products_count | Integer | Number of products in this category |
| children_count | Integer | Number of children categories |
| created_at | String | Creation time of the category |
| updated_at | String | Last updated time of the category |
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
{
"id": 2,
"order": 2,
"image": {
"id": 6,
"type": "image",
"name": "technology",
"size": 5123,
"human_readable_size": "5.00 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/12/02/technology.png",
"width": 225,
"height": 225,
"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
}
]
},
"parent": 1,
"name": "ماوس",
"slug": "mouse",
"description": "",
"products_count": 2,
"children_count": 0,
"created_at": "2025-11-22T14:35:00.236637Z",
"updated_at": "2025-12-24T13:01:33.436128Z"
}