Docs
Dashboard
API reference / BasicsBeta

Start here

The eight calls most things start with, each as the smallest request that works: fetch a page, search, start a session, drive its browser, run a command, read a file, stop it, or hand the job to an AI.

Eight calls do most of the work. Each one below is the smallest request that works, in curl, Node and Python (and the CLI where it has a command). The first two need no machine at all. The next five use one session: a machine with a browser, a shell, or both, and a disk they share. The last hands the whole job to an AI.

Base URLhttps://api.boxline.dev
API keyCreate one in the console, and send it as x-api-key. The examples read it from $BOXLINE_API_KEY.
SDKs@boxline/sdk for Node, boxline-sdk for Python. Both read BOXLINE_API_KEY too.

1. Fetch a page

POST/v1/fetch

A page as Markdown. No machine to start or stop.

curl -X POST "https://api.boxline.dev/v1/fetch" \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{"url": "https://example.com"}'

2. Search the web

POST/v1/search

Search results. Add fetch: true for each page's text too.

curl -X POST "https://api.boxline.dev/v1/search" \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{"query": "best trail running shoes"}'

3. Create a session

POST/v1/sessions

A machine with a browser. {"shell": true} adds a shell to it, and {"browser": false, "shell": true} makes a shell only.

curl -X POST "https://api.boxline.dev/v1/sessions" \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{}'

4. Run browser actions

POST/v1/sessions/{id}/browser/actions

Drive the browser with steps, plain English included. Or connect Playwright to the session's connectUrl.

curl -X POST "https://api.boxline.dev/v1/sessions/$SESSION_ID/browser/actions" \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{    "actions": [      {"action": "goto", "url": "https://example.com"},      "click the Sign in link"    ]  }'

5. Run a command

POST/v1/sessions/{id}/shell/exec

Run a command in a persistent bash: cd and export carry over to the next command.

curl -X POST "https://api.boxline.dev/v1/sessions/$SESSION_ID/shell/exec" \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{"command": "python3 -V"}'

6. Read a file or list a folder

GET/v1/sessions/{id}/files

Read what the shell wrote or the browser downloaded, even after the session stops.

curl -G "https://api.boxline.dev/v1/sessions/$SESSION_ID/files" \  -H "x-api-key: $BOXLINE_API_KEY" \  --data-urlencode "path=report.csv" \  -o report.csv# A folder listing instead: add --data-urlencode "list=1"

7. Stop a session

POST/v1/sessions/{id}/stop

Save everything and stop paying. Resume brings the session back as it was.

curl -X POST "https://api.boxline.dev/v1/sessions/$SESSION_ID/stop" \  -H "x-api-key: $BOXLINE_API_KEY"

8. Start a run

POST/v1/agent/runs

Or hand the whole job to an AI, which uses the same calls.

curl -X POST "https://api.boxline.dev/v1/agent/runs" \  -H "x-api-key: $BOXLINE_API_KEY" \  -H "content-type: application/json" \  -d '{"task": "Find three laptops under $800 with 16 GB of RAM"}'

Where to go next

These docs describe a beta API. Endpoints, fields and SDK methods may change before general availability; breaking changes will be listed in the changelog.