Skip to main content

General

ChatAds is an API that inserts relevant affiliate links into AI chatbot responses. When users ask about products (like “What’s a good yoga mat?”), ChatAds analyzes the message, identifies product keywords, and returns affiliate links you can include in your AI’s response.
ChatAds uses a three-stage pipeline:
  1. Keyword Extraction - NLP and/or LLM models identify product mentions in messages
  2. Intent Scoring - Each query receives a purchase intent score (0.0-1.0) to filter low-quality matches
  3. Affiliate Resolution - Product keywords are matched to affiliate links via Amazon PA-API and Google Shopping
The API returns structured data including the product name, affiliate link, marketing message, and category.
ChatAds works with any platform that can make HTTP requests:
  • AI Chatbots - Claude, GPT, Gemini, custom LLMs
  • Chat Applications - Customer support bots, product assistants
  • Workflow Tools - n8n, Zapier, Make
  • Frameworks - Next.js, Express, FastAPI, Flask, Django
  • MCP Servers - Claude Desktop, custom MCP implementations
ChatAds currently supports:
  • Amazon Associates - Via Amazon Product Advertising API (PA-API)
  • Google Shopping - Via Serper API fallback
When Amazon PA-API doesn’t find a match, ChatAds falls back to Google Shopping results (unless you set fill_priority: "speed").

API & Integration

  1. Sign up at app.getchatads.com
  2. Navigate to Settings → API Keys
  3. Click Generate API Key
  4. Copy your key (starts with cak_)
Store your API key securely—it won’t be shown again after generation.
The message_analysis parameter controls how ChatAds extracts product keywords:
ModeSpeedQualityUse Case
fast~50msGoodHigh-volume, latency-sensitive
balanced~150msBetterDefault, most use cases
thorough~300msBestComplex queries, premium traffic
fast uses NLP only. balanced and thorough use LLM with NLP fallback.
When skip_message_analysis: true, ChatAds bypasses all NLP/LLM processing and uses your message content directly as the search query. This is useful when:
  • You’ve already extracted the product keyword
  • You want to search for a specific product name
  • You’re building a product search feature (not analyzing conversation)
Example: Instead of analyzing “I need headphones for running”, you can send message: "wireless running headphones" with skip_message_analysis: true.
The min_intent parameter filters results by purchase intent score:
LevelThresholdDescription
any0.0Return all matches (no filtering)
low0.2Filter garbage/spam queries
medium0.5Balanced quality and fill rate
high0.7Premium, high-converting queries only
If a query’s intent score is below your threshold, the API returns matched: false with min_intent_required showing the filter level.
The fill_priority parameter controls fallback behavior:
  • coverage (default) - Full resolution chain: Amazon PA-API → Google Shopping → no match
  • speed - Skips Google Shopping fallback for faster response
Use speed when latency matters more than match rate. Use coverage when you want maximum affiliate link coverage.
Yes! Your API key works across any integration. Rate limits are per-team, shared across all API keys and integrations. Create multiple API keys in the dashboard if you need separate tracking for different projects.

Rate Limits & Billing

Rate limits are per-team and shared across all API keys:
PlanMonthly LimitDaily Limit
Free100 requests10 requests
Starter5,000 requests500 requests
Pro50,000 requests5,000 requests
EnterpriseCustomCustom
Limits reset at midnight UTC (daily) and the 1st of each month (monthly).
You’ll receive a 429 error with details:
{
  "success": false,
  "error": {
    "code": "DAILY_QUOTA_EXCEEDED",
    "message": "Daily request limit exceeded.",
    "details": {
      "daily_limit": 100,
      "daily_usage": 101
    }
  }
}
The response includes a Retry-After header with seconds until reset.
No. Requests blocked by keyword rules or geo-restrictions do not count against your rate limits. Only successful processing attempts are counted.
Check usage in two ways:
  1. Dashboard - Visit app.getchatads.com for real-time usage graphs
  2. API Response - Every response includes meta.usage with current counts:
{
  "meta": {
    "usage": {
      "monthly_requests": 250,
      "daily_requests": 20,
      "daily_limit": 100,
      "is_free_tier": true
    }
  }
}
  1. Go to app.getchatads.com/settings/billing
  2. Select a higher tier
  3. Complete payment
