Skip to main content
POST
/
batch
Batch Generate Alt Text
curl --request POST \
  --url https://api.example.com/batch \
  --header 'Content-Type: application/json' \
  --data '
{
  "api_key": "<string>",
  "images": [
    {}
  ],
  "images.image_url": "<string>",
  "images.mode": "<string>",
  "images.language": "<string>",
  "images.source": "<string>"
}
'
{
  "results": [
    {}
  ],
  "results[].alt_text": "<string>",
  "results[].short_alt_text": "<string>",
  "results[].long_alt_text": "<string>",
  "results[].seo_alt_text": "<string>",
  "results[].image_url": "<string>",
  "results[].generated_at": "<string>",
  "total": 123,
  "successful": 123,
  "failed": 123
}

Overview

Process multiple images efficiently in a single API call. This is ideal for bulk processing or when you need to generate alt text for multiple images at once.

Request Body

api_key
string
required
Your GistMag API key
images
array<object>
required
Array of image objects to process. Each object must contain at least image_url.
images.image_url
string
required
The URL of the image
images.mode
string
default:"short"
The length of alt text for this specific image. Options: short, long, seo
images.language
string
Language code for this specific image (default: en)
images.source
string
Source identifier for tracking (web, api, extension, wordpress, shopify, batch)

Example Request

curl -X POST https://api.gistmag.co.uk/batch \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "your_api_key_here",
    "images": [
      {
        "image_url": "https://example.com/image1.jpg",
        "mode": "short"
      },
      {
        "image_url": "https://example.com/image2.jpg",
        "mode": "long"
      },
      {
        "image_url": "https://example.com/image3.jpg",
        "mode": "seo"
      }
    ]
  }'

Response

results
array
Array of alt text responses for each image
results[].alt_text
string
The generated alt text based on the selected mode
results[].short_alt_text
string
Short version of alt text (if mode was short or all modes requested)
results[].long_alt_text
string
Long version of alt text (if mode was long or all modes requested)
results[].seo_alt_text
string
SEO-optimized version of alt text (if mode was seo or all modes requested)
results[].image_url
string
The original image URL
results[].generated_at
string
ISO timestamp of when the alt text was generated
total
number
Total number of images processed
successful
number
Number of successfully processed images
failed
number
Number of images that failed to process

Example Response

{
  "results": [
    {
      "alt_text": "A beautiful sunset over the ocean",
      "short_alt_text": "Sunset over ocean",
      "long_alt_text": "A beautiful sunset over the ocean with orange and pink hues reflecting on the water",
      "seo_alt_text": "Sunset over ocean - beach photography - nature scene",
      "image_url": "https://example.com/image1.jpg",
      "generated_at": "2024-01-15T10:30:00Z"
    },
    {
      "alt_text": "A detailed description of a mountain landscape with snow-capped peaks and a clear blue sky",
      "image_url": "https://example.com/image2.jpg",
      "generated_at": "2024-01-15T10:30:05Z"
    },
    {
      "alt_text": "A city street at night with neon lights",
      "image_url": "https://example.com/image3.jpg",
      "generated_at": "2024-01-15T10:30:10Z"
    }
  ],
  "total": 3,
  "successful": 3,
  "failed": 0
}

Rate Limits

Batch requests count as multiple individual requests for rate limiting purposes. Each image in the batch consumes one credit and counts toward your rate limit.
Batch processing is more efficient than making multiple individual requests, but still counts toward your usage limits.