Skip to main content

API Reference

Complete API reference for Vartovii.

Base URL: https://sentryanalytic.com

Authentication

Most endpoints are public. Agent tool endpoints require API key:

curl -H "X-API-Key: your-api-key" https://sentryanalytic.com/api/agent/...

Company Endpoints

Search Companies

GET /api/company/search?q=QUERY

Parameters:

NameTypeRequiredDescription
qstringYesSearch query
limitintNoMax results (default: 10)

Response:

{
"companies": [
{
"company_name": "BMW",
"company_slug": "bmw",
"trust_score": 74,
"review_count": 5621
}
]
}

Get Company Details

GET /api/company/SLUG

Response:

{
"company_name": "BMW",
"company_slug": "bmw",
"trust_score": 74,
"risk_level": "MEDIUM",
"avg_rating": 3.97,
"review_count": 5621,
"sentiment": {
"positive": 50,
"negative": 40,
"neutral": 10
},
"data_freshness": "fresh",
"last_updated": "2025-12-27"
}

GET /api/search/smart?q=QUERY&auto_scrape=true

Parameters:

NameTypeDefaultDescription
qstringrequiredCompany name
countrystring"de"Country code
auto_scrapebooltrueAuto-trigger scraping

Response:

{
"status": "found",
"company_name": "BMW",
"company_slug": "bmw",
"data_status": "fresh",
"review_count": 5621,
"scraping_jobs": []
}

Notes:

  • In cloud mode, newly created scraping jobs are dispatched to workers immediately after creation.
  • Clients should use company_slug for canonical routing when present, while still treating company_name as the display label.

AI Chat Endpoints

Chat with AI

POST /api/ai/chat

Request:

{
"message": "What's the Trust Score for BMW?",
"conversation_id": "cw_abcd1234",
"language": "auto",
"enable_grounding": false,
"enable_rag": true
}

Response:

{
"response": "BMW has a Trust Score of 74/100...",
"status": "ok",
"grounded": false,
"rag_used": true,
"tools_used": true,
"execution": {
"status": "ok",
"grounded": false,
"rag_used": true,
"tools_used": true,
"adk_agent": true,
"adk_tools": ["search_company", "get_trust_score"],
"adk_session_id": "s_ab12cd34ef56",
"conversation_id": "cw_abcd1234",
"sources_count": 0
},
"message_id": "uuid-message-id"
}

Notes:

  • conversation_id should be reused by clients across turns to preserve ADK session continuity.
  • execution.adk_tools is the canonical tool trace payload for UI message timelines and analytics.
  • Attachments (optional) are validated server-side with guardrails:
    • allowed MIME types via CHAT_ALLOWED_MIME_TYPES
    • max files via CHAT_MAX_ATTACHMENTS (default: 4)
    • per-file size via CHAT_MAX_ATTACHMENT_BYTES (default: 5MB)
    • total payload via CHAT_MAX_TOTAL_ATTACHMENT_BYTES (default: 10MB)

Health Check

GET /api/ai/chat/health

Response:

{
"status": "operational",
"model": "gemini-2.5-flash",
"grounding_enabled": true,
"rag_enabled": true
}

Public API Endpoints

Public Company Trust Score

GET /api/v1/trust-score/{company}

Notes:

  • Includes last_updated and data_freshness
  • Successful responses expose public rate-limit headers
  • Error payloads use the canonical error.code / error.message / error.status schema

Public Crypto Trust Score

GET /api/v1/crypto/{slug}

Notes:

  • Includes last_updated and data_freshness
  • Successful responses expose public rate-limit headers
  • Error payloads use the canonical error.code / error.message / error.status schema
GET /api/v1/search?q=QUERY&type=all&limit=5&sort_by=trust_score&sort_order=desc

Notes:

  • Cursor-based pagination via the opaque cursor parameter
  • Per-result freshness plus response-level freshness block
  • Stable nested pagination and freshness response objects
  • Error payloads use the canonical error.code / error.message / error.status schema
  • Language examples live in Public API (v1)

Agent Tool Endpoints

⚠️ Requires API Key: X-API-Key header

Search Company

POST /api/agent/search-company

Request:

{
"company_name": "BMW",
"country": "de"
}

Get Trust Score

POST /api/agent/trust-score

Request:

{
"company_name": "BMW"
}

Response:

{
"company_name": "BMW",
"trust_score": 74,
"risk_level": "MEDIUM",
"breakdown": {
"rating_quality": 22.2,
"sentiment": 12.5,
"volume": 20.0,
"consistency": 9.0,
"recency": 10.0
}
}

List Companies

