Quick Start

Base URL: https://semalytics.com/api/analyze
Auth: Anonymous access with X-Session-ID header (30 req/hr) or API key
Method: All endpoints accept POST with JSON body
Min content: 50 characters

Authentication

The COS API supports three authentication methods. Anonymous access works for testing and low-volume use. API keys are available for production integrations.

MethodHeaderRate Limit
Anonymous X-Session-ID: your-session-id 30 requests / hour
User JWT Authorization: Bearer <token> Plan-based
API Key Authorization: Bearer cos_api_... Credit-based

For anonymous access, pass any unique string as the X-Session-ID header. This identifies your session for rate limiting. No signup required.

Quick Start Example

Send your content to any endpoint with a JSON body. Here is a minimal example using the quality analysis endpoint:

POST https://semalytics.com/api/analyze/quality
Content-Type: application/json
X-Session-ID: my-test-session

{
  "content": "Your marketing copy goes here. The COS API needs at
    least 50 characters to analyze, so include a real paragraph
    of the content you want scored.",
  "platform": "linkedin",
  "target_audience": "B2B marketing directors",
  "target_keywords": ["marketing copy analysis", "B2B content optimization"]
}

cURL example:

curl -X POST https://semalytics.com/api/analyze/quality \
  -H "Content-Type: application/json" \
  -H "X-Session-ID: my-test-session" \
  -d '{
    "content": "Your marketing copy goes here...",
    "platform": "linkedin",
    "target_audience": "B2B marketing directors",
    "target_keywords": ["marketing copy analysis", "B2B content"]
  }'

Request Body

Every analysis endpoint accepts the same request body:

FieldTypeRequiredDescription
content string required The text to analyze. Minimum 50 characters.
platform string optional Target platform. Defaults to "general". Affects scoring context.
target_audience string optional Description of your intended audience. Improves recommendation relevance.
target_keywords array optional SEO keywords to protect during optimization. Max 5. Accepts strings (first = primary, rest = secondary) or objects: {"keyword": "...", "priority": "primary|secondary"}. When provided, the Quality framework adds a 6th dimension: Keyword Coherence.

Core Framework Endpoints

Four core frameworks form the foundation of COS analysis. Each runs independently and returns a score, dimensional breakdown, analysis narrative, and actionable recommendations.

POST /api/analyze/hape

Engagement Analysis — Measures content across 8 HAPE dimensions: Identity Recognition, Social Connection, Justice & Fairness, Validation, Curiosity & Discovery, Efficacy & Agency, Authenticity, and Coherence. Predicts whether content drives action or gets passively consumed.

POST /api/analyze/big-five

Personality Analysis — Profiles content against the Big Five (OCEAN) personality model. Shows which buyer personality types your message reaches and which it misses. Scores across Openness, Conscientiousness, Extraversion, Agreeableness, and Neuroticism.

POST /api/analyze/strategic-clarity

Strategic Clarity — Evaluates coherence between your message and its business goal. Identifies where the content says one thing but signals another, where the ask contradicts the framing, or where the reader is left without a clear next step.

POST /api/analyze/framing-strategy

Framing Strategy — Analyzes cognitive framing and positioning tactics. Evaluates whether the content frames the decision in a way that serves the reader's autonomy or attempts to short-circuit it.

Response Format

All four core endpoints return the same response structure:

{
  "framework": "hape",
  "overall_score": 7.5,
  "dimensions": [
    {
      "name": "Identity Recognition",
      "score": 8.2,
      "weight": 0.125,
      "details": "Content names specific buyer role..."
    }
    // ... additional dimensions
  ],
  "analysis": "Detailed narrative analysis...",
  "recommendations": [
    "Strengthen the Efficacy dimension...",
    "Add specific evidence for the claim..."
  ]
}
FieldTypeDescription
frameworkstringFramework identifier (hape, big_five, strategic_clarity, framing_strategy)
overall_scorefloatWeighted score from 0.0 to 10.0
dimensionsarrayIndividual dimension scores with names, weights, and explanations
analysisstringWritten analysis explaining the score and key observations
recommendationsarraySpecific, actionable suggestions for improving the content

Full Multi-Framework Analysis

POST /api/analyze/full

