Save a login
Get an API key in the Quickstart. Open a session withprofile.name. If no profile has that name, one is created.
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. SendsaveChanges: false to use the profile without changing it, for a read-only visit.
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:
profile field with the same names, so a login you save in a session also works there. See Scrape.
Manage profiles
name and when it was lastUsedAt. This real list came after a rename.
{ "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 sendsaveChanges: false. - A profile too large to save returns
413 profileTooLarge. - Creating a name that exists returns
409 invalidRequestwithA browser profile with that name already exists.Renaming to a taken name, or while a session saves to the profile, returns409 invalidRequesttoo. - A name that does not exist returns
404 notFoundwithNo browser profile with that name. profilewithzeroDataRetentionreturns400 invalidRequest:zeroDataRetention keeps nothing from the session, and a profile keeps its cookies. Send one of them.
Related
- Browser sessions opens and closes the session that saves the profile.
- Network location explains the country a profile keeps.
- Extensions adds a Chrome extension to a session.
- Profile reference lists every field.