REST API
Read and create brand and question reports from your own code. It uses the same API keys as the MCP server.
1. Base URL
JSON over HTTPS. Send your key in the Authorization: Bearer header, or as the api_key query parameter.
https://aitrafficanalytics.com/api/v1
2. API key
3. How it works
- Same capabilities as MCP. Every endpoint below is one MCP tool mounted as a URL; the names, parameters and responses match, so the MCP page is the other half of these docs.
- Reports run in the background.
POST .../reportsanswers202with arun_idright away. PollGET /runs/:run_iduntilstatusissucceeded, then fetch the report. Add?wait=1to block until the report is saved instead (a minute or more). - Runs cost money and are capped. Each run spends your FreeRouter credit. A key may start 20 runs an hour; after that you get
429withRetry-After. - Read-only keys. A key created as read-only can list and read everything (brands, questions, reports, insights, the PDF) but gets
403on anything that runs, creates, changes, shares or deletes. Use one for dashboards and contractors. - Ids. Brands and questions use
XXXX-XXXXids. Reports and runs use numbers. Omit the report id to get the latest report.
4. Endpoints
36 endpoints
GET
/models
|
GET
/brands
|
GET
/brands/:id
|
GET
/brands/:id/reports/:reportId?
|
POST
/brands/:id/reports
|
POST
/brands
|
POST
/brands/:id/suggestions
|
POST
/brands/:id/questions
|
GET
/questions
|
GET
/questions/:id
|
GET
/questions/:id/reports/:reportId?
|
POST
/questions/:id/reports
|
POST
/questions
|
POST
/questions/:id/suggestions
|
GET
/brands/:id/insights
|
GET
/questions/:id/insights
|
GET
/brands/:id/export.pdf
|
GET
/questions/:id/export.pdf
|
POST
/questions/:id/keywords
|
DELETE
/questions/:id/keywords
|
PATCH
/brands/:id/schedule
|
PATCH
/questions/:id/schedule
|
PATCH
/brands/:id/email-reports
|
PATCH
/questions/:id/email-reports
|
PATCH
/brands/:id/insights
|
PATCH
/questions/:id/insights
|
PUT
/brands/:id/share
|
PUT
/questions/:id/share
|
PATCH
/brands/:id
|
PATCH
/questions/:id
|
DELETE
/brands/:id
|
DELETE
/questions/:id
|
DELETE
/brands/:id/reports/:reportId
|
DELETE
/questions/:id/reports/:reportId
|
GET
/runs/:runId
|
POST
/questions/:id/questions
|
GET /models
The FreeRouter models saved in Settings. Reports ask these models unless you pass a subset. (MCP tool list_models, read-only keys allowed)
None beyond the path.
JSON with the same fields the MCP tool returns.
GET /brands
Every tracked brand with its question count, report count, and latest report time. (MCP tool list_brands, read-only keys allowed)
None beyond the path.
[
{
"brand_id": "K7PM-3QRX",
"name": "Example Brand",
"questions": 4,
"reports": 2,
"last_report_at": "2026-10-18T14:02:11.000Z",
"schedule": "daily"
}
]
GET /brands/:id
A brand's questions and the summary of each of its reports, newest first. (MCP tool get_brand, read-only keys allowed)
None beyond the path.
JSON with the same fields the MCP tool returns.
GET /brands/:id/reports/:reportId?
What each model answered to each brand question, with mention counts and coverage. (MCP tool get_brand_report, read-only keys allowed)
modelquery · string |
Only include this model id, e.g. anthropic/claude-sonnet-5.5 |
include_answersquery · boolean |
Include each model's full answer text (default true) |
JSON with the same fields the MCP tool returns.
POST /brands/:id/reports
Ask the chosen models every question on a brand, save the report, and return it. Costs money on the user's FreeRouter key and takes about 15-60 seconds per model. (MCP tool run_brand_report, spends FreeRouter credit)
modelsbody · array of string |
Model ids to ask; omit to use every model saved in Settings (see list_models) |
{
"run_id": 45,
"status": "running",
"brand_id": "K7PM-3QRX",
"models": [
"anthropic/claude-sonnet-5.5"
],
"check": "/api/v1/runs/45"
}
POST /brands
Start tracking a brand with the questions to ask models about it. Not sure which questions? Create it with one, then use suggest_brand_questions. (MCP tool create_brand)
namebody · string · required |
Brand name to look for in answers |
questionsbody · array of string · required |
Questions to ask, e.g. "What are the best CRM tools?" |
websitebody · string |
The brand's website, e.g. example.com. Optional; makes suggested questions more accurate. |
JSON with the same fields the MCP tool returns.
POST /brands/:id/suggestions
Search the web for a brand and suggest the questions buyers are likely to ask AI models about its category, best first. Written by a model on the user's FreeRouter key (about 20-60 seconds). Nothing is added until you call add_brand_questions. (MCP tool suggest_brand_questions, spends FreeRouter credit)
modelbody · string |
Model id to write the suggestions; omit for the writing model chosen in Settings |
JSON with the same fields the MCP tool returns.
POST /brands/:id/questions
Add questions to a brand, for example ones picked from suggest_brand_questions. Questions the brand already tracks are skipped. Every later report asks them. (MCP tool add_brand_questions)
questionsbody · array of string · required |
Questions to add |
from_suggestionsbody · boolean |
True when the questions came from suggest_brand_questions (default true) |
JSON with the same fields the MCP tool returns.
GET /questions
Every tracked question with its keywords, report count, and schedule. (MCP tool list_questions, read-only keys allowed)
None beyond the path.
JSON with the same fields the MCP tool returns.
GET /questions/:id
A tracked question's keywords, schedule, and the summary of each of its reports, newest first. (MCP tool get_question, read-only keys allowed)
None beyond the path.
JSON with the same fields the MCP tool returns.
GET /questions/:id/reports/:reportId?
What each model answered to a tracked question, with keyword mention counts. (MCP tool get_question_report, read-only keys allowed)
modelquery · string |
Only include this model id, e.g. anthropic/claude-sonnet-5.5 |
include_answersquery · boolean |
Include each model's full answer text (default true) |
JSON with the same fields the MCP tool returns.
POST /questions/:id/reports
Ask the chosen models a tracked question, save the report, and return it. Costs money on the user's FreeRouter key and takes about 15-60 seconds per model. (MCP tool run_question_report, spends FreeRouter credit)
modelsbody · array of string |
Model ids to ask; omit to use every model saved in Settings (see list_models) |
{
"run_id": 46,
"status": "running",
"question_id": "ERRS-D3FG",
"models": [
"anthropic/claude-sonnet-5.5"
],
"check": "/api/v1/runs/46"
}
POST /questions
Start tracking a question. Keywords (brands, products to count in answers) are optional: when omitted, AITrafficAnalytics picks them from the model answers after the first report and keeps tuning them on later runs. Scheduled reports are off unless you set schedule. (MCP tool create_question)
questionbody · string · required |
The question to ask models |
keywordsbody · array of string |
Optional words to count in answers, e.g. brand or product names. Leave out to have them picked automatically. |
schedulebody · "off" | "daily" | "weekly" |
Automatic reports (default off); each run costs money |
{
"question_id": "ERRS-D3FG",
"question": "What is the best CRM for a small business?",
"keywords": [],
"schedule": "off"
}
POST /questions/:id/suggestions
Questions in the same market as a tracked question but from a different angle (audience, use case, budget, criterion), best first. Searches the web, then the user's writing model writes them on their FreeRouter key (about 10-20 seconds). Nothing is tracked until you call add_similar_questions. (MCP tool suggest_similar_questions, spends FreeRouter credit)
None beyond the path.
JSON with the same fields the MCP tool returns.
GET /brands/:id/insights
The plain-language reading of a brand's or question's reports (what the AI models say, what changed, where they disagree). Cached for a day; set refresh to write a new one on the user's FreeRouter key. (MCP tool get_insights, read-only keys allowed)
refreshquery · boolean |
Write a fresh reading now (costs money on the user's key) |
{
"status": "ok",
"model": "deepseek/deepseek-v4.1-flash-1017",
"generated_at": "2026-10-18T14:05:00.000Z",
"cached": true,
"paragraphs": [
"Roku stands out as the name that dominates the answers..."
],
"how_to_read": [
"..."
]
}
GET /questions/:id/insights
The plain-language reading of a brand's or question's reports (what the AI models say, what changed, where they disagree). Cached for a day; set refresh to write a new one on the user's FreeRouter key. (MCP tool get_insights, read-only keys allowed)
refreshquery · boolean |
Write a fresh reading now (costs money on the user's key) |
{
"status": "ok",
"model": "deepseek/deepseek-v4.1-flash-1017",
"generated_at": "2026-10-18T14:05:00.000Z",
"cached": true,
"paragraphs": [
"Roku stands out as the name that dominates the answers..."
],
"how_to_read": [
"..."
]
}
GET /brands/:id/export.pdf
The brand's or question's report as a PDF (insights, keywords or questions, charts, tables, AITrafficAnalytics attribution). Returned as a base64 PDF resource; uses cached insights only. (MCP tool export_report_pdf, read-only keys allowed)
None beyond the path.
A PDF file (Content-Type: application/pdf).
GET /questions/:id/export.pdf
The brand's or question's report as a PDF (insights, keywords or questions, charts, tables, AITrafficAnalytics attribution). Returned as a base64 PDF resource; uses cached insights only. (MCP tool export_report_pdf, read-only keys allowed)
None beyond the path.
A PDF file (Content-Type: application/pdf).
POST /questions/:id/keywords
Add keywords (brands, products) to count in a question's answers. Saved reports are recounted so charts include them at once. A keyword the harvester dropped or the user removed comes back. (MCP tool add_keywords)
keywordsbody · array of string · required |
JSON with the same fields the MCP tool returns.
DELETE /questions/:id/keywords
Stop counting keywords on a question. An auto-picked keyword removed this way is never picked again. Saved reports are recounted. (MCP tool remove_keywords)
keywordsbody · array of string · required |
JSON with the same fields the MCP tool returns.
PATCH /brands/:id/schedule
Turn scheduled reports on or off for a brand or question and choose the AI models they ask. Scheduled runs cost money on the user's FreeRouter key. (MCP tool set_schedule)
frequencybody · "off" | "daily" | "weekly" · required |
Daily (every day), weekly (Mondays), or off |
modelsbody · array of string |
Model ids from list_models; omit or pass all of them for every saved model |
JSON with the same fields the MCP tool returns.
PATCH /questions/:id/schedule
Turn scheduled reports on or off for a brand or question and choose the AI models they ask. Scheduled runs cost money on the user's FreeRouter key. (MCP tool set_schedule)
frequencybody · "off" | "daily" | "weekly" · required |
Daily (every day), weekly (Mondays), or off |
modelsbody · array of string |
Model ids from list_models; omit or pass all of them for every saved model |
JSON with the same fields the MCP tool returns.
PATCH /brands/:id/email-reports
Email each scheduled report to the user, or stop. Same as the eye (watch) button on the page. (MCP tool set_email_reports)
enabledbody · boolean · required |
JSON with the same fields the MCP tool returns.
PATCH /questions/:id/email-reports
Email each scheduled report to the user, or stop. Same as the eye (watch) button on the page. (MCP tool set_email_reports)
enabledbody · boolean · required |
JSON with the same fields the MCP tool returns.
PATCH /brands/:id/insights
Turn the Insights reading on or off for a brand or question. (MCP tool set_insights)
enabledbody · boolean · required |
JSON with the same fields the MCP tool returns.
PATCH /questions/:id/insights
Turn the Insights reading on or off for a brand or question. (MCP tool set_insights)
enabledbody · boolean · required |
JSON with the same fields the MCP tool returns.
PUT /brands/:id/share
Create or update a public link to a brand's or question's reports (no password). Returns the URL anyone can open. Set enabled false to turn the link off. (MCP tool share_report)
enabledbody · boolean |
Default true |
{
"brand_id": "K7PM-3QRX",
"enabled": true,
"url": "https://aitrafficanalytics.com/shared/brand/<token>"
}
PUT /questions/:id/share
Create or update a public link to a brand's or question's reports (no password). Returns the URL anyone can open. Set enabled false to turn the link off. (MCP tool share_report)
enabledbody · boolean |
Default true |
{
"brand_id": "K7PM-3QRX",
"enabled": true,
"url": "https://aitrafficanalytics.com/shared/brand/<token>"
}
PATCH /brands/:id
Rename a brand, change its website, or replace its question list. (MCP tool update_brand)
namebody · string |
|
websitebody · string |
|
questionsbody · array of string |
The full question list; questions left out are removed |
JSON with the same fields the MCP tool returns.
PATCH /questions/:id
Change the wording of a tracked question. Keywords are untouched. (MCP tool update_question)
questionbody · string · required |
JSON with the same fields the MCP tool returns.
DELETE /brands/:id
Delete a brand with all of its questions, reports and share links. Cannot be undone. (MCP tool delete_brand)
None beyond the path.
JSON with the same fields the MCP tool returns.
DELETE /questions/:id
Delete a tracked question with all of its keywords and reports. Cannot be undone. (MCP tool delete_question)
None beyond the path.
JSON with the same fields the MCP tool returns.
DELETE /brands/:id/reports/:reportId
Delete one saved report of a brand or question. Cannot be undone. (MCP tool delete_report)
None beyond the path.
JSON with the same fields the MCP tool returns.
DELETE /questions/:id/reports/:reportId
Delete one saved report of a brand or question. Cannot be undone. (MCP tool delete_report)
None beyond the path.
JSON with the same fields the MCP tool returns.
GET /runs/:runId
Where a report run is: running (with the model being asked), succeeded (with the report id), failed (with the reason) or interrupted. Runs are started by run_brand_report / run_question_report. (MCP tool get_run, read-only keys allowed)
None beyond the path.
{
"run_id": 45,
"kind": "brand",
"brand_id": "K7PM-3QRX",
"status": "succeeded",
"models": [
"anthropic/claude-sonnet-5.5"
],
"completed": 1,
"current_model": null,
"report_id": 123,
"error": null,
"started_at": "2026-10-18T14:00:00.000Z",
"finished_at": "2026-10-18T14:00:41.000Z"
}
POST /questions/:id/questions
Track questions picked from suggest_similar_questions. Each copies the source question's schedule, models and email setting (so scheduled ones add reports on the user's FreeRouter key); keywords are picked after the first report. Questions already tracked are skipped. (MCP tool add_similar_questions)
questionsbody · array of string · required |
Questions to track |
JSON with the same fields the MCP tool returns.
Errors
| Body | { "error": "Description of the error" } |
400 |
Bad request: a parameter is missing or has the wrong type. The message names it. |
401 |
Unauthorized: the API key is missing, invalid or revoked. |
403 |
Forbidden: a read-only key called something that writes or spends money. |
404 |
Not found: no such brand, question, report or run on this account (also used for expected failures such as "no reports yet"). |
409 |
Conflict: a report is already running for this brand or question. |
429 |
Too many runs: more than 20 report runs in an hour on this key. Retry-After says when. |
500 |
Server error: something went wrong on our side. |
Reports run on the FreeRouter key and models chosen in Settings. Questions? Email us.