Runs all four core frameworks in parallel and returns a combined result. This is the most common endpoint for general content analysis. One request, four framework scores, one combined score.

POST https://semalytics.com/api/analyze/full

{
  "content": "Your B2B content here...",
  "platform": "email",
  "target_audience": "SaaS founders, Series A-B"
}

Response

{
  "hape": { /* engagement analysis */ },
  "big_five": { /* personality analysis */ },
  "strategic_clarity": { /* clarity analysis */ },
  "framing_strategy": { /* framing analysis */ },
  "combined_score": 7.2,
  "summary": "Multi-framework analysis complete..."
}

Each framework field contains the full response structure described above. If a framework encounters an error, its field will be null and the combined score will be calculated from the remaining frameworks.

Want to see this analysis in action before writing code?

Try COS Free in the Browser

Domain-Specific Persuasion

POST /api/analyze/persuasion/{domain}

Analyzes content through a domain-specific persuasion lens. Different domains have different ethical boundaries, persuasion tactics, and audience expectations. The domain parameter selects which expertise to apply.

Available Domains

DomainFocus
businessB2B/B2C persuasion, ROI framing, stakeholder alignment
politicsPolitical messaging, moral foundations, polarization management
healthMedical communication, safety protocols, evidence standards
masculinityIdentity-affirming content, status preservation, reframing
comedyHumor mechanics, timing, information gap theory
POST https://semalytics.com/api/analyze/persuasion/business

{
  "content": "Your sales email copy...",
  "target_audience": "VP Sales at mid-market SaaS"
}

Response

{
  "framework": "persuasion",
  "domain": "business",
  "overall_score": 6.8,
  "dimensions": [ /* domain-specific dimensions */ ],
  "analysis": "...",
  "recommendations": ["..."],
  "strengths": ["Strong ROI framing..."],
  "warnings": ["Urgency tactic may backfire..."]
}

Platform-Specific Analysis

POST /api/analyze/platform/{platform}

Evaluates content against platform-specific constraints, cultural norms, and algorithm preferences. Checks character limits, format requirements, and engagement mechanics for the target platform.

Supported Platforms

PlatformFocus
twitterShort-form, real-time, character limits, thread structure
linkedinProfessional tone, B2B context, algorithm hooks
emailSubject line, personalization, deliverability signals
youtubeTitle/description SEO, thumbnail strategy, retention
tiktokHook timing, trend alignment, short-form pacing
instagramVisual-first, caption length, hashtag strategy
facebookCommunity tone, group dynamics, share triggers
mediumLong-form structure, curation signals, reading time
substackNewsletter structure, subscriber retention, voice consistency
podcastShow notes, discoverability, episode structure
newsletterEmail marketing, open/click patterns, list hygiene
slackInternal comms, channel norms, message density
discordCommunity chat, real-time interaction, moderation tone

Response

{
  "framework": "platform",
  "platform": "linkedin",
  "overall_score": 7.1,
  "dimensions": [ /* platform-specific dimensions */ ],
  "constraint_check": {
    "passed": true,
    "violations": [],
    "warnings": ["Post exceeds 1300 chars, may be truncated"]
  },
  "analysis": "...",
  "recommendations": ["..."],
  "algorithm_tips": ["Open with a hook question for higher dwell time"]
}

Quality Assessment

POST /api/analyze/quality

Evaluates content quality across five dimensions: Scientific Rigor, Practical Utility, Ethical Compliance, Integration Coherence, and Performance Effectiveness. Returns a quality level classification alongside the score.

When target_keywords are provided, a 6th dimension is added: Keyword Coherence. This checks whether your target SEO keywords appear in the right positions (headings, first 100 words), at the right density (0.5-2.5%), and flags any missing keywords. Weights adapt automatically: 5 dimensions at 20% each without keywords, 6 dimensions at ~16.7% each with keywords. The quality score never penalizes you for not providing keywords.

Quality Levels

Score RangeLevel
8.0 - 10.0Excellent
6.0 - 7.9Good
4.0 - 5.9Needs Work
0.0 - 3.9Significant Issues

Response

