Perplexity Webui Scraper

Web search and scraping

Unofficial Python client, CLI, MCP server, and OpenAI-compatible REST API for Perplexity's WebUI.

Your AI app calls the Perplexity Webui Scraper MCP server, which does the web search and scraping work and sends the result back to the chat.

About Perplexity Webui Scraper

Perplexity Webui Scraper is a community MCP server from henrique-coder, filed in our directory under web search and scraping. Unofficial Python client, CLI, MCP server, and OpenAI-compatible REST API for Perplexity's WebUI.

At a glance

Publisher
henrique-coder (community)
Runs
See the README for setup
Written in
Python
License
MIT
GitHub stars
148

How to set up Perplexity Webui Scraper

  1. Follow the install steps in the Perplexity Webui Scraper README; it is written in Python, so have that toolchain ready.
  2. Check the Perplexity Webui Scraper README for keys or settings; the registry lists none that Perplexity Webui Scraper requires.
  3. Add Perplexity Webui Scraper to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Perplexity Webui Scraper tools to confirm the connection.
  5. Run one read-only task with Perplexity Webui Scraper first, and keep your app asking before each tool call until the results look right.

Perplexity Webui Scraper compared with similar servers

  • ReActMCP by mshojaei77 has fewer GitHub stars than Perplexity Webui Scraper (145 against 148); both are community servers, and both run locally.
  • One Search by yokingma has more GitHub stars than Perplexity Webui Scraper (149 against 148); both are community servers, and both run locally.
  • mcpsurfr by nkapila6 has more GitHub stars than Perplexity Webui Scraper (151 against 148); both are community servers, and both run locally.

Before you connect Perplexity Webui Scraper

  • Give Perplexity Webui Scraper its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Perplexity Webui Scraper tool call until you trust what it does with them.
  • Treat text that Perplexity Webui Scraper fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Perplexity Webui Scraper on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Perplexity Webui Scraper

How marketing and sales teams put Perplexity Webui Scraper to work, by company size. Pick the size closest to yours and start Perplexity Webui Scraper on one use case.

Small business

  • A founder can use Perplexity Webui Scraper to research a market or a prospect in minutes, with sources cited, before a pitch or a pricing change.
  • Small teams can ask Perplexity Webui Scraper what competitors launched this month and get the pages, not just a summary.
  • Perplexity Webui Scraper runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can use Perplexity Webui Scraper to gather fresh data for content, such as stats, quotes and examples, with each source linked for checking.
  • Outbound teams can connect Perplexity Webui Scraper to research accounts from public pages and add one specific line to each first email.
  • Start Perplexity Webui Scraper on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprise research and competitive intel teams can schedule Perplexity Webui Scraper to monitor many sources, with results stored and cited for review.
  • Large orgs can route Perplexity Webui Scraper through approved providers and respect each site's terms, keeping scraping inside legal guidance.
  • Perplexity Webui Scraper is a community server, so have security review the code and pin a version before Perplexity Webui Scraper touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Perplexity Webui Scraper README

From henrique-coder/perplexity-webui-scraper on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Perplexity WebUI Scraper

Unofficial Python client for Perplexity's WebUI-backed endpoints. It does not scrape page HTML.

Documentation: perplexity-webui-scraper.readthedocs.io

About

This unofficial client uses undocumented Perplexity WebUI endpoints for conversations, file uploads, and streaming; it does not scrape page HTML. The token command emits a compact wsk_ session credential after email login. The library also accepts the raw __Secure-pplx.session.<UUIDv4>=<JWE> cookie pair. The compact representation is reversible obfuscation, not encryption or authenticated integrity; treat it as a password.

A Perplexity account and its account-scoped session credential are required. Provide either the raw UUID cookie pair or a compact wsk_ token. Free accounts support text prompts; paid tiers are required for Pro/Max models and file uploads.

Python >=3.11, <3.16 is supported. .python-version and API/MCP containers use Python 3.15; CI quality, documentation, and package-build jobs use Python 3.14. The test matrix covers every supported minor version across Linux, macOS, and Windows.

Community

Installation

The package is published to PyPI. API and MCP container images are published to GHCR. GitHub Releases include the wheel and source distribution; the project does not publish standalone executables.

Core library

Install the core Python library without optional features.

uv add perplexity-webui-scraper
CLI and server extras

Install only the features you need. Use the token, api, and mcp extras individually or together.

# Install from PyPI
uv add 'perplexity-webui-scraper[token]'  # Email token generator
uv add 'perplexity-webui-scraper[api]'  # REST API server
uv add 'perplexity-webui-scraper[mcp]'  # MCP server
uv add 'perplexity-webui-scraper[all]'  # All optional features

Quick Start

1. Get your session token

The base install does not include token-generation dependencies. Install the token extra first:

uv add 'perplexity-webui-scraper[token]'
uv run perplexity-webui-scraper token --email user@example.com

