API Docs
POST https://www.aistockkeywords.com/api/public/v1/generate-metadata
Generates AI-powered metadata for an uploaded image file.
Request
- Method: POST
- Content-Type: multipart/form-data
- Query Parameters:
- apiKey (string, required): User's API key for authentication. It can be generated on the account page.
- contextAndInstructions (string, optional): Additional context or instructions for metadata generation.
- numberOfKeywords (number, optional): Number of keywords to generate (default: 49).
- shortTitle (boolean, optional): Whether to generate a short title.
- englishLettersOnly (boolean, optional): Restrict keywords to English letters only.
- oneWordKeywordsOnly (boolean, optional): Restrict keywords to single words only.
- keywordsPhrasesPreferred (boolean, optional): Prefer keyword phrases over single words.
- Body: file (File, required): The image file to process. Maximum file size: 4.5 MB.
Response
- Success (200): Returns JSON containing generated metadata for the image.
- Error (400): Missing or invalid parameters (apiKey, file, invalid context length, invalid boolean parameters, etc.).
- Error (401): Invalid API key.
- Error (403): Insufficient balance.
- Error (413): File too large (exceeds 4.5 MB limit).
- Error (500): Internal server error.
Example Request
POST https://www.aistockkeywords.com/api/public/v1/generate-metadata?apiKey=YOUR_API_KEY&numberOfKeywords=6&shortTitle=true
Content-Type: multipart/form-data
file: [your image file]
Example Response
{
"title": "Sunset over the mountains",
"description": "A beautiful sunset casting warm colors over a mountain landscape.",
"keywords": [
"sunset",
"mountains",
"landscape",
"nature",
"sky",
"scenery",
]
}