{
  "framework": "quality",
  "overall_score": 7.8,
  "quality_level": "Good",
  "dimensions": [
    { "name": "Scientific Rigor", "score": 8.0, "weight": 0.2 },
    { "name": "Practical Utility", "score": 7.5, "weight": 0.2 },
    { "name": "Ethical Compliance", "score": 9.0, "weight": 0.2 },
    { "name": "Integration Coherence", "score": 7.2, "weight": 0.2 },
    { "name": "Performance Effectiveness", "score": 7.3, "weight": 0.2 }
  ],
  "critical_issues": [],
  "analysis": "...",
  "recommendations": ["..."]
}

Full 7-Framework Communications Analysis

POST /api/analyze/full-comms

The most thorough analysis available. Runs all seven frameworks in parallel: the four core frameworks plus domain persuasion, platform fit, and quality. Returns a combined score across all dimensions.

Query Parameters

ParameterDefaultDescription
domainbusinessPersuasion domain (business, politics, health, masculinity, comedy)
platformlinkedinTarget platform for platform-specific analysis
POST https://semalytics.com/api/analyze/full-comms?domain=business&platform=linkedin

{
  "content": "Your content to analyze...",
  "target_audience": "Marketing directors at B2B SaaS"
}

Response

{
  "hape": { /* engagement scores + analysis */ },
  "big_five": { /* personality scores + analysis */ },
  "strategic_clarity": { /* clarity scores + analysis */ },
  "framing_strategy": { /* framing scores + analysis */ },
  "persuasion": { /* domain-specific + strengths/warnings */ },
  "platform": { /* platform-specific + constraint_check */ },
  "quality": { /* quality level + critical issues */ },
  "combined_score": 7.4,
  "framework_count": 7,
  "summary": "Full communications analysis complete..."
}

When to Use Which Endpoint

Quick check: Use a single framework endpoint (/hape, /big-five, etc.) when you know which dimension you need to measure.

Standard analysis: Use /full for the four core frameworks. Covers engagement, personality, clarity, and framing in one call.

Full audit: Use /full-comms when you want the complete picture, including domain persuasion, platform fit, and quality scoring. Best for pre-publish content review.

Rate Limits & Errors

Rate Limits

Auth MethodLimitWindow
Anonymous (X-Session-ID)30 requests1 hour
User JWTPlan-basedVaries
Developer API KeyCredit-basedPer-request billing

Error Responses

StatusMeaningCommon Cause
400Bad RequestContent under 50 characters, invalid domain/platform parameter
401UnauthorizedMissing or invalid authentication token
402Payment RequiredInsufficient API credits (developer key only)
429Too Many RequestsRate limit exceeded. Response includes reset_at timestamp.
500Server ErrorAnalysis framework encountered an internal error

Error Response Format

{
  "detail": "Content must be at least 50 characters"
}

// Rate limit exceeded:
{
  "detail": {
    "reset_at": "2026-03-26T15:30:00"
  }
}

Python Example

# pip install requests
import requests

response = requests.post(
    "https://semalytics.com/api/analyze/full",
    headers={
        "Content-Type": "application/json",
        "X-Session-ID": "my-integration-001"
    },
    json={
        "content": """We built COS because we noticed something
        every B2B team experiences but few measure: the same
        email lands differently with different buyers. Not because
        of the product. Because of the personality reading it.""",
        "platform": "email",
        "target_audience": "B2B revenue leaders"
    }
)

result = response.json()
print(f"Combined Score: {result['combined_score']}/10")

for fw in ["hape", "big_five", "strategic_clarity", "framing_strategy"]:
    if result.get(fw):
        print(f"  {fw}: {result[fw]['overall_score']}/10")

JavaScript Example

const response = await fetch(
  "https://semalytics.com/api/analyze/full-comms?domain=business&platform=linkedin",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-Session-ID": "my-app-session"
    },
    body: JSON.stringify({
      content: "Your LinkedIn post copy here...",
      platform: "linkedin",
      target_audience: "Marketing directors at B2B SaaS"
    })
  }
);

const data = await response.json();
console.log(`Score: ${data.combined_score}/10`);
console.log(`Frameworks analyzed: ${data.framework_count}`);

For questions about API access, integration support, or higher rate limits, reach out at api@semalytics.com.