Skip to main content
With the SDK you launch a browser in Skyvern Cloud and get a Playwright page with AI methods added. Use selectors where you know the page, natural language where you don’t, and hand whole goals to the agent when a step needs judgment. Your code lives in your repo and runs wherever you deploy it. This page assumes you have an API key and the SDK installed. If not, start with the Quickstart. Every method and parameter is listed in the actions reference.
In Python, the browser and page methods need the local extra, which adds Playwright: pip install "skyvern[local]". You need it even when the browser runs in Skyvern Cloud. The TypeScript package (@skyvern/client) already includes Playwright.

Launch a browser

The snippets on this page run inside an async function; the worked example is a complete script.
  • launch_cloud_browser starts a new cloud session and logs a link to watch it live.
  • timeout: session length in minutes, from 5 to 240, default 60. Values above 240 are capped at 240.
  • proxy_location: route traffic through a proxy, for example "RESIDENTIAL" (US) or "RESIDENTIAL_GB". See Browsers for locations.
  • browser_profile_id (Python): start with a saved profile’s cookies and storage, so you skip the login.
  • browser.close() closes the browser and ends the cloud session. Always call it in finally.
To reuse a session instead of starting one:
All tabs in one browser share cookies, local storage and login state. Sessions, profiles and running your own Chrome are covered in Browsers. To run the browser on your own machine against a self-hosted server, see Self-host.

Use AI on the page

Four methods take natural language. act, extract and validate read the current page. prompt sends only your text to the model.
Use validate for yes/no checks. It returns a plain boolean. act performs one action per call; for a multi-step goal, make several calls or use page.agent.

Mix selectors and AI

The page is a full Playwright page, so goto, wait_for_selector, locator and the rest work as usual. click, fill and select_option also accept a prompt:
  • Selector only: fast and deterministic.
  • Prompt only: no selector; Skyvern finds the element.
  • Both: Skyvern tries the selector first and uses the prompt only if the selector fails. This is the safest choice for production.
A good rule: selectors for stable elements you control or have inspected, prompts for anything whose markup changes or differs between sites.

Extract structured data

Pass a JSON Schema to get the same shape every time. page.extract takes schema; page.agent.run_task and run_task take data_extraction_schema.
  • Write specific descriptions. They steer extraction more than anything else. “Price in USD, number only” beats “the price”.
  • Expect missing values. A field that isn’t on the page comes back null or absent. Handle it in your code.
  • Limit arrays. Without a limit, an array schema collects everything visible. Say “top 5” in the prompt.
  • Supported types are the standard ones: string, number, integer, boolean, array, object, nested as deep as you need.

Hand a goal to the agent

page.agent runs a full Skyvern agent inside your browser. Use it for multi-step goals, logins and downloads. Each call waits for the run to finish (30 minutes by default, set with timeout in seconds) and leaves the page where the agent stopped, so you can keep going with page methods.
login also works with Bitwarden ("bitwarden"), 1Password ("1password") and Azure Key Vault ("azure_vault"). Store credentials and set up 2FA in Credentials and 2FA. Agent calls return a run with status, output, failure_reason, downloaded_files and app_url. In TypeScript the fields are snake_case too (result.app_url). Check status before you use output; anything other than completed means the goal wasn’t met.

Download and upload files

page.agent.download_files finds and clicks the download for you, then returns the files as presigned URLs.
  • download_suffix sets the saved file name. Without an extension, Skyvern keeps the downloaded file’s ("statement-2026-09" becomes statement-2026-09.pdf). With an extension, it’s the full name. Don’t pass a bare extension like ".pdf"; that saves as .pdf.pdf. Without a suffix, files get a generated name like download-<timestamp>-<random>.pdf. To keep the name the site gave the file, use {{ original_filename }}, alone or with other text: "{{ fund }}_{{ original_filename }}" saves Fund A_Q4 Report.pdf. Use it as a plain placeholder, without filters.
  • download_timeout is a hint, in seconds, for how long to wait for the download to start. The overall timeout is what fails the call.
  • Each file has url (presigned, expires), filename, checksum (SHA-256), file_size and modified_at. Files stay in Skyvern’s storage; fetch the URL to save a copy, as the worked example does.
To upload a file into a form (Python only), pass a URL Skyvern can fetch. upload_file takes a selector, a prompt, or both:
In agents built in Studio, the File Download and File Parser blocks do the same jobs; see the blocks reference.

Tabs and frames

Every tab in the browser shares the same login state.
For content inside an iframe, switch the page into the frame (Python). Later actions on that page, AI and selector alike, run inside the frame until you switch back:
In TypeScript, use Playwright’s frame APIs (page.frameLocator) for selector work inside iframes.

Run tasks and agents from code

You don’t need to hold a browser to use Skyvern from code. The client methods start a run on a fresh cloud browser and, with wait_for_completion, return when it ends:
Use page.agent.* when the run must start from a browser you prepared, for example after your own login or setup. Use the client methods when the run can start fresh. For webhooks instead of waiting, retries and error handling, see Going to production.

Replay agents as cached code

After an agent run succeeds, Skyvern can generate code from the actions it took. Later runs can execute that code directly instead of asking the model at each step, which makes them faster and cheaper.
  • In Studio, open the agent’s Start block settings and set Run With to Code. Skyvern Agent always uses the model.
  • AI Fallback (cached scripts) is on by default: if the cached code fails, for example because the page changed, Skyvern falls back to the agent and regenerates the code.
  • From code, override the setting for one run with run_with:
Accepted values are "agent" and "code"; leave it out to use the agent’s setting. Cached code pairs well with schedules: the first successful run produces the code and later runs reuse it.

Worked example: download invoices from a vendor portal

This script logs in to a vendor portal with a stored credential, filters the order history by date, extracts the orders, downloads each invoice PDF and saves it locally. It uses selectors where the portal is predictable and AI where it isn’t. Before you run it:
  1. Store the portal login in Skyvern and copy its cred_... ID (Credentials and 2FA).
  2. Replace PORTAL_URL with your portal’s login page.
Run it with python download_invoices.py or npx tsx download_invoices.ts. Each page.agent call returns an app_url. Open it for an order that failed to see the recording and every step the agent took. To run this every month without your own server, build the same steps as an agent in Studio with Login, Extraction, Loop and File Download blocks, and put it on a schedule.

More examples

The same building blocks cover most portal work:
  • Data behind a login, many pages deep (for example a records portal): log in once, save a browser profile so later runs skip the login, use a residential proxy_location for sites that block data-center traffic, and loop extract plus a “next page” click until validate("There is no next page") is true.
  • Filling application forms: fill and select_option with prompts handle forms that differ from site to site, and upload_file attaches a resume or document. For job applications, the Job Apps recipe in the app already does this end to end.
  • Recurring downloads and reports: the worked example above, moved into an agent in Studio with cached code and a schedule.

Next

Actions reference

Every page and agent method, with parameters and return types.

Browsers

Sessions, profiles, proxies and connecting your own Chrome.

Going to production

Webhooks, retries, error handling and cost control.