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.
02What you can do with it
- Run a query. Send a question and wait for the finished answer as JSON. See Queries.
- Stream a query. Send the same request and receive Server-Sent Events as the run works: its steps, the sources it finds and reads, its reasoning, then the answer. See Streaming.
- Look back at a run. Every call returns a
request_id. The Console shows each finished run's steps, reasoning and sources. See Run timelines. - Manage keys and see usage. Create and revoke keys, and see your call history, in the Console. See API keys and Usage.
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
Every path below is relative to that host.
| Endpoint | Auth | Purpose |
|---|---|---|
| POST /api/query | API key | Run a query and return the finished answer as JSON. |
| POST /api/query/stream | API key | Run a query and stream events while it works. |
| GET /api/console/keys | Session | List your keys. |
| POST /api/console/keys | Session | Create a key. |
| DELETE /api/console/keys/{key_id} | Session | Revoke a key. |
| GET /api/console/usage | Session | Call totals, calls per day and recent calls. |
| GET /api/console/runs/{request_id} | Session | The 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 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.
| Plan | Research runs per month |
|---|---|
| Free | 3 |
| Pro | 40 |
| Researcher | 100 |
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.
| Field | Type | Description |
|---|---|---|
| request_id | string | A UUID for this call. It identifies the run in the Console. |
| status | string | ok when the run completed, error otherwise. |
| answer | string or null | The answer in Markdown, citing sources inline with markers such as [S1]. null when status is error. |
| sources | array | The sources the answer was written from, at most five. See Queries for their fields. |
| usage | object | latency_ms, tokens_in and tokens_out. The token counts are estimates from text length, not model token counts. |
| errors | array | { "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.