Generate SEO-optimized metadata for your images programmatically. Integrate AltText.io into any application with just a few lines of code.
Get up and running in minutes with our simple REST API.
Generate your API key from your Settings page. All requests include your key in the request body — keep it secure and never expose it in client-side code.
Send a POST request with your image URL and target keyword, and get back an SEO-optimized title, description, and alt text in seconds.
Generate metadata in any supported language, switch to stock mode for ~35 buyer-focused keywords, or use the page metadata endpoint for posts and pages.
Authenticate by including your apikey in the JSON request body. Content-Type: application/json is required.
https://api.alttext.io/getmetadata
Generate a title, description, and alt text for an image. Supports SEO mode (keyword-optimized, 1 credit) and stock mode (buyer-focused metadata with ~35 keywords, 2 credits).
apikey
Required. Your AltText.io API key.
fileurl
Required. URL of the image to process. Must be publicly accessible.
keyword
Required for SEO mode only. The target SEO keyword for optimizing the metadata.
language
Optional. Defaults to "english". See the supported languages below.
mode
Optional. Defaults to "seo". Use "stock" for stock photography metadata.
[
{
"title": "Woman using smartphone in modern office space",
"description": "Professional woman in business attire checking smartphone while sitting at desk in bright modern office.",
"alttext": "Woman checking smartphone at office desk"
}
]
title
SEO-optimized title for the image (typically 50–60 characters).
description
Detailed description optimized for your keyword (max 200 characters).
alttext
Concise alt text for accessibility (max 8 words).
keywords
Stock mode only: approximately 35 comma-separated keywords focused on buyer search intent.
https://api.alttext.io/getpagemetadata
Generate SEO titles and meta descriptions for pages, posts, and custom post types. Text-only — no image URL required.
apikey
Required. Your API key (or send as an Authorization: Bearer <key> header).
title
Required. The page/post title as authored. Used as the primary signal for the rewrite.
content
Optional. Full page body (HTML, WordPress shortcodes, and Gutenberg block markers stripped server-side, capped at 20,000 characters). Strongly recommended — improves output quality significantly.
keyword
Optional. Target SEO keyword. If omitted, the AI infers a primary keyword from the title and content.
language
Optional. Defaults to "english". Same set as /getmetadata.
[
{
"title": "Artisan Bakery in Seattle | Sourdough & Pastry",
"meta_description": "Family-run artisan bakery in Seattle baking fresh sourdough, croissants, and seasonal pastries daily."
}
]
title
SEO-optimized title tag, constrained to 70 characters maximum (target: 50–60). Not server-truncated.
meta_description
SEO meta description. Target: 150–160 characters. Not server-truncated.
Get started quickly with examples in popular programming languages.
const response = await fetch('https://api.alttext.io/getmetadata', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
apikey: 'your_api_key_here',
fileurl: 'https://example.com/image.jpg',
keyword: 'office productivity',
language: 'english',
mode: 'seo'
})
});
if (response.ok) {
const metadata = await response.json();
const { title, description, alttext } = metadata[0];
console.log(title, description, alttext);
} else {
const error = await response.json();
console.error('Error:', error.error);
}
import requests
response = requests.post(
'https://api.alttext.io/getmetadata',
headers={'Content-Type': 'application/json'},
json={
'apikey': 'your_api_key_here',
'fileurl': 'https://example.com/image.jpg',
'keyword': 'office productivity',
'language': 'english',
'mode': 'seo'
}
)
if response.status_code == 200:
metadata = response.json()
print(metadata[0]['title'])
print(metadata[0]['alttext'])
else:
print('Error:', response.json()['error'])
SEO mode generates keyword-optimized metadata for search engines and requires a keyword parameter. Uses 1 credit.
Stock mode returns a buyer-focused title, layered description, alt text, and ~35 comma-separated keywords. The keyword parameter is ignored. Uses 2 credits.
English, Spanish, French, German, Italian, Portuguese, Dutch, Russian, Chinese, Japanese, Korean, and Arabic. Pass the lowercase language name in the language parameter; it defaults to english.
Errors return a JSON object with an error message. Common cases (all HTTP 400): invalid JSON input, missing API key, missing file URL, missing keyword for SEO optimization, invalid API key, and insufficient credits.
{ "error": "Invalid API key" }
Each successful request consumes credits: 1 in SEO mode, 2 in stock mode. Failed requests are not charged.
Requests are limited to 60 per minute and 1,000 per hour. Exceeding the limit returns a 429 (Too Many Requests) response.
Get your API key and start generating SEO-optimized metadata programmatically.
60 requests/minute • 1,000 requests/hour