seoskills.sh
Catalog/seoskills/internal

Perplexity Citation Analyzer

Sends a set of target queries to the Perplexity API, parses the cited source URLs from each answer, and aggregates cita…

0 installs

Use this skill

$ npx skills add seoskills.sh/perplexity-citation-analyzer
Repository
seoskills/internal
GitHub stars
License

SKILL.md

---
name: Perplexity Citation Analyzer
description: Sends a set of target queries to the Perplexity API, parses the cited source URLs from each answer, and aggregates citation frequency by domain and page type to reveal which content earns AI citations. Use when the user asks what sources Perplexity cites, how to get cited by AI answer engines, or wants a citation gap analysis versus competitors.
category: ai-search
---

# Perplexity Citation Analyzer

AGENT ROLE: Autonomous citation-intelligence agent. Query Perplexity for each target query, extract the citation set, aggregate by domain and content pattern, and emit the JSON in `references/output.schema.json`.

## OBJECTIVE
For a topic's query set, determine which domains and page types Perplexity cites most, whether the user's brand is cited, and where the citation gaps are versus competitors — so the user can target the formats that earn citations.

## INPUTS
- `queries` (REQUIRED string[]): the topic's buyer/informational questions.
- `brand_domains` (OPTIONAL string[]): the user's domains, to compute own citation share.
- `competitor_domains` (OPTIONAL string[]): to benchmark share of citations.
- `model` (OPTIONAL): default `sonar` (online model that returns citations).

## AUTHENTICATION (Perplexity API)
1. REQUIRE env `PERPLEXITY_API_KEY`.
   - IF unset THEN STOP `error.code="AUTH_MISSING_API_KEY"`: "Set PERPLEXITY_API_KEY from your Perplexity API account."
2. Endpoint: `POST https://api.perplexity.ai/chat/completions`, header `Authorization: Bearer {key}`.
3. Only "online"/sonar models return a `citations` array — REQUIRE such a model; IF a non-citing model is requested THEN override to `sonar` and note `model_overridden=true`.

## EXPECTED TOOL CALLS
- Run `scripts/perplexity_citations.py --queries queries.json [--brand a.com,b.com] [--competitors c.com]`.
- Per query POST `{model, temperature:0, messages:[{role:"user", content:query}]}`; read `choices[0].message.content` AND the top-level `citations` array of URLs.

## PROCEDURE (deterministic)
STEP 1 — For each query, capture `citations` (list of URLs) and `answer_text`.
STEP 2 — NORMALIZE each citation: extract registrable domain; classify `page_type` from the path with `references`-free heuristics: `homepage` (path `/`), `blog_article` (`/blog|/article|/guide|/post`), `product` (`/product|/pricing|/features`), `docs` (`/docs|/help|/support`), `listicle` (title/URL contains `best|top|vs|review|alternatives`), else `other`.
STEP 3 — AGGREGATE:
  - `by_domain`: citation count + share (of total citations across all queries).
  - `by_page_type`: distribution → what FORMAT gets cited.
  - `brand_citation_rate` = queries where a `brand_domains` URL is cited / total queries.
  - `competitor_share`: per competitor domain, citation share; produce `share_of_citations` leaderboard.
STEP 4 — GAPS: queries where a competitor is cited but the brand is NOT → `citation_gaps` (highest-priority targets).
STEP 5 — EMIT, `by_domain` sorted by count desc.

## RATE LIMITS & ERROR HANDLING
- Perplexity enforces per-key RPM. On `429` THEN honor `Retry-After` else backoff `2^attempt` (max 5); after that mark that query `status="rate_limited"` and continue.
- On `5xx`/timeout (60s) retry ≤3 then `status="engine_error"` for that query.
- Serialize or cap concurrency at 2 to respect the rate limit.

