perplexity-ai  by helallao

Unofficial API wrapper for Perplexity.ai, with account generation

created 2 years ago
796 stars

Top 45.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides an unofficial Python API wrapper for Perplexity.ai, enabling programmatic access to its search and AI capabilities. It also includes a web interface that automates the generation of new Perplexity accounts using temporary email services, effectively granting unlimited access to Pro queries. This is beneficial for users seeking to leverage Perplexity's advanced features without subscription costs.

How It Works

The core of the API leverages HTTP requests to interact with Perplexity's backend. For account generation, it integrates with Emailnator to create temporary email addresses, which are then used to register new Perplexity accounts, each providing a limited number of free Pro queries. The web interface automates this process, managing account creation and session handling.

Quick Start & Requirements

  • Install: pip install perplexity-api perplexity-api-async patchright
  • Web Interface setup: pip install patchright playwright && patchright install chromium
  • Requires Python 3.x.
  • For web interface, Chrome browser is recommended.
  • Detailed instructions for obtaining cookies for both Perplexity and Emailnator are provided.

Highlighted Details

  • Supports synchronous and asynchronous API usage.
  • Allows specifying search modes (auto, pro, reasoning, deep research) and models.
  • Enables file uploads for context.
  • Includes a LabsClient for accessing experimental features.
  • Web interface automates account creation for unlimited Pro queries.

Maintenance & Community

  • The repository is maintained by helallao.
  • Links to donation wallets (BTC, ETH, USDT, LTC, BCH) are provided.

Licensing & Compatibility

  • The license is not explicitly stated in the README.
  • Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The account generation feature relies on third-party services (Emailnator) and Perplexity's free tier limitations, which are subject to change and may be unstable. Using existing Chrome instances with the web interface might lead to detection or dead loops on Cloudflare verification pages. Obtaining cookies requires manual steps and may need frequent renewal for Emailnator.

Health Check
Last commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
317 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.