POST /api/agent/list-companies

Request:

{
"country": "de",
"limit": 10,
"sort_by": "trust_score"
}

Notes:

  • sort_by: "trust_score" uses canonical 6-factor Trust Score per company and is ranked after runtime score computation (not SQL proxy formulas).

Compare Companies

POST /api/agent/compare-companies

Request:

{
"company1": "BMW",
"company2": "Audi"
}

Run Analysis

POST /api/agent/run-analysis

Request:

{
"company_name": "Spotify",
"country": "de"
}

Response:

{
"action": "analysis_started",
"company_name": "Spotify",
"company_slug": "spotify-ab1",
"scraping_jobs": ["uuid1", "uuid2", "uuid3", "uuid4"],
"message": "🚀 Analysis started!"
}

Get Company Reviews

POST /api/agent/get-reviews

Request:

{
"company_name": "BMW",
"sentiment": "positive",
"limit": 5
}

Scraping Endpoints

POST /api/scraping/magic-search

Request:

{
"company_name": "Spotify",
"country": "de",
"months_back": 24
}

Get Job Status

GET /api/scraping/jobs/JOB_ID

Response:

{
"job_id": "uuid",
"status": "running",
"source": "kununu",
"company_name": "Spotify",
"reviews_collected": 156,
"progress_percent": 78
}

List All Jobs

GET /api/scraping/jobs

List Active Jobs

GET /api/scraping/jobs/active

Job Control

POST /api/scraping/jobs/{job_id}/pause
POST /api/scraping/jobs/{job_id}/resume
POST /api/scraping/jobs/{job_id}/cancel

These control endpoints share one repository-backed job-status contract across the scraping API and legacy compatibility helpers.

Trigger Worker (Protected)

POST /api/scraping/trigger-worker

Auth required: X-Internal-Key or X-Admin-Token Rate limit: 5/minute


Analytics Endpoints

Get Company Stats

GET /api/stats?company=BMW

Response (excerpt):

{
"total_reviews": 5621,
"avg_rating": 3.97,
"sentiment_coverage": 96.4,
"recent_reviews": 312,
"trust_score": 74,
"score_breakdown": {
"rating_quality": 19,
"sentiment": 14,
"volume": 15,
"source_diversity": 15,
"consistency": 7,
"recency": 4
}
}

Sentiment Distribution

GET /api/sentiment-distribution?company=BMW

Response:

{
"distribution": [
{"label": "POSITIVE", "count": 2810},
{"label": "NEGATIVE", "count": 1960},
{"label": "NEUTRAL", "count": 851}
]
}

Rating Distribution

GET /api/rating-distribution?company=BMW

Get Reviews

GET /api/reviews?company=BMW&limit=50

Get Aspects (ABSA)

GET /api/aspects?company=BMW

Response:

{
"aspects": [
{"name": "Work-Life Balance", "positive": 120, "negative": 45},
{"name": "Salary", "positive": 80, "negative": 90}
]
}

Get Vacancies

GET /api/vacancies?company=BMW

Timeline

GET /api/timeline?company=BMW

Notes:

  • company is resolved to canonical entity identity before querying.
  • Filtering uses exact match (LOWER(company_name) = LOWER(%s)).
  • Unresolved company identifiers return {"timeline": []}.

Reports Endpoints

Generate Report

Trigger AI analysis for a company and save results to database.

POST /api/analyze/{company_slug}

Response:

{
"status": "success",
"company": "BMW",
"analysis": {
"EXECUTIVE SUMMARY": "BMW shows strong employee satisfaction...",
"STRENGTHS": "Work-life balance, career growth opportunities...",
"CONCERNS": "Management communication, workload in some departments...",
"RECOMMENDATIONS": "Focus on improving internal communication..."
}
}

Notes:

  • Analysis resolves the slug/input to the canonical reviews.company_name before fetching AI source data
  • Frontend clients should refresh report data immediately after a successful response; a fixed wait is not required
  • Results cached in company_reports table
  • Re-triggering overwrites previous analysis
  • Auth required: X-Internal-Key or X-Admin-Token

Get Report

GET /api/reports/{company_name}

Response (excerpt):

{
"company_name": "BMW",
"trust_score": 74,
"report_status": "cached",
"stats": {
"avg_rating": 3.9,
"total_reviews": 5621
}
}

Download PDF Report

GET /api/reports/download/{company_name}

Response: PDF file download Headers: X-Report-Status (ok, quality-degraded, no-data, fallback), X-Topics-Status (ok, empty, unavailable)

Topic fallback behavior: synthetic placeholder topics are not injected when topic query fails; status is surfaced via X-Topics-Status.