## MISSING / INSUFFICIENT DATA
- IF a response has an empty `citations` array THEN record the query with `citations:[]`, `status="no_citations"` (the model answered from parametric knowledge) — this is a signal, not an error.
- Never infer a citation that is not in the returned `citations` array; do not parse URLs out of the prose as citations.

## OUTPUT
One JSON object per `references/output.schema.json`. No prose.

## FILES
- `scripts/perplexity_citations.py` — Perplexity client, citation normalization, aggregation.
- `references/output.schema.json` — output contract.

Not using the CLI? Copy the SKILL.md and paste it straight into ChatGPT, Claude, or any agent.

Embed a badge

seoskills.sh install badge

More in AI Search (AEO and GEO)

AI Search (AEO and GEO)coreyhaines31/marketingskills

ai-seo

When the user wants to optimize content for AI search engines, get cited by LLMs, or appear in AI-generated answers. Also use when the user mentions 'AI SEO,' 'AEO,' 'GEO,' 'LLMO,' 'answer engine optimization,' 'generative engine optimization,' 'LLM optimization,' 'AI Overviews,' 'optimize for ChatGPT,' 'optimize for Perplexity,' 'AI citations,' 'AI visibility,' 'zero-click search,' 'how do I show up in AI answers,' 'LLM mentions,' 'optimize for Claude/Gemini,' 'llms.txt,' 'llms-full.txt,' 'OKF,' 'Open Knowledge Format,' 'knowledge bundle,' 'agent-readable site,' 'agent readiness,' 'is my site

125K installs
AI Search (AEO and GEO)resciencelab/opc-skills

seo-geo

SEO & GEO (Generative Engine Optimization) for websites. Analyze keywords, generate schema markup, optimize for AI search engines (ChatGPT, Perplexity, Gemini, Copilot, Claude) and traditional search (Google, Bing). Use when user wants to improve search visibility, search optimization, search ranking, AI visibility, ChatGPT ranking, Google AI Overview, indexing, JSON-LD, meta tags, or keyword research.

47.1K installs
AI Search (AEO and GEO)calm-north/seojuice-skills

optimize-for-ai

Optimize content for AI search engines — ChatGPT, Perplexity, Claude, Gemini, Google AI Overviews. Use when the user asks about AI SEO, AISO, getting cited by AI, appearing in AI answers, answer engine optimization, AEO, GEO, LLMO, AI Overviews, zero-click search, or how to appear in ChatGPT/Perplexity results. For traditional SEO, see diagnose-seo.

6.6K installs
AI Search (AEO and GEO)sanity-io/agent-toolkit

seo-aeo-best-practices

SEO and AEO best practices for metadata, Open Graph, sitemaps, robots.txt, hreflang, JSON-LD structured data, EEAT, and content optimized for search engines and AI answer surfaces. Use this skill when implementing page SEO, technical SEO, schema markup, international SEO, AI-overview readiness, or improving content for Google, ChatGPT, Perplexity, and similar assistants.

6.3K installs
AI Search (AEO and GEO)agricidaniel/claude-seo

seo-maps

Maps intelligence for local SEO: geo-grid rank tracking, GBP profile auditing via API, review intelligence across Google/Tripadvisor/Trustpilot, cross-platform NAP verification, competitor radius mapping, and LocalBusiness schema generation. Three tiers: free (Overpass + Geoapify), DataForSEO, and DataForSEO + Google. Use when user says "maps", "geo-grid", "rank tracking", "GBP audit", "review velocity", "competitor radius", or "SoLV".

4.9K installs
AI Search (AEO and GEO)agricidaniel/claude-seo

seo-dataforseo

Live SEO data via DataForSEO MCP server: SERP analysis, keyword research (volume, difficulty, intent, trends), backlink profiles, on-page analysis, competitor and content analysis, business listings, AI visibility (LLM mention tracking), and domain analytics. Requires DataForSEO extension installed. Use when user says "dataforseo", "live SERP", "keyword volume", "backlink data", "AI visibility check", or "real search data".

4.8K installs