Skip to main content
A profile keeps a session’s cookies and local storage under a name. Open a session with that name and it starts where the last one stopped, signed in. A profile is saved when the session closes.

Save a login

Get an API key in the Quickstart. Open a session with profile.name. If no profile has that name, one is created.
Sign in the way you normally would: run code that fills the form, or drive the session over CDP. This example sets a cookie, which is what a login leaves behind.
The real answer had result set to {"cookies": {"session": "abc123"}}. Now close the session. The profile is saved as the session closes, so close it before you open another session with the same profile.

Read the profile

GET /v1/browser/profiles/{name} shows what the profile holds. It is free.
cookies counts the saved cookies. origins counts the sites with saved local storage.

Reuse the profile

Open a session with the same name. Send saveChanges: false to use the profile without changing it, for a read-only visit.
Code that reads the cookies returned the same value in the new session.
The real result was {"cookies": {"session": "abc123"}}. The profile stays logged in across sessions, and saveChanges: false left it as it was. A profile keeps the country it first used. Send location.country with a profile that already has one, and the session opens anyway, in the profile’s country, with a warning. This real session asked for DE:
See Network location. A scrape and a batch take the same profile field with the same names, so a login you save in a session also works there. See Scrape.

Manage profiles

A new profile is empty.
The list holds each profile’s name and when it was lastUsedAt. This real list came after a rename.
A rename answers with the profile under its new name. A delete answers { "success": true } and the profile is gone, with its cookies. A profile is also removed 30 days after it was last used.

Options

Limits and errors

  • Only one session at a time can save to a profile. A second one returns 409 profileBusy, which is retryable. Wait for the first to close, or send saveChanges: false.
  • A profile too large to save returns 413 profileTooLarge.
  • Creating a name that exists returns 409 invalidRequest with A browser profile with that name already exists. Renaming to a taken name, or while a session saves to the profile, returns 409 invalidRequest too.
  • A name that does not exist returns 404 notFound with No browser profile with that name.
  • profile with zeroDataRetention returns 400 invalidRequest: zeroDataRetention keeps nothing from the session, and a profile keeps its cookies. Send one of them.