API Endpoint
- URL:
https://image-cap.droplinked.workers.dev/ - Method:
POST - Content-Type:
application/json
Authentication
An API key is required to access the API. Contact Droplinked support to obtain your API key. Include it in the request headers as follows:- Header:
api-key - Value:
<YOUR_API_KEY>(provided by Droplinked)
Request Format
The API accepts a JSON payload with the following fields:Request Body
| Field | Type | Required | Description |
|---|---|---|---|
command_name | String | Yes | Must be set to "description_from_image" for this functionality. |
imageUrl | String | Yes | URL of the product image to analyze and generate a description from. |
Example Request Body
Response Format
- Content-Type:
text/plain - Response: A single-paragraph string containing the product description, with no quotes, labels, or additional text.
Example Response
Guidelines for Generated Descriptions
The API adheres to these strict rules:- Mode: Operates in
GENERATE_DESCRIPTION_MODE: TRUE, creating descriptions from visual data. - Input: Uses a product visual description extracted from the image (processed internally).
- Output: Produces a single-paragraph description with:
- 150-250 characters.
- Brand name (if visible).
- Exact colors and patterns.
- Material and style details.
- Key features using hyphens (
-) to separate points.
- Format:
- Single flowing paragraph.
- No quotes or introductory/explanatory text.
- Describes only what is visible in the image.
- Restrictions:
- No conversation, questions, or assumptions.
- No additional formatting or text beyond the description.
Example Transformation
- Visual Description: “Champion brand hoodie in mulled berry red color with tie-dye pattern throughout, featuring kangaroo pocket, drawstring hood, and ribbed cuffs”
- Output Description:
Elevate your casual style with this Champion tie-dye hoodie in rich mulled berry - Features a classic kangaroo pocket and adjustable drawstring hood - Premium cotton blend construction with tie-dye pattern throughout - Perfect blend of comfort and trendy streetwear appeal
JavaScript Example
Below is an example of how to use the Image-to-Description Generator API in JavaScript with thefetch API:
Error Handling
- Invalid API Key: Returns an error message (e.g., “Unauthorized”).
- Missing Fields: If
command_nameorimageUrlis missing, the API may return an error or fail silently. - Invalid Image URL: If the URL is inaccessible or invalid, an error may occur.
- Network Issues: Handle errors in the
.catchblock of thefetchcall.
Example Error Output
Best Practices
- Image Clarity: Use high-resolution images to ensure accurate detail extraction.
- URL Validity: Verify that the
imageUrlis accessible and points to a valid image. - Consistency: Test with diverse products to ensure descriptions align with your catalog.
- SEO Benefits: The descriptions naturally include keywords from visual details, enhancing searchability.