The token command accepts an optional --email argument and prompts when omitted. It retrieves the UUID-suffixed session cookie and prints a compact wsk_ credential. Email verification accepts exactly six ASCII digits or an HTTPS Perplexity email callback link for the requested account. Malformed inputs are rejected locally; invalid codes prompt again without resending the email or discarding the current session. Treat the resulting credential as a password.

To convert an existing raw cookie or validate an existing compact credential without network access, run:

uv run perplexity-webui-scraper token convert

Use token deconvert to restore either a compact wsk_ token or a raw cookie to its raw session-cookie pair. Only the pasted credential prompt in token convert and token deconvert is masked (email, six-digit verification codes/links, and TOTP inputs remain visible); neither command accepts credentials as positional arguments. Conversion does not encrypt the cookie or improve its security.

2. Basic usage
from perplexity_webui_scraper import Perplexity

client = Perplexity(session_token="__Secure-pplx.session.<account UUID>=YOUR_VALUE")
conversation = client.create_conversation()

print(client.get_account_profile().account_tier)

conversation.ask("What is quantum computing?")
print(conversation.answer)

# Follow-ups preserve context automatically
conversation.ask("Explain it simpler")
print(conversation.answer)

Before each prompt, the library checks /api/auth/session and raises ModelAccessError if an available model requires a higher tier than the authenticated account. When the session payload does not expose enough subscription data, it falls back to /rest/user/settings. Models use one of three statuses: available (confirmed working normally), unknown (not yet verified, including custom identifiers), or unavailable (confirmed not working). is_official separately records whether a model is listed in Perplexity's official WebUI. last_tested_at records the last test in ISO 8601 UTC and is null for untested models. Any non-available status requires allow_risky_model=True; after acknowledgement, the backend makes the final entitlement decision. Free accounts can use text prompts, but file attachments raise FileAccessError.

perplexity/best adapts to the account tier: free accounts use Perplexity's internal turbo preference, while Pro/Max accounts use pplx_pro_upgraded; both use copilot mode.

3. Streaming
printed = ""
for response in conversation.ask("Explain AI", stream=True):
    current = response.answer or "".join(response.chunks)
    if current.startswith(printed):
        delta = current[len(printed) :]
        print(delta, end="", flush=True)
        printed = current
    elif current:
        printed = current
        print(f"\r{printed}", end="", flush=True)
4. Choose a model
from perplexity_webui_scraper import ConversationConfig

conversation = client.create_conversation(ConversationConfig(model="perplexity/best"))
conversation.ask("Solve this step by step: ...")
print(conversation.answer)
5. List registered models
from perplexity_webui_scraper import MODELS

for model in MODELS.list_all():
    print(f"{model.id:40} {model.name}")

CLI commands

Use -h or --help with the root command or any subcommand. The token command accepts -e or --email.

Command Extra Description
perplexity-webui-scraper token -e/--email EMAIL token Authenticate and print a compact wsk_ account session credential
perplexity-webui-scraper token convert token Convert a raw cookie or validate a compact credential offline with masked input
perplexity-webui-scraper token deconvert token Restore a wsk_ token or raw cookie to its raw session-cookie pair with masked input
perplexity-webui-scraper api api Start the OpenAI-compatible REST API server
perplexity-webui-scraper mcp mcp Start the MCP server

API

Chat Completions API

POST /v1/chat/completions is the only text-generation endpoint. It is a read-only question-answering mirror of Perplexity's WebUI and automatically prepends a master system instruction rejecting autonomous agent loops and tool execution. It supports streaming, validated base64 image Data URLs, and account-scoped thread continuation with perplexity.thread_uuid. Responses contain final assistant text. GET /v1/models checks the account tier (with a 10-minute in-memory cache) and returns only models accessible to that tier. The API does not expose hidden chain-of-thought, execute client tools, or fetch remote image URLs.

# Default: clients supply a compact wsk_ token or raw cookie in Authorization: Bearer
perplexity-webui-scraper api

# Passwordless mode using one configured server token (no incoming password checked)
PERPLEXITY_SESSION_TOKEN="wsk_YOUR_COMPACT_TOKEN" perplexity-webui-scraper api

# Custom API key gating the configured server token (checked via Authorization: Bearer)
PERPLEXITY_SESSION_TOKEN="wsk_YOUR_COMPACT_TOKEN" \
  PERPLEXITY_API_KEY="my_secret_key_123" \
  perplexity-webui-scraper api

# Custom host and port
perplexity-webui-scraper api --host 0.0.0.0 --port 8080

# Development mode with auto-reload
perplexity-webui-scraper api --reload
Container deployment with Podman
# Pull the published multi-arch API image
podman pull ghcr.io/henrique-coder/perplexity-webui-scraper:latest

# Run the server (exposing port 8000)
podman run --rm -p 8000:8000 ghcr.io/henrique-coder/perplexity-webui-scraper:latest

