API reference · Scans & reports
Trend
/reports/trend| Authentication | Customer token (Bearer) |
|---|---|
| Access | Free user · Pro user Customer token (Bearer) — free and paid users |
SoV or visibility per run for the brand and the top 3 competitors, question-set change markers, engine change markers, first-run baseline, from→to summary and per-engine change. Before the second run the UI shows «بعد از اجرای بعدی، روند اینجا دیده میشود» with next_run_at.
engine_changes: one item per run (from the second on) where, compared with the previous run, a plan engine was added (added) or left out (removed), or an admin changed an engine route's model (model, old → new) or web search (web_search, on/off) in the admin panel between the two runs' starts (rows of engine_changes). Only engines of the plan and of the engine filter count. The app draws a dotted «تغییر موتور» line on that run with the details in a tooltip.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
metric | query | string,null | sov (default) | visibility |
run_id | query | integer | run to show; 0/absent = default run. Free: only the default run |
engine | query | string | all (default) | chatgpt | gemini | claude (must be in the plan) |
cell_id | query | integer | matrix cell; 0/absent = all cells |
Responses
200 — TrendReport
| Field | Type | Description |
|---|---|---|
context* | object | The filters this report was built with (scan, AI assistant, audience). |
context.… | string | |
metric* | string ("visibility", "sov") | |
runs_count* | integer | |
next_run_at* | string | null | |
series* | object[] | |
series[].key* | string | |
series[].name* | string | |
series[].is_own* | boolean | True for your own brand. |
series[].points* | object[] | |
series[].points[].run_id* | integer | ID of the scan. |
series[].points[].date* | string | null | |
series[].points[].value* | number | null | |
question_set_changes* | object[] | |
question_set_changes[].run_id* | integer | ID of the scan. |
question_set_changes[].date* | string | null | |
question_set_changes[].changed* | integer | |
engine_changes* | object[] | |
engine_changes[].run_id* | integer | ID of the scan. |
engine_changes[].date* | string | null | |
engine_changes[].changes* | object | object | object[] | |
first* | object | |
first.share* | string | number | |
first.visibility* | number | |
first.visible_answers* | integer | |
first.total_answers* | integer | |
first.date* | string | null | |
summary* | object | |
summary.from* | string | number | |
summary.to* | string | number | |
summary.leader* | string | null | |
summary.gap_from* | number | null | |
summary.gap_to* | number | null | |
by_engine* | object[] | |
by_engine[].engine* | string | AI assistant key, e.g. chatgpt, gemini or claude. |
by_engine[].from* | number | null | |
by_engine[].to* | number | null |
{
"context": {
"…": "ReportContext — same shape as in GET /reports/overview"
},
"metric": "sov",
"runs_count": 4,
"next_run_at": "2026-12-25T10:30:00Z",
"series": [
{
"key": "own",
"name": "آوند",
"is_own": true,
"points": [
{
"run_id": 35,
"date": "2026-08-25T10:30:00Z",
"value": 11.8
},
{
"run_id": 36,
"date": "2026-09-25T10:30:00Z",
"value": 14.3
}
]
},
{
"key": "c163",
"name": "نیکحساب",
"is_own": false,
"points": [
{
"run_id": 35,
"date": "2026-08-25T10:30:00Z",
"value": 38.2
},
{
"run_id": 36,
"date": "2026-09-25T10:30:00Z",
"value": 37.1
}
]
}
],
"question_set_changes": [
{
"run_id": 37,
"date": "2026-10-25T10:30:00Z",
"changed": 2
}
],
"engine_changes": [
{
"run_id": 36,
"date": "2026-09-25T10:30:00Z",
"changes": [
{
"engine": "chatgpt",
"field": "model",
"old": "gpt-5",
"new": "gpt-5.1"
}
]
}
],
"first": {
"share": 11.8,
"visibility": 37.5,
"visible_answers": 3,
"total_answers": 8,
"date": "2026-08-25T10:30:00Z"
},
"summary": {
"from": 11.8,
"to": 18.8,
"leader": "نیکحساب",
"gap_from": 26.4,
"gap_to": 15.6
},
"by_engine": [
{
"engine": "chatgpt",
"from": 11.8,
"to": 18.8
}
]
}
401 — Missing/invalid token, or a token of the wrong owner (admin token on a user route or vice versa): {"message":"…","code":"unauthenticated"} (message in the request language)
| Field | Type |
|---|---|
message* | string |
code | string |
{
"message": "Please sign in to continue; your session has ended or is not valid.",
"code": "unauthenticated"
}
403 — plan_limit
| Field | Type |
|---|---|
message* | string |
code* | string ("plan_limit", "forbidden") |
{
"message": "این امکان در طرح راوی حرفهای است.",
"code": "plan_limit"
}
404 — No brand
| Field | Type |
|---|---|
message* | string |
{
"message": ""
}
422 — Validation failed (metric)
| Field | Type |
|---|---|
message* | string |
errors* | object |
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
curl example
curl -X GET 'http://127.0.0.1:8010/api/reports/trend' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN"