Simple, powerful REST API

Integrate AltText.io into any application with our RESTful API. Generate alt text at scale with just a few lines of code.

Get API key View examples

Quick start

Get up and running in minutes with our simple REST API.

1. Get your API key

Sign up for a free forever account and generate your API key from the dashboard. Get 25 credits every month.

2. Make your first request

Send a POST request with your image URL and get back perfect alt text in under 2 seconds.

3. Scale to thousands

Process images at scale with batch endpoints and webhooks for async processing.

bash
curl -X POST https://alttext.io/api/getmetadata \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://example.com/image.jpg",
    "mode": "seo"
  }'

API endpoints

All endpoints require authentication with your API key in the Authorization header.

POST /api/getmetadata

Generate alt text, titles, descriptions, and keywords for an image. Supports both SEO and stock photography modes.

Parameters

image_url URL of the image to process
mode "seo" for SEO optimization or "stock" for Getty Images
keywords Optional: Custom keywords to include (optional)

Response

{
  "status": "success",
  "data": {
    "title": "Professional business meeting in modern office",
    "description": "Group of diverse professionals...",
    "alt_text": "Business team collaborating around table",
    "keywords": ["business", "meeting", "office", "teamwork"]
  },
  "credits_used": 1,
  "credits_remaining": 24
}
POST /api/batch

Process multiple images in a single request. Perfect for bulk operations and data migrations.

Parameters

images Array of image URLs (max 50 per request)
mode "seo" for SEO optimization or "stock" for Getty Images
webhook_url Optional: URL to receive results when processing completes

Code examples

Get started quickly with examples in popular programming languages.

JavaScript

const response = await fetch('https://alttext.io/api/getmetadata', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    image_url: 'https://example.com/image.jpg',
    mode: 'seo'
  })
});

const data = await response.json();
console.log(data.data.alt_text);

Python

import requests

response = requests.post(
    'https://alttext.io/api/getmetadata',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={
        'image_url': 'https://example.com/image.jpg',
        'mode': 'seo'
    }
)

data = response.json()
print(data['data']['alt_text'])

Ready to start building?

Get your API key and start generating perfect alt text programmatically.

Get API key View pricing

25 free API calls every month • Free forever plan • Rate limit: 1000 requests/hour