Lesson 07 · Perplexity Mastery Pro+ ~13 min For technical roles

Perplexity API: build research pipelines.

The Sonar API gives you programmatic access to grounded-with-citations AI. For technical users that means automated research pipelines, integrations, and custom tools — anything that needs answers from the current web, not frozen training data. Let's wire one up, keep the part that matters, and control the cost.

The mental model

Grounded search, as a building block.

Whatever you build on Sonar inherits Perplexity's research grounding — real sources, citations, and current information. Reach for it whenever a workflow needs answers based on live web data instead of an LLM's training cutoff.

🧠 Plain LLM call

Answers from training data — no live web, no sources you can show. Fine for drafting; risky for current facts.

📡 Sonar call

Searches the live web and returns an answer plus a citations array. Drop-in grounding for any pipeline.

Do it · your first call

One POST, grounded answer back.

Sign up at sonar.perplexity.ai, get an API key, and the first call looks like any chat-completions request — with one difference in the response.

POSTapi.perplexity.ai/chat/completions
Authorization: Bearer YOUR_KEY
{
  "model": "sonar-pro",
  "messages": [{ "role": "user",
    "content": "What's the latest on Microsoft Copilot enterprise adoption?" }]
}
200 OK · response
{
  "choices": [{ "message": { "content":
    "Enterprise Copilot adoption accelerated through 2026, with…" }}],
  "citations": [
    "https://news.microsoft.com/…",
    "https://www.reuters.com/…",
    "https://sec.gov/…"
  ]
}
Do it · compose a pipeline

Build a daily-briefing automation.

You want a sourced industry briefing in your team's inbox every morning. Pick the right node for each stage — the wrong ones quietly break it.

📡 Daily briefing pipeline0 / 4 wired
Trigger
📡
Sonar
🛠️
Process
📤
Deliver
That's the whole pattern. Cron → grounded Sonar call asking for sources → format while keeping the citations → email. Swap the prompt and the recipient and you've got competitive intel, a role-specific feed, or an internal newsletter.
Ship it without regrets

Two calls that decide if this is worth running.

Cost reality

Sonar costs more per call than a plain GPT-4 request — you're paying for live search. Budget for it, cache repeated queries, and rate-limit. And always carry the citations through to your output: strip them and you've built a slower, pricier, worse general LLM.

Challenge: ship one Sonar-powered workflow

Pick a single research task you or your team does by hand. Build the simplest possible Sonar automation for it — a script plus an email is enough. Keep the citations in the output, cache where you can, and tag anything written to a system of record as AI-sourced. Then iterate.

What you can do now

  • Get a Sonar API key and make a successful first call
  • Compose a daily-briefing pipeline: cron → Sonar → format → email
  • Always carry the citations through to your output
  • Apply cost controls — caching and rate-limiting
  • Tag AI-sourced data so it's verified before anyone trusts it
Pro+
Up next in Perplexity Mastery

Lesson 08 · Advanced Perplexity — finance, academia, legal research

Specialized workflows for finance, academia, and legal research: advanced source filtering, focus modes, and integrations. Start lesson 08 →

🎓
AI Coach
Ask anything about this lesson
Hey! I'm your AI Coach for this lesson. Ask me anything about what you just read — concepts, examples, how to apply it to your work. What's on your mind?
Free lesson coaching is limited to 3 questions. Upgrade to Pro for unlimited coaching on every lesson.