Optional MCP image for containerized stdio setups:

# Pull the published multi-arch MCP image
podman pull ghcr.io/henrique-coder/perplexity-webui-scraper:mcp

# Run MCP server (requires token)
podman run --rm -i -e PERPLEXITY_SESSION_TOKEN=your_token ghcr.io/henrique-coder/perplexity-webui-scraper:mcp

For local development, you can still build the provided container files:

# API image: installs the `api` extra, exposes port 8000, and starts the REST server.
podman build -t perplexity-api -f Containerfile .
podman run --rm -it -p 8000:8000 perplexity-api

# MCP image: installs the `mcp` extra and starts the stdio MCP server. It does not expose an HTTP port.
podman build -t perplexity-mcp -f Containerfile.mcp .
podman run --rm -i -e PERPLEXITY_SESSION_TOKEN=your_token perplexity-mcp
CLI options
Option Short Default Description
--host -H 127.0.0.1 Bind address
--port -p 8000 Port to listen on
--reload False Enable auto-reload (development only)
--log-level info Uvicorn log level
--session-token unset Server-default Perplexity token (PERPLEXITY_SESSION_TOKEN, wsk_ or raw cookie)
--api-key unset Custom Authorization: Bearer key required when --session-token is set
Authentication

Requests always use Authorization: Bearer. Without --session-token, send either a compact wsk_ token or a raw __Secure-pplx.session.<UUIDv4>=<JWE> cookie pair per request. With --session-token only, the server accepts requests without a password. With both --session-token and --api-key, pass your custom --api-key as the Bearer token.

# curl
export PERPLEXITY_SESSION_TOKEN='YOUR_TOKEN'
curl http://localhost:8000/v1/chat/completions \
  -H "Authorization: Bearer $PERPLEXITY_SESSION_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"model": "perplexity/best", "messages": [{"role": "user", "content": "Hello!"}]}'

# Streaming
curl -N http://localhost:8000/v1/chat/completions \
  -H "Authorization: Bearer $PERPLEXITY_SESSION_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"model": "perplexity/best", "messages": [{"role": "user", "content": "Hello!"}], "stream": true}'
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8000/v1",
    api_key="wsk_YOUR_COMPACT_TOKEN",
)

response = client.chat.completions.create(
    model="perplexity/best",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

Chat Completions request with server-configured --session-token and custom --api-key:

curl http://localhost:8000/v1/chat/completions \
  -H 'Authorization: Bearer my_secret_key_123' \
  -H 'Content-Type: application/json' \
  -d '{"model":"perplexity/best","messages":[{"role":"user","content":"Hello!"}]}'
API endpoints
Method Path Description
GET /v1/models List models available to the authenticated account
POST /v1/chat/completions Chat Completions API (streaming and non-streaming)
GET /docs Interactive Swagger UI
GET /redoc ReDoc API documentation

Chat Completions implements a documented subset of the OpenAI contract. Unsupported fields may be ignored. The API returns final text, not hidden reasoning or client-executable tools.

MCP server

Expose every Perplexity model as a separate tool for AI agents (Claude Desktop, Antigravity, etc.):

{
  "mcpServers": {
    "perplexity-webui-scraper": {
      "command": "uvx",
      "args": [
        "--from",
        "perplexity-webui-scraper[mcp]",
        "perplexity-webui-scraper",
        "mcp"
      ],
      "env": { "PERPLEXITY_SESSION_TOKEN": "your_token_here" }
    }
  }
}

See the MCP documentation for tools and configuration.

Disclaimer

This is an unofficial library. It uses internal APIs that may change without notice. Use at your own risk. By using this library, you agree to Perplexity AI's Terms of Service.

Questions about Perplexity Webui Scraper

What is the Perplexity Webui Scraper MCP server?

Unofficial Python client, CLI, MCP server, and OpenAI-compatible REST API for Perplexity's WebUI. Perplexity Webui Scraper is maintained by henrique-coder on GitHub at henrique-coder/perplexity-webui-scraper, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Perplexity Webui Scraper MCP server?

Perplexity Webui Scraper doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (henrique-coder/perplexity-webui-scraper). Like most servers, Perplexity Webui Scraper ends with a command or URL you paste into your AI app's MCP config.

Does Perplexity Webui Scraper need an API key?

The registry lists no required keys for Perplexity Webui Scraper. Check the Perplexity Webui Scraper README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Perplexity Webui Scraper an official MCP server?

No. Perplexity Webui Scraper is a community server maintained by henrique-coder. Community servers can be excellent; read the code and the open issues before you give Perplexity Webui Scraper access to company data.

What license is Perplexity Webui Scraper under?

Perplexity Webui Scraper is released under the MIT license, according to its GitHub repository. The license covers the code of Perplexity Webui Scraper; the service it connects to has its own terms.