Skip to main content

Overview

ChatAds can analyze product images and return affiliate links, just like it does with text messages. Pass an image URL or a base64-encoded image file, and ChatAds will identify the product and find matching affiliate offers.

How It Works

  1. You send a request with input_type set to image_url or image_file
  2. The message field contains the image URL (for image_url) or the base64-encoded image data (for image_file)
  3. ChatAds processes the image to identify the product
  4. Matching affiliate offers are returned in the standard response format

Input Types

ValueDescriptionmessage contains
textDefault. Analyze a text message for product mentionsUser message text
image_urlAnalyze a product image from a URLA publicly accessible image URL
image_fileAnalyze an uploaded product imageBase64-encoded image data

Usage

Image URL

Pass a publicly accessible image URL in the message field. The API automatically normalizes URLs — if no scheme is provided (e.g., example.com/photo.jpg), https:// is prepended. Invalid or malformed URLs return a 400 INVALID_INPUT error.
curl -X POST 'https://api.getchatads.com/v1/chatads/messages' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "message": "https://example.com/product-photo.jpg",
    "input_type": "image_url"
  }'

Image File (Base64)

Value must be a base64-encoded JPEG/PNG/WebP, max 10MB. Auto-resized if longest dimension exceeds 1500px. Don’t recommend using API explorer for this. Pass the raw base64-encoded image data in the message field:
import { readFileSync } from 'fs';

const imageBase64 = readFileSync('product.jpg', 'base64');
const response = await client.analyze({
  message: imageBase64,
  input_type: "image_file",
});

Response

The response format is identical to text-based requests. In verbose mode, the input_type field is included in data:
{
  "data": {
    "status": "filled",
    "offers": [
      {
        "link_text": "",
        "url": "https://www.amazon.com/dp/B0XXXXXXXXX?tag=yourtag-20"
      }
    ],
    "requested": 1,
    "returned": 1,
    "input_type": "image_url"
  },
  "error": null,
  "meta": {
    "request_id": "d6a8f6f2-3b5a-4f0a-81ab-1b4a4c9dd5ea"
  }
}

Billing

Image requests are tracked separately in your usage dashboard. They count toward your monthly request quota the same as text requests. However, image requests do cost more money. They effectively count as 3 standard requests for billing (not for API limits). In other words, if the standard cost is 0.80for1krequests,youwillbecharged0.80 for 1k requests, you will be charged 2.70 for 1k image requests. For instance, your bill could be: 10k text requests = 910kimagerequests=9 10k image requests = 27 Total: $36

Limitations

  • Image URL must be publicly accessible (no authentication required)
  • Image file payloads can be large (base64 encoding increases size ~33%) — the standard message length limit is relaxed for image_file requests. Value must be a base64-encoded JPEG/PNG/WebP, max 10MB. Auto-resized if longest dimension exceeds 1500px. Don’t recommend using API explorer for this.
  • Text-based keyword filtering and language checks are skipped for image inputs since there is no text to analyze
  • Country and IP-based targeting still apply normally

Next Steps