Crypto Endpoints

Search Crypto Projects

GET /api/v2/crypto/search?q=QUERY

Get Crypto Project

GET /api/v2/crypto/project/SLUG

Response:

{
"name": "Polkadot",
"symbol": "DOT",
"trust_score": 81,
"risk_level": "LOW",
"price_usd": 7.25,
"market_cap": 9500000000,
"tvl": 1200000000
}

Error Responses

All endpoints return errors in this format:

{
"detail": "Company not found",
"status_code": 404
}

Common Status Codes:

CodeMeaning
200Success
400Bad request
401Unauthorized (missing API key)
404Not found
429Rate limited
500Server error

Protected Write Endpoints (Internal/Admin)

These heavy write endpoints require X-Internal-Key or X-Admin-Token:

  • POST /api/analyze/{company_slug}
  • POST /api/analytics/analyze/{company_slug}
  • POST /api/ai/run-analysis
  • POST /api/crypto/refresh/{slug}
  • POST /api/scraping/trigger-worker

API documentation is also available at /docs (Swagger UI).

Forensic Agent Endpoints

⚠️ Available via AI Chat or Agent Tools - These endpoints power the Forensic Agent

Check Wallet Balance

POST /api/forensic/check_wallet

Request:

{
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}

Validation rules (2026-03-04):

  • Must match 0x + 40 hex chars.
  • Mixed-case addresses must pass EIP-55 checksum validation.
  • Invalid format/checksum returns 422.

Response:

{
"address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"eth_balance": 32.1112,
"usd_value": 94241.62,
"eth_price": 2934.2,
"token_balances": [
{
"contract_address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"symbol": "USDC",
"name": "USD Coin",
"decimals": 6,
"balance": 2500.0,
"balance_raw": 2500000000.0,
"token_price_usd": 1.0,
"usd_value": 2500.0
}
],
"found": true,
"chain": "ethereum"
}

Get Transaction History

POST /api/forensic/transaction_history

Request:

{
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"limit": 10,
"days": 30
}

Response:

{
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"transactions": [
{
"tx_hash": "0x123...",
"from": "0xabc...",
"to": "0xd8dA...",
"eth_value": 2.5,
"gas_price_gwei": 12.4,
"status": "success",
"timestamp": "2026-01-20T10:30:00Z",
"direction": "in"
}
],
"count": 5
}

Error contract:

  • On forensic backend/query failures, endpoint returns HTTP 503 with stable error detail (no list-wrapped error payloads).

Get Token Holders

POST /api/forensic/token_holders

Request:

{
"contract_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"limit": 20
}

Response:

{
"contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"holders": [
{
"rank": 1,
"address": "0xf977814e90da44bfa03b6295a0616a897441acec",
"balance": 21951179974.29,
"balance_raw": 21951179974290000,
"usd_value": 21907277614.34
}
],
"count": 20,
"total_balance": 118490426863.74,
"decimals": 6,
"token_price_usd": 0.998,
"total_usd_value": 118253446010.01
}

Get Contract Info

POST /api/forensic/contract_info

Request:

{
"contract_address": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
}

Response:

{
"address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"found": true,
"is_erc20": true,
"is_erc721": false,
"deployed_at": "2017-11-28T00:41:21+00:00",
"has_bytecode": true,
"is_verified_source": true,
"verification_source": "etherscan",
"verification_url": "https://etherscan.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7#code",
"contract_name": "Tether USD"
}

Health Check

GET /api/forensic/health

Response:

{
"status": "healthy",
"bigquery_available": true,
"coingecko_available": true
}

Live Endpoint Inventory (Auto-generated)

Source: synchronized from backend OpenAPI via scripts/sync_api_endpoints_doc.py

Base URL: https://sentryanalytic.com

