Back to Home

Image Describer API Documentation (V2)

2025-08-18

Posted by

Inhaltssprache Hinweis

Dieser Inhalt ist noch nicht in Deutsch verfügbar. Wir zeigen stattdessen die English -Version.

Image Describer API Documentation (V2)

Introduction & Use Cases

Image Describer API allows you to integrate AI-powered image description capabilities into your applications. Our API uses advanced AI models to analyze images and generate detailed descriptions.

Common Use Cases

  • Generate detailed descriptions for images
  • Extract text and information from images
  • Analyze image content and context
  • Create character descriptions for creative writing
  • Generate image captions for content management

API Keys

To use our API, you'll need to obtain API credentials (API Key and Secret). You can manage your API keys in the dashboard.

Manage API Keys →

API Endpoint

POST https://imagedescriber.online/api/openapi-v2/describe-image

Integration Guide

Request Headers

Header NameRequiredDescription
content-typeYesMust be multipart/form-data
authorizationYesMust be Bearer ${SECRET_KEY}
${SECRET_KEY} is your API key.

Request Parameters

ParameterTypeRequiredDescription
imagestring or fileYesImage to generate description. It accepts three input formats:
1. Image URL, starting with http:// or https://.
2. Base64 Encoded Image, following the format: data:image/jpeg;base64,/9j/4AAQSkZJR... (Note: other image types like PNG are also possible, adjust the mime-type accordingly)
3. File Object: A file object representing the model image.
promptstringYesCustom prompt for image analysis
langstringNoResponse language (en/zh/de/es/fr/ja/ko/fi/nl/pt/tr/ru), default: en

Response Format

FieldTypeDescription
codenumberResponse status code. 200 for success
dataobjectResponse data object, present when code is 200
data.contentstringThe generated description for the image
msgstringResponse message, provides additional information
succeedbooleanIndicates whether the request was successful

Example Response

{
    "code": 200,
    "data": {
        "content": "Detailed description of the image in markdown format..."
    },
    "succeed": true,
    "msg": "Success"
}

Error Codes

CodeMessageDescription
200OKRequest successful
500SERVER_ERRORInternal server error
10003INSUFFICIENT_CREDITSInsufficient credits
10004INVALID_PARAMInvalid parameters
10005HARMFUL_CONTENTHarmful content detected
30001INVALID_API_KEYInvalid API key
30002INVALID_SIGNATUREInvalid request signature

Code Examples

Curl Example With Image Url

curl --location 'https://imagedescriber.online/api/openapi-v2/describe-image' \
--header 'Authorization: Bearer ${SECRET_KEY}' \
--form 'image="https://persistent.imagedescriber.online/image-describer-examples/000.jpg"' \
--form 'prompt="Briefly describe the content of the image"' \
--form 'lang="en"'

Curl Example With Local Image File

curl --location 'https://imagedescriber.online/api/openapi-v2/describe-image' \
--header 'Authorization: Bearer ${SECRET_KEY}' \
--form 'image=@"/PATH/TO/YOUR/IMAGE.jpg"' \
--form 'prompt="Briefly describe the content of the image"' \
--form 'lang="en"'

Curl Example With Image Base64

curl --location 'https://imagedescriber.online/api/openapi-v2/describe-image' \
--header 'Authorization: Bearer ${SECRET_KEY}' \
--form 'image="data:image/jpeg;base64,/9j……/9k="' \
--form 'prompt="Briefly describe the content of the image"' \
--form 'lang="en"'

Node.js Example

async function callDescribeImageApi() {
  const apiKey = 'YOUR_API_KEY'; // Replace with your actual API key

  const formData = new FormData();
  formData.append('image', ...); // Support url, image file, image base64 encode
  formData.append('prompt', 'Briefly describe the content of the image');
  formData.append('lang', 'en'); // Response language code


  const apiEndpoint = 'https://imagedescriber.online/api/openapi-v2/describe-image';
  try {
    const response = await fetch(apiEndpoint, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${apiKey}`,
      },
      body: formData,
    });

    if (!response.ok) {
      const errorData = await response.json();
      throw new Error(`HTTP error ${response.status}: ${errorData.msg || 'Unknown error'}`);
    }

    const data = await response.json();
    return { content: data.data.content, error: null };

  } catch (error) {
    console.error('Error describing image:', error);
    return { content: null, error: error.message };
  }
}

Python Example


import requests
import base64

async def call_describe_image_api():
    api_key = 'YOUR_API_KEY'  # Replace with your actual API key

    form_data = {
        'image': 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...',  # Example base64 image. Replace with your actual image data. Supports url, file, and base64.
        'prompt': 'Briefly describe the content of the image',
        'lang': 'en' # Example description. Remove this line if garmentDesc is empty
    }

    api_endpoint = 'https://imagedescriber.online/api/openapi-v2/describe-image'
    try:
        headers = {
            'Authorization': f'Bearer {api_key}',
        }

        response = requests.post(api_endpoint, files=form_data, headers=headers) # Use files= for multipart/form-data
        response.raise_for_status()  # Raise an exception for bad status codes (4xx or 5xx)

        data = response.json()
        return {'content': data.get('data', {}).get('content'), 'error': None}

    except requests.exceptions.RequestException as e:
        print(f'Error describing image: {e}')
        return {'content': None, 'error': str(e)}

Pricing

API calls consume credits from your account. You can purchase credits on our pricing page.

View Pricing →

Help & Support

If you have any questions or need assistance, please don't hesitate to contact our support team.

Email: [email protected]