CaptionCraft API

CaptionCraftAi.com provides an easy-to-integrate, AI-powered image caption generation API that allows you to create engaging content for your audience. You can get started in 10 seconds or less! The generated captions can be used for various purposes, such as social media, blog posts, and advertising campaigns.

Currently, we provide the following capabilities:

  • Generating engaging captions from an image url
  • Generating a concise caption from an image url
  • Generating a concise caption from an image's base64
  • Generating image tags

API Key

The API is hosted on Rapid API, the world’s largest API hub. Please subscribe CaptionCraft API at rapidapi.com (free for first 100 requests). You will need an Rapid API account and create an API key, see detailed instructions here.

Quick Start

The API playground is highly recommended for quickly testing API endpoints.

Rapid API playground screenshot

Examples

To generate engaging captions from an image url:

import requests

url = "https://image-caption-generator2.p.rapidapi.com/v2/captions"
params = {
    "imageUrl": "https://i.pinimg.com/564x/26/c7/35/26c7355fe46f62d84579857c6f8c4ea5.jpg",
    "useEmojis": "true",    # optional
    "useHashtags": "true",  # optional
    "limit": "3"            # optional
}
headers = {
    "X-RapidAPI-Key": "<Your-RapidAPI-Key>",
    "X-RapidAPI-Host": "image-caption-generator2.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=params)

print(response.json())

Output:

{
  "captions": [
    "Witness the epitome of relaxation as this adorable feline indulges in a luxurious yawn on the cozy couch. 🐱✨ #CatYawn #CozyVibes #RelaxationMode",
    "Behold the majestic sight of a cat gracefully yawning on a plush couch, exuding pure comfort and tranquility. 🛋️😺 #YawnGoals #Purrfection #CouchLife",
    "Join us in admiring the sheer elegance of this cat as it leisurely yawns on a comfortable couch, embodying ultimate chill vibes. 😽💤 #YawnInStyle #CatNap #ChillOut"
  ]
}