Interact
Drive the browser tab from a previous /api/v1/scrape call: click buttons, fill inputs, scroll, dismiss cookie banners, or run a small Playwright-style script — and get the updated page back.
How sessions work
Call
POST /api/v1/scrape first. The response includes a sessionId. Pass that sessionId to /api/v1/interact as many times as you need, then optionally /api/v1/interact/stop to release the tab early. Sessions auto-expire after roughly 10 minutes of inactivity — on 410 session_expired, scrape again to get a new sessionId.POST
/api/v1/scrape1. Get a sessionId
bash
curl https://neuroapi.me/api/v1/scrape \ -H "Authorization: Bearer $NEUROAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com" }'json
{ "success": true, "data": { "sessionId": "0a1b...d3.019e4f1f-6e75-7409-922f-051c62417159", "markdown": "...", "metadata": { "title": "Example Domain", "scrapeId": "019e4f..." } }, "creditsCharged": 1}POST
/api/v1/interact2. Interact with the page
| Field | Type | Description |
|---|---|---|
| sessionIdrequired | string | Returned by a previous POST /api/v1/scrape call. |
| prompt | string | Natural-language instruction (e.g. "click the Accept cookies button, then scroll to the bottom"). Use prompt OR code. |
| code | string | Playwright/Puppeteer-style script. Ignored if blank; prompt takes precedence when both are sent. |
| language | "node" | "python" | "bash" | Only used when code is provided. Default: node |
| timeout | number | Action timeout in milliseconds (1–120000). Converted to seconds for the upstream call. |
bash
curl https://neuroapi.me/api/v1/interact \ -H "Authorization: Bearer $NEUROAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "sessionId": "0a1b...d3.019e4f1f-6e75-7409-922f-051c62417159", "prompt": "Click the Browse Gallery link, wait for navigation, then return the updated page content.", "timeout": 30000 }'json
{ "success": true, "data": { "sessionId": "0a1b...d3.019e4f1f-6e75-7409-922f-051c62417159", "markdown": "... updated page markdown ...", "metadata": { "title": "Gallery — Example", "statusCode": 200 } }, "creditsCharged": 2}Script example (code)
bash
curl https://neuroapi.me/api/v1/interact \ -H "Authorization: Bearer $NEUROAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "sessionId": "0a1b...d3.019e4f1f...", "code": "await page.click(\"#accept-cookies\"); await page.waitForSelector(\".content\");", "language": "node", "timeout": 15000 }'POST
/api/v1/interact/stop3. (Optional) Release the session
Free. Best-effort — if the session has already expired you'll still get stopped: true.
bash
curl https://neuroapi.me/api/v1/interact/stop \ -H "Authorization: Bearer $NEUROAPI_KEY" \ -H "Content-Type: application/json" \ -d '{ "sessionId": "0a1b...d3.019e4f1f..." }'Errors
| Field | Type | Description |
|---|---|---|
| 400 bad_request | error | Missing/invalid sessionId, or neither prompt nor code provided. |
| 402 insufficient_credits | error | Top up credits and retry. |
| 403 forbidden | error | Session not found or not owned by the calling API key. |
| 410 session_expired | error | Session no longer exists. Call /api/v1/scrape again to get a fresh sessionId. |
Cost: 2 credits per /interact call. /interact/stop is free. Requires the scrape scope.