Documentation

API Reference

Internal REST API used by the Veractum frontend.

Rate Limits

TierAnalyses / monthMax video lengthClaims per analysis
Observer (free)210 min5
Analyst301 hour10
VeractorUnlimited6 hours20

POST /api/analyze

Start a new analysis for a YouTube video. Requires authentication.

Request Body

{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "locale": "pt"   // optional, defaults to "en"
}

Success Response 202

{
  "success": true,
  "data": {
    "analysisId": "cmo...",
    "status": "PROCESSING"
  }
}

Error Responses

401Not authenticated
402Monthly quota exceeded
422No captions available or transcript too short
503Database unavailable

GET /api/analyze

Poll the status of an analysis. Used by the results page to detect completion.

Query Parameters

GET /api/analyze?id=cmo...

Response when PROCESSING 200

{
  "success": true,
  "data": {
    "id": "cmo...",
    "status": "PROCESSING",
    "claims": []
  }
}

Response when COMPLETE 200

{
  "success": true,
  "data": {
    "id": "cmo...",
    "status": "COMPLETE",
    "videoTitle": "...",
    "summary": { "overview": "...", "keyPoints": [...], "segments": [...] },
    "claims": [
      {
        "id": "...",
        "text": "The claim text",
        "type": "FACTUAL",
        "status": "SUPPORTED",
        "confidence": 85,
        "reasoning": "...",
        "sources": [{ "title": "...", "url": "...", "domain": "..." }],
        "timestamp": "3:45"
      }
    ]
  }
}

Authentication

All endpoints require a valid NextAuth session cookie. Sign in via /api/auth/signin using Google OAuth. The session token is set automatically as an HTTP-only cookie.

API Reference — Veractum