Rawi

مرجع API · Scans & reports

Trend

get/reports/trend
احراز هویتتوکن مشتری (Bearer)
سطح دسترسیکاربر رایگان · کاربر حرفه‌ای

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.

پارامترها

ناممحلنوعتوضیح
metricquerystring,nullsov (default) | visibility
run_idqueryintegerrun to show; 0/absent = default run. Free: only the default run
enginequerystringall (default) | chatgpt | gemini | claude (must be in the plan)
cell_idqueryintegermatrix cell; 0/absent = all cells

پاسخ‌ها

200 — TrendReport

فیلدنوعتوضیح
context*objectThe 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*booleanTrue for your own brand.
series[].points*object[]
series[].points[].run_id*integerID of the scan.
series[].points[].date*string | null
series[].points[].value*number | null
question_set_changes*object[]
question_set_changes[].run_id*integerID of the scan.
question_set_changes[].date*string | null
question_set_changes[].changed*integer
engine_changes*object[]
engine_changes[].run_id*integerID 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*stringAI assistant key, e.g. chatgpt, gemini or claude.
by_engine[].from*number | null
by_engine[].to*number | null
json
{
  "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)

فیلدنوع
message*string
codestring
json
{
  "message": "Please sign in to continue; your session has ended or is not valid.",
  "code": "unauthenticated"
}

403 — plan_limit

فیلدنوع
message*string
code*string ("plan_limit", "forbidden")
json
{
  "message": "این امکان در طرح راوی حرفه‌ای است.",
  "code": "plan_limit"
}

404 — No brand

فیلدنوع
message*string
json
{
  "message": ""
}

422 — Validation failed (metric)

فیلدنوع
message*string
errors*object
json
{
  "message": "",
  "errors": {
    "email": [
      "ایمیل معتبر نیست."
    ]
  }
}

نمونهٔ curl

bash
curl -X GET 'http://127.0.0.1:8010/api/reports/trend' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN"

امتحان در کنسول