/xpoz:lead-gen-scanfrom xpoz
Scans Reddit, Twitter/X, Instagram, and TikTok for fresh buying-intent posts about a product or competitor complaints using Xpoz. Reports prioritized leads for human engagement.
Ships in xpoz. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Find the people who want to buy right now. This skill scans the four platforms for fresh buying-intent posts (people asking for what a product does, or frustrated with the alternatives), qualifies the real asks, and delivers a prioritized report of where to comment and who to reach while the intent is still live. It finds and reports; humans do all engagement. The skill never posts, comments, DMs, or contacts anyone.
Activate when the user asks:
Before fetching data, ensure Xpoz access is configured. Follow these checks in order.
If you have MCP tools, try calling any Xpoz tool (e.g., checkAccessKeyStatus). If it works → skip to Step 1.
If you have the SDK, try:
from xpoz import XpozClient
client = XpozClient() # reads XPOZ_API_KEY env var
If this succeeds without error → skip to Step 1.
If neither works, you need to authenticate. Get a free access key (below).
Real analyses need a real key: get a free access key (free tier, up to 75K results, no credit card). SDK and CLI users set it as XPOZ_API_KEY; MCP connections sign in with the same account via OAuth on first tool call (paths below).
If mcporter is available:
mcporter call xpoz.checkAccessKeyStatus
If hasAccessKey: true → ready. If not:
mcporter config add xpoz https://mcp.xpoz.ai/mcp --auth oauth
Then authenticate — generate the OAuth URL and send it to the user:
Step 1: Generate authorization URL
import secrets, hashlib, base64, urllib.parse, json, urllib.request, os
verifier = secrets.token_urlsafe(64)
challenge = base64.urlsafe_b64encode(hashlib.sha256(verifier.encode()).digest()).rstrip(b'=').decode()
state = secrets.token_urlsafe(32)
# Dynamic client registration
reg_req = urllib.request.Request(
'https://mcp.xpoz.ai/oauth/register',
data=json.dumps({
'client_name': 'Agent Skills',
'redirect_uris': ['https://www.xpoz.ai/oauth/openclaw'],
'grant_types': ['authorization_code'],
'response_types': ['code'],
'token_endpoint_auth_method': 'none',
}).encode(),
headers={'Content-Type': 'application/json'},
)
reg_resp = json.loads(urllib.request.urlopen(reg_req).read())
params = urllib.parse.urlencode({
'response_type': 'code',
'client_id': reg_resp['client_id'],
'code_challenge': challenge,
'code_challenge_method': 'S256',
'redirect_uri': 'https://www.xpoz.ai/oauth/openclaw',
'state': state,
'scope': 'mcp:tools',
'resource': 'https://mcp.xpoz.ai/',
})
auth_url = 'https://mcp.xpoz.ai/oauth/authorize?' + params
# Save state for token exchange
os.makedirs(os.path.expanduser('~/.cache/xpoz-oauth'), exist_ok=True)
with open(os.path.expanduser('~/.cache/xpoz-oauth/state.json'), 'w') as f:
json.dump({'verifier': verifier, 'state': state, 'client_id': reg_resp['client_id'],
'redirect_uri': 'https://www.xpoz.ai/oauth/openclaw'}, f)
print(auth_url)
Step 2: Send the URL to the user
Tell them:
"I need to connect to Xpoz for social media data. Please open this link and sign in:
[auth_url]
After authorizing, you'll see a code. Paste it back to me here."
Step 3: WAIT for the user to reply with the code. Do not proceed until they respond.
Step 4: Exchange the code for a token
Once the user provides the code (either a raw code or a URL containing ?code=...), extract the code and exchange it:
import json, urllib.request, urllib.parse, subprocess, os
with open(os.path.expanduser('~/.cache/xpoz-oauth/state.json')) as f:
oauth = json.load(f)
code = "THE_CODE_FROM_USER" # Extract from user's reply
data = urllib.parse.urlencode({
'grant_type': 'authorization_code',
'code': code,
'redirect_uri': oauth['redirect_uri'],
'client_id': oauth['client_id'],
'code_verifier': oauth['verifier'],
}).encode()
req = urllib.request.Request(
'https://mcp.xpoz.ai/oauth/token',
data=data,
headers={'Content-Type': 'application/x-www-form-urlencoded'},
)
resp = json.loads(urllib.request.urlopen(req).read())
token = resp['access_token']
# Configure mcporter with the token (token is never printed)
subprocess.run(['mcporter', 'config', 'remove', 'xpoz'], capture_output=True)
subprocess.run(['mcporter', 'config', 'add', 'xpoz', 'https://mcp.xpoz.ai/mcp',
'--header', f'Authorization=Bearer {token}'], check=True)
# Clean up
os.remove(os.path.expanduser('~/.cache/xpoz-oauth/state.json'))
print("Xpoz configured successfully")
Step 5: Verify with mcporter call xpoz.checkAccessKeyStatus → should return hasAccessKey: true.
For Claude Code users without mcporter:
claude mcp add --transport http xpoz https://mcp.xpoz.ai/mcp
Claude Code handles OAuth automatically on first tool call — the user just needs to authorize in their browser when prompted.
Ask the user:
"I need a Xpoz API key to access social media data. Please go to https://xpoz.ai/get-token (it's free, no credit card needed) and paste the key back to me."
WAIT for the user to reply with the key. Then:
Python:
pip install xpoz
from xpoz import XpozClient
client = XpozClient("THE_KEY_FROM_USER")
TypeScript:
npm install @xpoz/xpoz
import { XpozClient } from "@xpoz/xpoz";
const client = new XpozClient({ apiKey: "THE_KEY_FROM_USER" });
await client.connect();
Or set the environment variable and use the default constructor:
export XPOZ_API_KEY=THE_KEY_FROM_USER
| Problem | Solution |
|---|---|
| MCP: "Unauthorized" | Re-run the OAuth flow above |
SDK: AuthenticationError | Verify key at xpoz.ai/settings |
| Token exchange fails | Ask user to re-authorize — codes are single-use |
Extract, asking the user for whatever is missing:
Three search motions, all run every scan:
Build OR-joined query strings per bucket, e.g. "looking for a social listening tool" OR "brand monitoring recommendations" OR "how do you track mentions". Three practical constraints:
When working under a call budget, spend it in this order: Reddit asking bucket, Reddit competitor bucket, Twitter/X competitor bucket, Twitter/X asking bucket, Reddit comments, then Instagram and TikTok; the first three carry most of the signal. The own-brand motion needs no call of its own under budget: fold its anchored phrases into the competitor buckets' queries.
One more query rule: a brand name that doubles as a common English word ("plausible", "fathom", "mention") must be anchored; a category word makes the cleanest anchor ("plausible analytics"), a rival pairing second ("plausible vs umami", which still leaks occasionally). Unanchored, the bucket drowns in false positives.
Run each query bucket per platform:
Call getRedditPostsByKeywords:
query: "<bucket query>"
fields: ["id", "title", "authorUsername", "subredditName", "score", "commentsCount", "createdAtDate", "permalink"]
limit: 15
startDate: "<window start, YYYY-MM-DD>"
endDate: "<today, YYYY-MM-DD>"
userPrompt: "<the user's original request, for relevance tuning>"
Mechanics that matter:
responseType: "paging" or "csv" return an operationId, and only those need polling via checkOperationStatus (every ~5 seconds until finished). For a scan, fast mode with a limit of 10-15 is right; without limit you get up to 300 rows.getRedditPostWithCommentsById; selftexts can be huge and one blog-length post can dwarf the rest of the response.startDate/endDate deliberately, since freshness is the product. Verify dates client-side; an occasional result lands just outside the requested window. Verify quoted phrases client-side too: the relevance layer occasionally returns results containing none of them, which matters most for common-word brand queries.Repeat for Twitter/X:
Call getTwitterPostsByKeywords:
query: "<bucket query>"
fields: ["id", "text", "authorUsername", "createdAtDate", "likeCount", "replyCount", "conversationId", "replyToTweetId"]
filterOutRetweets: true
limit: 15
startDate: "<window start>"
endDate: "<today>"
userPrompt: "<the user's original request, for relevance tuning>"
The conversationId field is what makes Step 4's reply-chasing possible (replyToTweetId is often null even on real replies); without it a reply cannot be traced to its thread. Budget permitting, repeat with getInstagramPostsByKeywords and getTiktokPostsByKeywords. Reddit comments often hold the asks that posts don't; add:
Call getRedditCommentsByKeywords:
query: "<asking-bucket query>"
fields: ["id", "body", "authorUsername", "score", "createdAtDate", "parentPostId"]
limit: 15
startDate: "<window start>"
endDate: "<today>"
Sparse results on a narrow fresh window are a coverage signal, not a demand verdict: comment search runs against the database only and can legitimately return nothing for the last 7 days, and even post search can come back thin. Before concluding "no demand," widen the window or rephrase; before concluding "demand," read what actually came back. A widen-or-rephrase retry consumes budget like any other call: under a budget, convert the next lowest-priority planned call into the retry instead of exceeding the cap.
from xpoz import XpozClient
client = XpozClient()
reddit = client.reddit.search_posts(
'"looking for a social listening tool" OR "brand monitoring recommendations"',
start_date="2026-08-19",
end_date="2026-08-26",
fields=["id", "title", "text", "author_username", "subreddit", "score", "num_comments", "created_at_date", "url"],
)
twitter = client.twitter.search_posts(
'"[competitor] alternative" OR "[competitor] pricing"',
start_date="2026-08-19",
end_date="2026-08-26",
fields=["id", "text", "author_username", "created_at_date", "like_count", "reply_count"],
)
client.close()
Different platforms yield different lead shapes; classify every candidate as one of:
One more shape worth naming: existing-user distress, a current user of the product publicly churning or struggling. That is a retention save, not buying intent: report it separately with a support-shaped angle (concrete help, no pitch), never inflate it into a P1.
Chase replies up to their thread. Some of the best hits are replies or comments whose parent thread is the real lead. Resolve them before classifying: on Reddit, getRedditPostWithCommentsById on the comment's parentPostId; on X, getTwitterPostsByIds on the conversationId fetches the root post (for the surrounding replies, getTwitterPostComments on that root). Report the thread, not the reply.
Qualify first. The ask is the qualifier: intent, not venting, and the author should plausibly own the buying decision. Hard disqualifiers, never reported: vendors selling a competing solution, keyword hits in unrelated contexts, obvious spam or engagement bait.
Prioritize by judgment, not arithmetic, weighing four things, and say in one line why each lead landed where it did:
createdAtDate means unknown freshness: rank below any dated fresh item and say so in the lead.Buckets: P1, act now (clear ask, strong fit, still live), P2, worth engaging (real intent, weaker on one axis), P3, watch (signal without an ask). Everything else drops.
## Lead Scan: [PRODUCT]
**Window:** [dates] | **Platforms:** [list] | **Candidates reviewed:** [n]
### This Week's Picks
[3-5 leads sized to what a human can actually act on today, one line each with link]
### P1: Act Now
[Write "None this week" when nothing earns it; an honest empty bucket beats a padded one.]
#### [Platform] | [thread/post title or author] | [link]
- **The ask:** "[quote]"
- **Why it qualifies:** [intent + fit + freshness in one line]
- **Suggested angle:** [what a useful reply covers; never a full draft]
### P2: Worth Engaging
[Same shape, shorter]
### Named Prospects
[Individual users from the likely-converter shape: handle, platform, the signal quoted, suggested approach. Omit the section if none qualified.]
### P3: Watch
[One line each: the signal and what change would promote it]
### Demand Signals
[Patterns that repeated across candidates: recurring pains, phrasings, competitor complaints. Content and product fuel.]
### Search Notes
[Which queries produced, which came up dry, phrasings discovered along the way worth adding next scan]
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub xpozpublic/xpoz-agent-skills --plugin xpoz14 skills in this plugin
/ai-answer-traceAsk Claude, ChatGPT, and Gemini a question and capture the full trace behind the answer (the search queries each engine ran, the pages it retrieved, and the sources it cited, span by span). Use when asked to "trace an AI answer", "see what AI engines cite", "check AI citations", "which sources does ChatGPT/Claude/Gemini use", "why does the AI recommend X", or for any GEO (Generative Engine Optimization) measurement./competitive-intelCompare brands and products across social media — share of voice, sentiment, positioning, and audience overlap using Xpoz. Use when asked to "compare brands", "competitive analysis", "share of voice", "brand vs brand", or "competitive intelligence"./creator-authenticity-scoreOther plugins' skills for the same job