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

ai_answers

CollectionLarge: filter on indexed fields

AI answers scoped through their prompt. Default projection omits raw text in Querifold 0.6.2. Select raw_answer explicitly for an excerpt; use get_item answer with rawOffset for continuation. Raw answer text is select-only and truncated to 2000 characters.

Max rows per query
100
Default order
id asc
Required filter
one of project_id, id, prompt_id
Max offset
2000
Cursor paging
by id

Use read report_* for dashboard headline metrics and anchored comparison windows.

Fields

FieldTypeDescriptionFilterSort
id
indexed
stringUnique row ID.✓✓
project_id
indexed
stringProject ID from projects.✓–
prompt_id
indexed
stringPrompt ID.✓✓
engine
indexed
stringAnswer engine.
CHATGPT GOOGLE_AIO
✓✓
run_at
indexed
datetimeCapture time.✓✓
run_week
indexed
datetimeIdempotency week.✓✓
mentions_brand
booleanWhether the project brand was mentioned.––
brand_match_source
stringInferred evidence, not persisted matcher provenance: answer_text_offset means a valid stored text offset, unverified_legacy means the historical hit has no valid offset, none means no hit.––
raw_answer_truncated
booleanWhether raw answer text exceeds this response excerpt. Use get_item resource answer with the returned ID for detail.––
brand_position
nullable
integerDeprecated: use avgFirstMentionCharOffset in reports. Stored zero-based UTF-16 character offset of first brand mention; negative values are unknown sentinels, not rank.––
competitors_hit
string[]Competitor names mentioned.––
sentiment
nullable
integerBrand sentiment from 0 to 100; null when unavailable.––
opportunity_score
nullable indexed
numberOpportunity score.✓✓
model_slug
nullable
stringModel identifier.––
starred
indexed
booleanWhether starred.✓✓
seen_at
nullable indexed
datetimeWhen last marked seen.✓✓
archived_at
nullable indexed
datetimeWhen archived.✓✓
raw_answer
nullable
stringPlain answer text, at most 2000 characters.––

Examples

Example
SELECT id, project_id, prompt_id, engine, run_at
FROM ai_answers
WHERE project_id = $1
ORDER BY id ASC
LIMIT 25

Calling it

MCP

Tool call
query({"sql":"SELECT id, project_id, prompt_id, engine, run_at FROM ai_answers WHERE project_id = $1 ORDER BY id ASC 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, engine, run_at FROM ai_answers WHERE project_id = $1 ORDER BY id ASC LIMIT 25",
  "params": [
    "<value 1>"
  ]
}
JSON
Row JSON Schema
json
{
  "type": "object",
  "description": "AI answers scoped through their prompt. Default projection omits raw text in Querifold 0.6.2. Select raw_answer explicitly for an excerpt; use get_item answer with rawOffset for continuation. Raw answer text is select-only and truncated to 2000 characters.",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique row ID.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "project_id": {
      "type": "string",
      "description": "Project ID from projects.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": false
    },
    "prompt_id": {
      "type": "string",
      "description": "Prompt ID.",
      "x-sensorhub-indexed": true,
      "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": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "run_at": {
      "type": "string",
      "description": "Capture time.",
      "format": "date-time",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "run_week": {
      "type": "string",
      "description": "Idempotency week.",
      "format": "date-time",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "mentions_brand": {
      "type": "boolean",
      "description": "Whether the project brand was mentioned.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "brand_match_source": {
      "type": "string",
      "description": "Inferred evidence, not persisted matcher provenance: answer_text_offset means a valid stored text offset, unverified_legacy means the historical hit has no valid offset, none means no hit.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "raw_answer_truncated": {
      "type": "boolean",
      "description": "Whether raw answer text exceeds this response excerpt. Use get_item resource answer with the returned ID for detail.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "brand_position": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Deprecated: use avgFirstMentionCharOffset in reports. Stored zero-based UTF-16 character offset of first brand mention; negative values are unknown sentinels, not rank.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "competitors_hit": {
      "type": "array",
      "description": "Competitor names mentioned.",
      "items": {
        "type": "string"
      },
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "sentiment": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Brand sentiment from 0 to 100; null when unavailable.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "opportunity_score": {
      "type": [
        "number",
        "null"
      ],
      "description": "Opportunity score.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "model_slug": {
      "type": [
        "string",
        "null"
      ],
      "description": "Model identifier.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    },
    "starred": {
      "type": "boolean",
      "description": "Whether starred.",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "seen_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "When last marked seen.",
      "format": "date-time",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "archived_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "When archived.",
      "format": "date-time",
      "x-sensorhub-indexed": true,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": true,
      "x-sensorhub-filterable": true,
      "x-sensorhub-sortable": true
    },
    "raw_answer": {
      "type": [
        "string",
        "null"
      ],
      "description": "Plain answer text, at most 2000 characters.",
      "x-sensorhub-indexed": false,
      "x-sensorhub-searchable": false,
      "x-sensorhub-aggregatable": false,
      "x-sensorhub-filterable": false,
      "x-sensorhub-sortable": false
    }
  },
  "additionalProperties": false
}