Skip to main content
Enhance your social media data with AI-powered analysis. ML enrichment can be applied to any content-fetching endpoint or used directly via the /ml/analyze endpoint.

Available Enrichment Types

Sentiment Analysis

Classify text as positive, negative, or neutral.
{
  "enrich": ["sentiment"]
}
Response:
{
  "enrichment": {
    "sentiment": "positive",
    "sentiment_score": 0.92
  }
}

Topic Extraction

Identify main topics discussed in the text.
{
  "enrich": ["topics"]
}
Response:
{
  "enrichment": {
    "topics": ["technology", "innovation", "startups"]
  }
}

Custom Topic Categories

Define your own topic categories for classification:
{
  "enrich": ["topics"],
  "categories": {
    "topic": ["product", "service", "pricing", "support", "feature_request"]
  }
}
Response:
{
  "enrichment": {
    "topics": ["product", "feature_request"]
  }
}

Intent Detection

Identify the user’s intent behind the text.
{
  "enrich": ["intent"]
}
Response:
{
  "enrichment": {
    "intent": "purchase_intent"
  }
}
Common intents include:
  • purchase_intent - User wants to buy something
  • complaint - User is expressing dissatisfaction
  • question - User is asking for information
  • praise - User is giving positive feedback
  • suggestion - User is making a recommendation

Keyword Extraction

Extract important keywords and phrases.
{
  "enrich": ["keywords"]
}
Response:
{
  "enrichment": {
    "keywords": ["machine learning", "AI", "automation", "efficiency"]
  }
}

Combining Enrichments

Request multiple enrichment types in a single call:
{
  "username": "charlidamelio",
  "limit": 10,
  "enrich": ["sentiment", "topics", "intent", "keywords"]
}
Response:
{
  "enrichment": {
    "sentiment": "positive",
    "sentiment_score": 0.85,
    "topics": ["dance", "entertainment"],
    "intent": "engagement",
    "keywords": ["dance", "tutorial", "fyp", "trending"]
  }
}

LLM Provider Selection

Choose which AI model to use for enrichment:
{
  "username": "charlidamelio",
  "limit": 10,
  "enrich": ["sentiment", "topics"],
  "llm_provider": "gemini-2.0-flash"
}
Available providers:
  • gemini-2.0-flash (default) - Fast, cost-effective
  • gemini-1.5-pro - More accurate, higher cost

Direct ML Analysis

Use the /ml/analyze endpoint for standalone text analysis:
curl -X POST "https://api.yourservice.com/ml/analyze" \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "texts": [
      "I love this product! Best purchase ever!",
      "This is terrible. Want a refund.",
      "How do I contact support?"
    ],
    "analyses": ["sentiment", "intent"]
  }'
Response:
{
  "success": true,
  "data": {
    "results": [
      {
        "text": "I love this product! Best purchase ever!",
        "sentiment": "positive",
        "sentiment_score": 0.95,
        "intent": "praise"
      },
      {
        "text": "This is terrible. Want a refund.",
        "sentiment": "negative",
        "sentiment_score": 0.12,
        "intent": "complaint"
      },
      {
        "text": "How do I contact support?",
        "sentiment": "neutral",
        "sentiment_score": 0.48,
        "intent": "question"
      }
    ]
  },
  "metadata": {
    "credits_used": 6,
    "enrichments": ["sentiment", "intent"]
  }
}

Best Practices

Batch your texts

The ML analyze endpoint supports up to 25 texts per request

Use custom categories

For better topic classification in your domain

Cache results

ML analysis results are deterministic for the same input

Choose appropriate enrichments

Only request what you need to save credits