agentsclimarketplace

Perplexity search

Skill tinh2/skills-hub-registry/integration/perplexity-search

AI-powered web search and research using the Perplexity API (Sonar models). Performs deep web research with citations, fact-checking, competitive analysis, market research, and technical documentation lookup. Supports streaming responses, search domain filtering, and recency filtering.From its SKILL.md

Install
npx -y skills add tinh2/skills-hub-registry --skill perplexity-search

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 12 stars12 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.1 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

Perplexity Search

Use the Perplexity API for AI-powered web search and research. Perplexity's Sonar models combine large language models with real-time web search to provide accurate, cited answers.

Prerequisites

API Reference

Basic Search

curl -s https://api.perplexity.ai/chat/completions \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sonar",
    "messages": [
      {"role": "user", "content": "What are the latest React 19 features?"}
    ]
  }' | jq '.choices[0].message.content'

Models

ModelBest ForContext
sonarGeneral web search, quick answers128K
sonar-proComplex research, multi-step reasoning200K
sonar-reasoningDeep analysis with chain-of-thought128K
sonar-reasoning-proMost thorough research and reasoning128K
sonar-deep-researchComprehensive multi-source deep dives128K

Search with Citations

import requests
import os

def perplexity_search(query: str, model: str = "sonar") -> dict:
    """Search the web using Perplexity API."""
    response = requests.post(
        "https://api.perplexity.ai/chat/completions",
        headers={
            "Authorization": f"Bearer {os.environ['PERPLEXITY_API_KEY']}",
            "Content-Type": "application/json",
        },
        json={
            "model": model,
            "messages": [{"role": "user", "content": query}],
        },
    )
    data = response.json()
    return {
        "answer": data["choices"][0]["message"]["content"],
        "citations": data.get("citations", []),
    }

result = perplexity_search("What are the best practices for Next.js 15 App Router?")
print(result["answer"])
for i, url in enumerate(result["citations"], 1):
    print(f"[{i}] {url}")

TypeScript/Node.js

import OpenAI from "openai";

const perplexity = new OpenAI({
  apiKey: process.env.PERPLEXITY_API_KEY,
  baseURL: "https://api.perplexity.ai",
});

async function search(query: string, model = "sonar") {
  const response = await perplexity.chat.completions.create({
    model,
    messages: [{ role: "user", content: query }],
  });

  return {
    answer: response.choices[0].message.content,
    citations: (response as any).citations ?? [],
  };
}

Advanced Options

response = requests.post(
    "https://api.perplexity.ai/chat/completions",
    headers={
        "Authorization": f"Bearer {os.environ['PERPLEXITY_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "sonar-pro",
        "messages": [
            {
                "role": "system",
                "content": "You are a technical researcher. Provide detailed, accurate answers with specific version numbers and code examples."
            },
            {
                "role": "user",
                "content": "Compare Bun vs Deno vs Node.js performance benchmarks in 2025"
            }
        ],
        # Filter to specific domains
        "search_domain_filter": ["github.com", "stackoverflow.com", "dev.to"],
        # Only recent results
        "search_recency_filter": "month",  # day, week, month
        # Temperature for response generation
        "temperature": 0.2,
        # Return related follow-up questions
        "return_related_questions": True,
    },
)

Streaming Responses

import requests
import json

response = requests.post(
    "https://api.perplexity.ai/chat/completions",
    headers={
        "Authorization": f"Bearer {os.environ['PERPLEXITY_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "sonar",
        "messages": [{"role": "user", "content": "Latest TypeScript 5.5 features"}],
        "stream": True,
    },
    stream=True,
)

for line in response.iter_lines():
    if line:
        data = line.decode("utf-8").removeprefix("data: ")
        if data == "[DONE]":
            break
        chunk = json.loads(data)
        content = chunk["choices"][0]["delta"].get("content", "")
        if content:
            print(content, end="", flush=True)

Use Cases

Competitive Analysis

result = perplexity_search(
    "What are the main competitors to Stripe for payment processing? "
    "Compare pricing, features, and market share as of 2025.",
    model="sonar-pro"
)

Technical Research

result = perplexity_search(
    "What are the security best practices for JWT token handling "
    "in Node.js applications? Include recent CVEs and vulnerabilities.",
    model="sonar-reasoning"
)

Market Research

result = perplexity_search(
    "What is the current market size for AI code assistants? "
    "Include growth projections and key players.",
    model="sonar-deep-research"
)

Fact-Checking

result = perplexity_search(
    "Is it true that React Server Components eliminate the need "
    "for getServerSideProps in Next.js? Explain with citations.",
    model="sonar"
)

MCP Server Integration

For direct Claude Code integration, use the official Perplexity MCP server:

# Install via Homebrew
brew install perplexityai/tap/pplx-mcp

# Or via Go
go install github.com/perplexityai/modelcontextprotocol/cmd/pplx-mcp@latest

Add to Claude Code MCP config:

{
  "mcpServers": {
    "perplexity": {
      "command": "pplx-mcp",
      "env": {
        "PERPLEXITY_API_KEY": "pplx-..."
      }
    }
  }
}

Source: Perplexity API Docs, perplexityai/modelcontextprotocol

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.