API Documentation

Programmatic access to ExportComments for exporting and analyzing social media comments.

v1
Pro & Agency plans

Authentication

All API requests require a Bearer token. Generate an API key from your API Keys dashboard.

curl -H "Authorization: Bearer se_live_your_api_key" \
  https://exportcomments.xyz/api/v1/export

Rate Limits

Pro Plan

100 requests/minute

Agency Plan

500 requests/minute

Rate-limited responses return 429 Too Many Requests.

Response Format

All responses are JSON. Successful responses wrap data in a data field. Errors include an error field.

Success

{
  "data": {
    "id": "clx...",
    "status": "PROCESSING"
  }
}

Error

{
  "error": "Export not found"
}

Endpoints

POST/api/v1/export
Start a new comment export job

Request Body

{
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "format": "CSV"  // CSV | EXCEL | JSON | GOOGLE_SHEETS
}

Response (201)

{
  "data": {
    "id": "clx123...",
    "status": "PROCESSING",
    "platform": "YOUTUBE",
    "sourceUrl": "https://...",
    "format": "CSV"
  }
}

cURL

curl -X POST https://exportcomments.xyz/api/v1/export \
  -H "Authorization: Bearer se_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://youtube.com/watch?v=xxx", "format": "CSV"}'

Python

import requests

resp = requests.post(
    "https://exportcomments.xyz/api/v1/export",
    headers={"Authorization": "Bearer se_live_xxx"},
    json={"url": "https://youtube.com/watch?v=xxx", "format": "CSV"},
)
export_id = resp.json()["data"]["id"]

JavaScript

const res = await fetch("https://exportcomments.xyz/api/v1/export", {
  method: "POST",
  headers: {
    Authorization: "Bearer se_live_xxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://youtube.com/watch?v=xxx", format: "CSV" }),
});
const { data } = await res.json();
GET/api/v1/export/:id
Get export status and metadata

Response (200)

{
  "data": {
    "id": "clx123...",
    "platform": "YOUTUBE",
    "sourceUrl": "https://...",
    "postTitle": "Video Title",
    "postAuthor": "Channel Name",
    "status": "COMPLETED",
    "format": "CSV",
    "totalComments": 347,
    "fileUrl": "https://...",
    "createdAt": "2026-03-13T..."
  }
}

cURL

curl https://exportcomments.xyz/api/v1/export/clx123 \
  -H "Authorization: Bearer se_live_xxx"
GET/api/v1/export/:id/comments
Get paginated comments for an export

Query Parameters

page — Page number (default: 1)

limit — Results per page, max 100 (default: 50)

sentiment — Filter: POSITIVE, NEGATIVE, NEUTRAL

search — Search in comment text

sort — Sort by: likesCount, timestamp, username (default: likesCount)

order — asc or desc (default: desc)

Response (200)

{
  "data": {
    "comments": [
      {
        "id": "clx...",
        "username": "user123",
        "commentText": "Great video!",
        "likesCount": 42,
        "sentiment": "POSITIVE",
        "isSpam": false
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 50,
      "total": 347,
      "totalPages": 7
    }
  }
}

cURL

curl "https://exportcomments.xyz/api/v1/export/clx123/comments?page=1&limit=50&sentiment=POSITIVE" \
  -H "Authorization: Bearer se_live_xxx"
POST/api/v1/analyze/:exportId
Trigger AI analysis on an export

Response (202)

{
  "data": {
    "status": "PROCESSING",
    "exportId": "clx123..."
  }
}

cURL

curl -X POST https://exportcomments.xyz/api/v1/analyze/clx123 \
  -H "Authorization: Bearer se_live_xxx"
GET/api/v1/analyze/:exportId
Get AI analysis results

Response (200)

{
  "data": {
    "id": "clx...",
    "exportId": "clx123...",
    "sentimentBreakdown": {
      "positive": 156,
      "negative": 42,
      "neutral": 149
    },
    "topTopics": [
      { "topic": "pricing", "count": 23, "sentiment": "NEGATIVE" }
    ],
    "spamCount": 5,
    "summary": "The comment section shows...",
    "topComments": [...]
  }
}

Error Codes

CodeMeaning
400Invalid request body or parameters
401Missing or invalid API key
403Plan limit reached or insufficient permissions
404Resource not found
429Rate limit exceeded
500Internal server error