DocsAPIOverview

Platform API

The developer API of ResearchAnything. Send a research question with an API key and get back a written answer and the sources it rests on, either as one JSON response or as a stream of events while the run works.

01What the API is

The Platform API is served by ResearchAnything at researchanything.ai. A call runs the same research engine as the app: it works out what the question needs, searches the web and academic databases, reads and analyses the most useful sources, and writes an answer that cites them.

It uses your ResearchAnything account, and any account can use it. Sign up, open the API Console at researchanything.ai/console and create a key. There is no separate application or approval step for API access.

The API covers ResearchAnything's research engine only. It does not give access to Sourcipedia or Essarion Science.

NoteNew here? The Quickstart goes from a new account to a first answer.

02What you can do with it

Only the two query endpoints accept an API key. Keys, usage and run timelines are handled by the Console, which works from your signed-in browser session. See Authentication.

03Base URL and endpoints

BASEhttps://researchanything.ai

Every path below is relative to that host.

EndpointAuthPurpose
POST /api/queryAPI keyRun a query and return the finished answer as JSON.
POST /api/query/streamAPI keyRun a query and stream events while it works.
GET /api/console/keysSessionList your keys.
POST /api/console/keysSessionCreate a key.
DELETE /api/console/keys/{key_id}SessionRevoke a key.
GET /api/console/usageSessionCall totals, calls per day and recent calls.
GET /api/console/runs/{request_id}SessionThe timeline of a finished call.

The paths carry no version number. The app's own endpoints under /api/v1/ serve the ResearchAnything web client and are not part of this API; nearly all of them accept only the browser session.

04What a run uses

Every API call runs RA-Lite, the research model included on every plan, with sources chosen automatically: the open web, searched through Brave Search, and academic databases, mixed according to the kind of question asked.

Model, depth and source choice are not available through the API. RA-1, RA-2, Max and Auto, the depth modes, and a fixed Web or Papers source mode can be chosen in the app only. The request body is validated against a schema that also has model, depth_mode, source_mode, project_id and preferences fields, but the query endpoints ignore them. Send only query.

05Requests and responses

Send a JSON body with Content-Type: application/json. /api/query answers with application/json; /api/query/stream answers with text/event-stream.

cURL
curl https://researchanything.ai/api/query \
  -H "Authorization: Bearer $ESSARION_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "What is the half-life of caffeine in adults?"}'

A call holds the connection open until the run has finished. There is no job id to poll. Runs search and read before they write, so give your HTTP client a timeout of several minutes, or use the stream to show progress while you wait.

CORS is open on /api/query and /api/query/stream: any origin may call them, without cookies. That makes calls from a browser possible, but a key used in a browser can be read by whoever loads the page. Keep keys on a server; see Integration patterns.

06Limits

Each accepted call uses one research run from your plan's monthly allowance. It is the same allowance that runs started in the app draw on, and it resets each calendar month.

PlanResearch runs per month
Free3
Pro40
Researcher100

Once the allowance is used up, calls are refused with HTTP 429 and the error code quota_exceeded until the next month. A run is counted when the call is accepted, so a call whose run later fails still uses it. There is currently no separate per-minute or concurrency limit on the API. Plans and prices are at researchanything.ai/pricing.

The query field must be between 1 and 2,000 characters.

07Response envelope

Both query endpoints return the same envelope: as the JSON body of /api/query, and as the data of the final event on the stream.

FieldTypeDescription
request_idstringA UUID for this call. It identifies the run in the Console.
statusstringok when the run completed, error otherwise.
answerstring or nullThe answer in Markdown, citing sources inline with markers such as [S1]. null when status is error.
sourcesarrayThe sources the answer was written from, at most five. See Queries for their fields.
usageobjectlatency_ms, tokens_in and tokens_out. The token counts are estimates from text length, not model token counts.
errorsarray{ "code", "message" } objects. Empty on success.

A run that starts but does not complete still returns HTTP 200, with status: "error" and the reasons in errors. Check status, not only the HTTP code. See Errors.

Write clients that ignore fields they don't recognise. Source objects in particular carry more fields than these docs describe.

Can’t find what you need?

Write to us and a person will answer.