Skip to main content
A browser session can take files in and hand files out. Upload a file for a page’s file field to use, and list what the page downloaded. Both calls are free, and both need a session that is still running.

Upload a file

POST /v1/browser/{session_id}/uploads puts a file in the session under the name you give it. Send the bytes as base64, or send a url for Stophy to fetch.
To have Stophy fetch the file, send url instead of base64. name is optional then, and defaults to the last part of the address.
That upload answered with size 30. The address must open the file with no sign-in, and Stophy waits 30 seconds for it.

Use the file on a page

Point a file field at the uploaded name. This call opens an upload form, picks notes.txt, submits, and returns the name the page shows.
Send it to Execute. The real answer had result set to notes.txt, so the page took the file. A running session lists its uploads in uploads when you read it.

Read downloads

A file the page downloads is saved in the session. GET /v1/browser/{session_id}/downloads lists them, sorted by name. Add includeUrls=true to get a link for each file.
This real session downloaded one file after a click on a link with a download name. The signature is cut.
The link needs no API key, so you can hand it to a browser or a download tool. It answered 200 with text/plain and the body Hello from Stophy. It stops working after 15 minutes. Read the list again for a new link.

Options

Limits and errors

  • A file is at most 20 MB, and a session takes at most 100 MB of uploads. A larger file returns 400 invalidRequest with A file can be at most 20 MB.
  • Sending both base64 and url returns 400 invalidRequest with Send base64 or url, not both. Sending neither, or base64 with no name, returns 400 invalidRequest with Send the file as base64 with a name, or as a url.
  • A url that does not answer with a success status returns 400 invalidRequest. This real one pointed at a missing file: The file address answered 404. Send an address that opens the file without signing in.
  • A session that has ended answers 410 notFound to an upload, and 409 invalidRequest to a download list: This browser session is not running, and its files are removed when it closes.
  • Downloads and uploads are removed when the session closes. Fetch what you need first.