API Documentation
Integrate Producks AI directly into your applications.
Generate Product Description
Generates a product description based on an uploaded photo.
Endpoint
POST
https://producks.ai/api/generate
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| token | string | Yes | Authentication token for accessing the API. |
| details | string | No | Additional details about the product. |
| tone | string | No |
Tone preference (0-4):
|
| file | file | Yes | Product photo (JPEG, PNG). |
Example Request (Python)
import requests
url = "https://producks.ai/api/generate"
payload = {
'token': 'YOUR_API_TOKEN',
'details': 'Blue running shoes',
'tone': '0'
}
files = [
('file', ('shoe.jpg', open('shoe.jpg', 'rb'), 'image/jpeg'))
]
response = requests.post(url, data=payload, files=files)
print(response.json())
Example Response
{
"title": "Premium Running Shoes",
"description": "Experience ultimate comfort...",
"image_url": "https://producks.ai/media/..."
}
Example Request (PHP)
$url = 'https://producks.ai/api/generate';
$payload = array(
'token' => 'YOUR_API_TOKEN',
'details' => 'Blue running shoes',
'tone' => '0'
);
$files = array(
'file' => curl_file_create('shoe.jpg', 'image/jpeg', 'shoe.jpg')
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array_merge($payload, $files));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters or missing required fields. |
| 401 | Unauthorized - Invalid or missing authentication token. |