New limits take effect immediately.

Errors & Troubleshooting

This means no API key was provided. Check that you’re including the X-API-Key header:
curl -X POST 'https://chatads--chatads-api-fastapiserver-serve.modal.run/v1/chatads/messages' \
  -H 'X-API-Key: cak_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{"message": "test"}'
Common issues:
  • Header name is case-sensitive: use X-API-Key
  • Don’t include “Bearer” prefix—just the key itself
This means your API key is invalid or disabled. Verify:
  1. The key starts with cak_
  2. It hasn’t been revoked in the dashboard
  3. Your team account is active
Generate a new key at app.getchatads.com/settings/api-keys.
Several reasons can cause no match:
  1. No product detected - The message doesn’t contain a clear product reference
  2. Intent too low - The query’s intent score is below your min_intent threshold
  3. No affiliate available - The product exists but has no affiliate link
  4. Blocked keyword - Your team has a keyword rule blocking this content
Check the reason field in the response for specifics.
Try these optimizations:
  1. Use message_analysis: "fast" - NLP-only extraction (~50ms vs ~150ms)
  2. Use fill_priority: "speed" - Skip Google Shopping fallback
  3. Use skip_message_analysis: true - If you already know the product keyword
  4. Cache responses - Same queries return same results
Expected latencies:
  • fast + speed: ~50-100ms
  • balanced + coverage: ~150-300ms
  • thorough + coverage: ~300-500ms
Implement exponential backoff:
async function analyzeWithRetry(message: string, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const response = await client.analyzeMessage({ message });

    if (response.success) return response;

    if (response.error?.code === 'DAILY_QUOTA_EXCEEDED') {
      // Wait until tomorrow - don't retry
      throw new Error('Daily limit reached');
    }

    if (response.error?.code === 'RATE_LIMIT_EXCEEDED') {
      // Exponential backoff: 1s, 2s, 4s
      await sleep(1000 * Math.pow(2, i));
      continue;
    }

    throw new Error(response.error?.message);
  }
}
The free tier provides 100 requests/month for testing. For development, you can:
  1. Use the API Explorer in the dashboard
  2. Cache responses during development
  3. Contact support@getchatads.com for extended testing quotas

Advanced Usage

Pass the country parameter with an ISO 3166-1 alpha-2 code:
{
  "message": "Best running shoes",
  "country": "US"
}
ChatAds uses this for:
  • Localized affiliate links (amazon.com vs amazon.de)
  • Country-specific product availability
  • Geo-restriction enforcement (if configured)
You can also pass ip for automatic geo-detection.
Yes! Configure keyword rules in the dashboard:
  1. Go to app.getchatads.com/settings/rules
  2. Add blocked keywords
  3. Optionally set a custom rejection message
Blocked requests return CONTENT_BLOCKED (422) and don’t count against your quota.
Messages can be 1-5000 characters. Longer messages return MESSAGE_TOO_LONG (400).For best results, send the relevant portion of the conversation—typically the user’s last message or the product-related context.
For streaming AI responses, call ChatAds first:
// 1. Get affiliate link before generating response
const affiliate = await chatads.analyzeMessage({
  message: userMessage
});

// 2. Include link in system prompt or append to response
const systemPrompt = affiliate.data?.ad
  ? `If relevant, recommend: ${affiliate.data.ad.product} - ${affiliate.data.ad.link}`
  : '';

// 3. Stream your AI response
const stream = await ai.chat.completions.create({
  messages: [
    { role: 'system', content: systemPrompt },
    { role: 'user', content: userMessage }
  ],
  stream: true
});
Not currently. ChatAds is a synchronous API—you send a request and receive an immediate response. For async workflows, use tools like n8n or Zapier to trigger actions based on API responses.

Security & Privacy

ChatAds processes messages in real-time and does not store message content after processing. We retain:
  • Usage logs (request counts, timestamps)
  • Error logs (for debugging, anonymized)
  • Team/account configuration
See our Privacy Policy for details.
Never expose your API key in client-side code. Best practices:
  • Store in environment variables
  • Use server-side API routes
  • Rotate keys if exposed
  • Use separate keys for dev/prod
# .env (never commit this file)
CHATADS_API_KEY=cak_your_api_key