sensorhubDevelopers
Open SensorhubGet an API key
Browse documentation
REST API / Views

prompt_latest

View

Latest observed answer for each prompt and engine, with prompt metadata and citation counts. Equal run times are resolved by answer ID. Prompts that never ran have no row. For dashboard-identical headline numbers, anchored windows and deltas, use read report_visibility_overview.

Max rows per query
100
Default order
run_at desc
Required filter
one of project_id
Max offset
2000
Cursor paging
by id

Filter project_id and day where available. For dashboard-identical headline numbers, anchored windows and deltas, use read report_*.

Fields

FieldTypeDescriptionFilterSort
id
stringStable identifier for this aggregate row.–✓
project_id
indexed
stringProject ID from projects.✓–
prompt_id
stringPrompt ID.✓✓
text
stringTracked prompt text.✓✓
topic
nullable
stringPrompt topic.✓✓
category
stringPrompt category.
AWARENESS CONSIDERATION COMPARISON BRANDED TROUBLESHOOTING OTHER
✓✓
enabled
booleanWhether the prompt is enabled.✓✓
engine
stringAnswer engine.
CHATGPT GOOGLE_AIO
✓✓
run_at
datetimeLatest answer time.✓✓
mentions_brand
booleanWhether the answer mentions the project brand.✓✓
brand_position
nullable
integerDeprecated raw zero-based UTF-16 character offset; negative sentinels mean unknown, not answer rank.✓✓
brand_match_source
stringInferred from stored mention flag and text offset; not persisted matcher provenance.✓✓
first_mention_char_offset
nullable
integerZero-based UTF-16 character offset when the stored position is within answer text, otherwise null.✓✓
competitors_hit
string[]Competitor names found in the answer.✓–
sentiment
nullable
numberBrand sentiment from 0 to 100; null for an invalid or missing stored score.✓✓
ai_overview_missing
booleanWhether Google did not render an AI overview.✓✓
own_citations
integerVisible citation rows on the project brand domain.✓✓
competitor_citations
integerVisible citation rows on competitor domains.✓✓

Examples

Example
SELECT id, project_id, prompt_id, text, topic
FROM prompt_latest
WHERE project_id = $1
ORDER BY run_at DESC
LIMIT 25

Calling it

MCP

Tool call
query({"sql":"SELECT id, project_id, prompt_id, text, topic FROM prompt_latest WHERE project_id = $1 ORDER BY run_at DESC LIMIT 25","params":["<value 1>"]})

REST

curl
curl -X POST "https://app.sensorhub.ai/api/v1/query" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "sql": "SELECT id, project_id, prompt_id, text, topic FROM prompt_latest WHERE project_id = $1 ORDER BY run_at DESC LIMIT 25",
  "params": [
    "<value 1>"
  ]
}
JSON
Row JSON Schema
json
{
  "type": "object",
  "description": "Latest observed answer for each prompt and engine, with prompt metadata and citation counts. Equal run times are resolved by answer ID. Prompts that never ran have no row. For dashboard-identical headline numbers, anchored windows and deltas, use read report_visibility_overview.",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable identifier for this aggregate row.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": true
    },
    "project_id": {
      "type": "string",
      "description": "Project ID from projects.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": false
    },
    "prompt_id": {
      "type": "string",
      "description": "Prompt ID.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "text": {
      "type": "string",
      "description": "Tracked prompt text.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "topic": {
      "type": [
        "string",
        "null"
      ],
      "description": "Prompt topic.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "category": {
      "type": "string",
      "description": "Prompt category.",
      "enum": [
        "AWARENESS",
        "CONSIDERATION",
        "COMPARISON",
        "BRANDED",
        "TROUBLESHOOTING",
        "OTHER"
      ],
      "x-sensorhub-filter-operators": [
        "=",
        "!=",
        "<>",
        "IN",
        "NOT IN",
        "IS NULL",
        "IS NOT NULL"
      ],
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "enabled": {
      "type": "boolean",
      "description": "Whether the prompt is enabled.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "engine": {
      "type": "string",
      "description": "Answer engine.",
      "enum": [
        "CHATGPT",
        "GOOGLE_AIO"
      ],
      "x-sensorhub-filter-operators": [
        "=",
        "!=",
        "<>",
        "IN",
        "NOT IN",
        "IS NULL",
        "IS NOT NULL"
      ],
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "run_at": {
      "type": "string",
      "description": "Latest answer time.",
      "format": "date-time",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "mentions_brand": {
      "type": "boolean",
      "description": "Whether the answer mentions the project brand.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "brand_position": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Deprecated raw zero-based UTF-16 character offset; negative sentinels mean unknown, not answer rank.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "brand_match_source": {
      "type": "string",
      "description": "Inferred from stored mention flag and text offset; not persisted matcher provenance.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "first_mention_char_offset": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Zero-based UTF-16 character offset when the stored position is within answer text, otherwise null.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "competitors_hit": {
      "type": "array",
      "description": "Competitor names found in the answer.",
      "items": {
        "type": "string"
      },
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": false
    },
    "sentiment": {
      "type": [
        "number",
        "null"
      ],
      "description": "Brand sentiment from 0 to 100; null for an invalid or missing stored score.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "ai_overview_missing": {
      "type": "boolean",
      "description": "Whether Google did not render an AI overview.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "own_citations": {
      "type": "integer",
      "description": "Visible citation rows on the project brand domain.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "competitor_citations": {
      "type": "integer",
      "description": "Visible citation rows on competitor domains.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    }
  },
  "additionalProperties": false
}