CategoryMethodPath
AIPOST/api/ai/chat
AIGET/api/ai/chat/health
AIPOST/api/ai/feedback
AIPOST/api/ai/run-analysis
AIPOST/api/ai/search
AdminPOST/api/admin/alerts/process-score-changes
AdminGET/api/admin/companies
AdminDELETE/api/admin/company/{company_slug}
AdminGET/api/admin/data-quality
AdminGET/api/admin/db-health
AdminGET/api/admin/farcaster/generate
AdminGET/api/admin/feedback
AdminPOST/api/admin/feedback/classify-all
AdminGET/api/admin/feedback/stats
AdminPATCH/api/admin/feedback/{feedback_id}
AdminPOST/api/admin/feedback/{feedback_id}/classify
AdminGET/api/admin/init-database
AdminPOST/api/admin/init-database
AdminPOST/api/admin/knowledge/create
AdminGET/api/admin/knowledge/learnings
AdminPOST/api/admin/knowledge/sync
AdminGET/api/admin/marketing/content-types
AdminPOST/api/admin/marketing/generate
AdminPOST/api/admin/marketing/trigger
AdminGET/api/admin/marketing/version
AdminPOST/api/admin/merge-companies
AdminPOST/api/admin/refresh-views
AdminDELETE/api/admin/review/{review_id}
AdminPOST/api/admin/run-absa
AdminGET/api/admin/telemetry/events
Agent ToolsPOST/api/agent/get-trust-score
Agent ToolsGET/api/agent/health
Agent ToolsPOST/api/agent/list-companies
Agent ToolsPOST/api/agent/search-company
AlertsGET/api/alerts/health
AlertsPOST/api/alerts/subscribe
AlertsGET/api/alerts/subscriptions
AlertsPOST/api/alerts/test
AlertsPOST/api/alerts/unsubscribe
AlertsDELETE/api/alerts/watchlist
AlertsGET/api/alerts/watchlist
AlertsPATCH/api/alerts/watchlist
AlertsPOST/api/alerts/watchlist
AnalyticsPOST/api/analyze/{company_slug}
AnalyticsGET/api/aspects
AnalyticsGET/api/companies
AnalyticsGET/api/market-pulse
AnalyticsGET/api/rating-distribution
AnalyticsGET/api/reviews
AnalyticsGET/api/sentiment-distribution
AnalyticsGET/api/stats
AnalyticsGET/api/vacancies
CorporatePOST/api/analytics/analyze/{company_slug}
CorporateGET/api/corporate/overview
CorporateGET/api/corporate/trust-score-details/{company_name}
CorporateGET/api/corporate/vacancy-intelligence/{company_slug}
CorporateGET/api/employer/{company_name}/trust-score
CorporateGET/api/glassdoor/{company_name}
CorporateGET/api/google-reviews/{company_name}
CorporateGET/api/search/companies
CorporateGET/api/search/smart
CorporateGET/api/timeline
CryptoGET/api/crypto/chart/{slug}
CryptoGET/api/crypto/health
CryptoGET/api/crypto/live/{slug}
CryptoGET/api/crypto/project/{slug}
CryptoPOST/api/crypto/refresh/{slug}
CryptoGET/api/crypto/report/{slug}
CryptoGET/api/crypto/search
CryptoGET/api/crypto/top
CryptoGET/api/crypto/whales/alerts
FarcasterGET/.well-known/farcaster.json
FarcasterGET/api/farcaster/contract/{address}
FarcasterPOST/api/farcaster/events
FarcasterGET/api/farcaster/frame
FarcasterPOST/api/farcaster/frame/check
ForensicPOST/api/forensic/check_wallet
ForensicPOST/api/forensic/contract_info
ForensicGET/api/forensic/health
ForensicPOST/api/forensic/token_holders
ForensicPOST/api/forensic/transaction_history
Legacy CompatibilityGET/api/v2/crypto/health
OtherGET/api/runtime/metadata
OtherPOST/api/telemetry/events
Public API v1GET/api/v1/crypto/{slug}
Public API v1GET/api/v1/health
Public API v1GET/api/v1/search
Public API v1GET/api/v1/trust-score/{company}
ReportsGET/api/reports/download/{company_name}
ReportsGET/api/reports/{company_name}
ScrapingPOST/api/scraping/find-slug
ScrapingGET/api/scraping/jobs
ScrapingGET/api/scraping/jobs/active
ScrapingGET/api/scraping/jobs/{job_id}
ScrapingPOST/api/scraping/jobs/{job_id}/cancel
ScrapingPOST/api/scraping/jobs/{job_id}/pause
ScrapingPOST/api/scraping/jobs/{job_id}/resume
ScrapingPOST/api/scraping/magic-search
ScrapingGET/api/scraping/progress/{company_slug}
ScrapingPOST/api/scraping/start
ScrapingGET/api/scraping/stats
ScrapingPOST/api/scraping/trigger-worker
SystemGET/health

Notes

  • This block is generated by scripts/sync_api_endpoints_doc.py.
  • Alert endpoints may be loaded via fallback parsing when optional runtime dependencies are missing locally.
  • Public API v1 endpoints may be loaded via fallback parsing when rate-limiter dependencies are unavailable.
  • Crypto endpoints may be loaded via fallback parsing when crypto router runtime deps are unavailable.
  • For request/response schemas, use live OpenAPI at /docs and /openapi.json.