API & MCP
For Developers: API and MCP
One engine, two transports: a REST API for scripts and dashboards, and MCP for AI assistants. Both use the same key from the Cabinet section.
REST API
Base URL: https://pjq.life/api/v1. Authorization — the Authorization: Bearer pjq_your-key header.
Quick start:
# canon of analyzed videos
curl -H "Authorization: Bearer pjq_..." https://pjq.life/api/v1/videos
latest verdict for a video
curl -H "Authorization: Bearer pjq_..." https://pjq.life/api/v1/videos//verdict
run a new analysis (async job)
curl -X POST -H "Authorization: Bearer pjq_..." -H "Content-Type: application/json" \
-d '{"url": "https://youtube.com/watch?v=...", "mode": "standard"}' \
https://pjq.life/api/v1/classify
How billing maps to calls:
* Reading is free. videos, verdict, history, exemplars, dashboard, mood cost 0 tokens — the verdict belongs to the video, reading it is never charged.
* Running a measurement costs tokens. POST /classify charges by mode: Scout and Standard — 1 token, Deep — 2. A repeat request for the same video in the same mode returns the saved verdict for free; a fresh re-measurement is an explicit paid refresh.
* classify is asynchronous: the response is {job_id, status, position}, poll GET /classify/status/{job_id} until done.
The returned schema contains the final indexes (mood, controversy, parasitic load), precise percentages for the 7 stance categories, and an array of exemplar quotes. Raw texts of all comments are not returned, in strict compliance with PJQ's privacy policy.
Read quotas. Reading costs no tokens, but it is metered by a daily per-key quota (rolling 24 hours): no tokens on balance — 100 calls/day, PJQ token holders — 5,000, enterprise — 20,000. Exceeding it returns HTTP 429 rejected_read_quota with the window state in the response. Account calls (/me, /usage, status of a running analysis) do not count toward the quota.
Model Context Protocol (MCP)
Endpoint: https://pjq.life/mcp/ (streamable HTTP), same Bearer key. The server exports 7 tools: videos_list, video_verdict, video_history, video_exemplars, mood_matrix, controversial_videos (read, 0 tokens) and video_classify (charged by mode).
Claude Desktop — claude_desktop_config.json (a ready-made config with your key is in the Cabinet):
{
"mcpServers": {
"pjq": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://pjq.life/mcp/",
"--header", "Authorization:${PJQ_AUTH}"
],
"env": { "PJQ_AUTH": "Bearer pjq_your-key" }
}
}
}
Claude Code — one command:
claude mcp add --transport http pjq https://pjq.life/mcp/ --header "Authorization: Bearer pjq_your-key"
Any other MCP client that speaks streamable HTTP connects the same way: URL + Bearer header.
*A full endpoint reference and MCP tool schemas will ship with the open-source release of the PJQ repository.*