Client
The Perplexity client is the main entry point for the library. Create one instance per session token and reuse it across conversations.
perplexity_webui_scraper.core.client.Perplexity
Perplexity(session_token: str, config: ClientConfig | None = None)
Web scraper client for Perplexity AI conversations.
The primary entry point. Create a single instance per session token and reuse it to share the underlying HTTP session and rate limiter.
Example
| PARAMETER | DESCRIPTION |
|---|---|
session_token
|
The
TYPE:
|
config
|
Optional client settings (timeouts, retries, logging).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If |
Source code in src/perplexity_webui_scraper/core/client.py
Functions
create_conversation
create_conversation(config: ConversationConfig | None = None) -> Conversation
Create and return a new :class:~perplexity_webui_scraper.Conversation.
| PARAMETER | DESCRIPTION |
|---|---|
config
|
Optional per-conversation settings. Defaults to
:class:
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Conversation
|
A new :class: |
Conversation
|
ready to receive queries. |