Skip to content

Response Models

Data models returned by the library when querying Perplexity.

Response

perplexity_webui_scraper.core.response.Response

Bases: BaseModel

A single streaming response frame from Perplexity AI.

Yielded by iterating over a :class:~perplexity_webui_scraper.Conversation in streaming mode. The answer field is None on intermediate chunks and populated only on the final frame.

ATTRIBUTE DESCRIPTION
answer

Full, final response text. None until the stream completes.

TYPE: str | None

chunks

All partial response chunks received so far during streaming.

TYPE: list[str]

last_chunk

The most recently received chunk (shortcut to chunks[-1]). None if no chunks have arrived yet.

TYPE: str | None

search_results

Web sources cited in the response.

TYPE: list[SearchResultItem]

conversation_uuid

Backend UUID identifying this conversation thread. Use this value to continue the conversation via thread_uuid in the API, or for your own bookkeeping.

TYPE: str | None

raw_data

Raw deserialized JSON payload from the last SSE frame. Useful for accessing fields not surfaced by the library.

TYPE: dict[str, Any]


SearchResultItem

perplexity_webui_scraper.core.response.SearchResultItem

Bases: BaseModel

A single web source cited in a Perplexity response.

ATTRIBUTE DESCRIPTION
url

Full URL of the source page. None if unavailable.

TYPE: str | None

title

Page or article title. None if unavailable.

TYPE: str | None

snippet

Short excerpt from the source page. None if unavailable.

TYPE: str | None


Coordinates

perplexity_webui_scraper._internal.types.Coordinates

Bases: BaseModel

Geographic coordinates for location-aware Perplexity search results.

ATTRIBUTE DESCRIPTION
latitude

Latitude in decimal degrees (-90 to +90).

TYPE: float

longitude

Longitude in decimal degrees (-180 to +180).

TYPE: float