Skip to content
English

Your first API call

The REST API connects Sentir to your own systems: your clients’ dashboard, a portal, an internal tool that starts searches. It does what the MCP server does, with the same keys, scopes and token caps. The other ways to connect Sentir are under Integrations.

  • An account on the Agency plan or above.
  • An access key. You make it under AI & MCP, at the end of the page: how to make one. To start searches, tick Can start searches and set its token cap per call.

The base address is https://sentirsocial.com/api/v1. Every answer is JSON.

  1. Keep the key in an environment variable. Never put it in code or in a web page.

    Ventana de terminal
    export SENTIR_KEY="sntr_…"
  2. Check that it works. GET /me says which account the key belongs to, its scopes and its cap.

    Ventana de terminal
    curl "https://sentirsocial.com/api/v1/me" -H "Authorization: Bearer $SENTIR_KEY"
    { "data": { "email": "ana@example.com", "account": "Example Agency", "role": "owner", "scopes": ["read", "write"], "maxTokensPerCall": 10, "via": "token" } }
  3. Ask what it would cost. POST /searches/estimate starts nothing and spends no tokens.

    Ventana de terminal
    curl -X POST "https://sentirsocial.com/api/v1/searches/estimate" \
    -H "Authorization: Bearer $SENTIR_KEY" -H "Content-Type: application/json" \
    -d '{"keyword":"Telcel","focus":"How people feel about the service and its prices","platforms":["x","facebook"],"dateFrom":"2026-11-01","dateTo":"2026-11-07","maxTokens":5}'
  4. Start the search. With the same fields, POST /searches starts it and answers at once with its id. This call does spend tokens: it holds maxTokens and charges what it reads; the rest comes back.

    Ventana de terminal
    curl -X POST "https://sentirsocial.com/api/v1/searches" \
    -H "Authorization: Bearer $SENTIR_KEY" -H "Content-Type: application/json" \
    -d '{"keyword":"Telcel","focus":"How people feel about the service and its prices","platforms":["x","facebook"],"dateFrom":"2026-11-01","dateTo":"2026-11-07","maxTokens":5}'
    { "data": { "id": "0b6f3b1e-4c1d-4b7a-9a43-1d2f3a4b5c6d", "url": "https://sentirsocial.com/en/search/0b6f3b1e-…", "tokensHeld": 5, "status": "queued" } }
  5. Wait for it to finish. A search takes minutes. A webhook is best: Sentir tells you with search.finished. Otherwise ask GET /searches/{id} every 30 seconds until status is done.

  6. Read the report. GET /searches/{id}/report brings the report as markdown and as an object with its numbers.

    Ventana de terminal
    curl "https://sentirsocial.com/api/v1/searches/0b6f3b1e-4c1d-4b7a-9a43-1d2f3a4b5c6d/report" -H "Authorization: Bearer $SENTIR_KEY"
  • Reference: every route, with examples in curl, JavaScript and Python.
  • Webhooks: get told when a search finishes.
  • Limits and errors: 60 calls a minute, the error codes and the versions.

Accessibility