CLI & MCP Server
A command-line tool and MCP server for the ExportComments API. Export comments and reviews from 40+ platforms directly from your terminal or through AI assistants like Claude, Cursor, and Windsurf.
Installation
Install globally via npm:
bash
npm install -g exportcomments-cli
Or run directly with npx:
bash
npx exportcomments-cli export https://www.instagram.com/p/ABC123/
Node.js requirement
The CLI requires Node.js 18 or later.
Authentication
Get your API token from the API dashboard, then set it as an environment variable:
bash
export EXPORTCOMMENTS_API_TOKEN="your-token-here"
Or pass it with each command:
bash
exportcomments --token "your-token-here" export https://...
Commands
| Command | Alias | Description |
|---|---|---|
export | create | Create a new export job |
status | check | Check export job status |
list | ls | List all export jobs |
download | dl | Download completed export |
platforms | — | List or detect supported platforms |
ping | — | Check API connectivity |
Output Format
All commands output structured JSON for easy parsing and automation:
json
{"ok": true,"data": { ... }}
On error:
json
{"ok": false,"error": "Human-readable error message","error_code": "MACHINE_READABLE_CODE","detail": "Additional context"}
Job Statuses
| Status | Description |
|---|---|
queueing | Job is queued for processing |
progress | Job is being processed |
done | Job completed successfully |
error | Job failed with an error |
Quick Example
bash
# 1. Detect the platformexportcomments platforms --detect "https://www.instagram.com/p/ABC123/"# 2. Create an export and wait for completionexportcomments export "https://www.instagram.com/p/ABC123/" --replies --wait# 3. Download the raw dataexportcomments download <guid> --json
