Sessions
Create Session
Creates a new browser session with optional configuration.
Method: client.sessions.create(params?: CreateSessionParams): SessionDetail
Endpoint: POST /api/session
Parameters:
CreateSessionParams
:use_stealth?: boolean
- Use stealth mode.use_proxy?: boolean
- Use proxy.proxy_server?: string
- Proxy server URL to route the session through.proxy_server_username?: string
- Username for proxy server authentication.proxy_server_password?: string
- Password for proxy server authentication.proxy_country?:
Country
- Desired proxy country.operating_systems?:
OperatingSystem
[]
- Preferred operating systems for the session. Possible values are:OperatingSystem.WINDOWS
OperatingSystem.ANDROID
OperatingSystem.MACOS
OperatingSystem.LINUX
OperatingSystem.IOS
device?: ("desktop" | "mobile")[]
- Preferred device types. Possible values are:"desktop"
"mobile"
platform?:
Platform
[]
- Preferred browser platforms. Possible values are:Platform.CHROME
Platform.FIREFOX
Platform.SAFARI
Platform.EDGE
locales?:
ISO639_1
[]
- Preferred locales (languages) for the session. Use ISO 639-1 codes.screen?:
ScreenConfig
- Screen configuration for the session.width: number
- Screen width.height: number
- Screen height.
solve_captchas?: boolean
- Solve captchas.adblock?: boolean
- Block ads.trackers?: boolean
- Block trackers.annoyances?: boolean
- Block annoyances.
Response: SessionDetail
Example:
Get Session Details
Retrieves details of a specific session.
Method: client.sessions.get(id: str): SessionDetail
Endpoint: GET /api/session/{id}
Parameters:
id: string
- Session ID
Response: SessionDetail
Example:
List Sessions
Retrieves a list of all sessions with optional filtering.
Method: client.sessions.list(params?: SessionListParams): SessionListResponse
Endpoint: GET /api/sessions
Parameters:
SessionListParams
:status?: "active" | "closed" | "error"
- Filter sessions by statuspage?: number
- Page number for pagination
Response: SessionListResponse
Example:
Stop Session
Stops a running session.
Method: client.sessions.stop(id: str): BasicResponse
Endpoint: PUT /api/session/{id}/stop
Parameters:
id: string
- Session ID
Response: BasicResponse
Example:
Get Session Recording
Get the recording of a session.
Method: client.sessions.get_recording(id: str): SessionRecording[]
Endpoint: GET /api/session/{id}/recording
Parameters:
id: string
- Session ID
Response: SessionRecording
[]
Example:
Types
SessionStatus
Country
OperatingSystem
Platform
ISO639_1
BasicResponse
Session
SessionDetail
SessionListResponse
ScreenConfig
CreateSessionParams
SessionRecording
Last updated