Skip to content

Types & Aliases

Public type aliases used across the library. All are re-exported from the top-level perplexity_webui_scraper namespace.

CitationMode

perplexity_webui_scraper._internal.types.CitationMode module-attribute

CitationMode = Literal['default', 'markdown', 'clean']

Controls how citation markers are rendered in the final answer.

  • "default": leave [1], [2] … markers as-is.
  • "markdown": convert markers to [1](url) Markdown links.
  • "clean": strip all citation markers from the text.

SearchFocus

perplexity_webui_scraper._internal.types.SearchFocus module-attribute

SearchFocus = Literal['web', 'writing']

Selects the search/generation mode.

  • "web": enable web search and cited sources.
  • "writing": generate a response without sources.

SourceFocus

perplexity_webui_scraper._internal.types.SourceFocus module-attribute

SourceFocus = Literal[
    "web", "academic", "social", "finance", "all"
]

Filters which source categories Perplexity searches.

  • "web": general web results.
  • "academic": scholarly and academic databases.
  • "social": social media posts and discussions.
  • "finance": SEC EDGAR filings and financial data.
  • "all": combine web, academic, and social.

TimeRange

perplexity_webui_scraper._internal.types.TimeRange module-attribute

TimeRange = Literal['all', 'day', 'week', 'month', 'year']

Recency filter applied to web search results.

  • "all": no time restriction.
  • "day" / "week" / "month" / "year": restrict to that window.

LogLevel

perplexity_webui_scraper._internal.types.LogLevel module-attribute

LogLevel = Literal[
    "disabled",
    "debug",
    "info",
    "warning",
    "error",
    "critical",
]

Log verbosity level.

  • "disabled": no log output (default).
  • "debug" through "critical": standard severity levels.

FileInput

perplexity_webui_scraper._internal.types.FileInput module-attribute

FileInput = (
    str
    | PathLike[str]
    | bytes
    | tuple[bytes, str]
    | tuple[bytes, str, str]
)

Accepted file inputs for Conversation.ask(files=...).

  • str | PathLike[str]: local filesystem path; read at upload time.
  • bytes: raw bytes; filename defaults to "file" and MIME type is detected.
  • tuple[bytes, str]: (data, filename); MIME type is guessed from the filename.
  • tuple[bytes, str, str]: (data, filename, mimetype).