Social data. Typed.
Query Twitter, Instagram, and Reddit with 30 typed methods. Pagination, CSV export, and structured models — all in a single package.
Quickstart
import { XpozClient } from "@xpoz/xpoz";
const client = new XpozClient({ apiKey: process.env.XPOZ_API_KEY });
await client.connect();
const results = await client.twitter.searchPosts("artificial intelligence");
console.log(`Found ${results.pagination.totalRows} tweets`);
console.log(`Page 1: ${results.data.length} results`);
await client.close();Full API reference on GitHub
Platform Coverage
30 typed methods across three major platforms — consistent interface, structured output
Twitter / X
12 methods- Search tweets & users
- Get user timelines
- Track hashtags
- Follower analysis
- Search posts & reels
- Profile analytics
- Hashtag tracking
- Engagement metrics
- Search posts & comments
- Subreddit analysis
- User history
- Thread deep-dives
Real-World Examples
Common workflows you can build in minutes
Brand Monitoring
Track mentions across platforms and analyze sentiment in real time.
const results = await client.twitter.searchPosts(
"YourBrand OR @YourBrand"
);
const highEngagement = results.data.filter(
(t) => t.likeCount > 100 || t.retweetCount > 50
);
const csvUrl = await results.exportCsv();
console.log(`Download CSV: ${csvUrl}`);Influencer Discovery
Find niche influencers by topic and engagement metrics.
const results = await client.instagram.searchPosts(
"sustainable fashion"
);
const usernames = [...new Set(results.data.map((p) => p.username))];
const profiles = await Promise.all(
usernames.slice(0, 20).map((u) =>
client.instagram.getUser(u)
),
);
const micro = profiles
.filter((u) => u.followerCount > 10_000 && u.followerCount < 100_000)
.sort((a, b) => b.followerCount - a.followerCount);Competitor Analysis
Compare engagement and content strategy across competitors.
const competitors = ["CompetitorA", "CompetitorB"];
const results = await Promise.all(
competitors.map((handle) =>
client.twitter.getPostsByAuthor(handle)
),
);
const stats = results.map((r, i) => ({
name: competitors[i],
avgLikes: r.data.reduce((s, t) => s + t.likeCount, 0) / r.data.length,
avgRetweets: r.data.reduce((s, t) => s + t.retweetCount, 0) / r.data.length,
}));Reddit Research
Mine subreddit discussions for product feedback and trends.
const results = await client.reddit.searchPosts(
"project management tools",
{ subreddit: "productivity" },
);
const threads = await Promise.all(
results.data.slice(0, 10).map((t) =>
client.reddit.getPostWithComments(t.id)
),
);
const allComments = threads.flatMap((t) => t.comments);
console.log(`${allComments.length} comments collected`);
const csvUrl = await results.exportCsv();Built for Headless Agents
The SDK works in any headless loop — cron jobs, CI pipelines, or autonomous AI agents. No browser, no OAuth dance, just an API key and typed methods.
- Stateless — no session to manage
- Typed responses — parse without guessing
- Built-in pagination — fetch all results automatically
- CSV export — pipe data anywhere
import { XpozClient } from "@xpoz/xpoz";
const client = new XpozClient({ apiKey: process.env.XPOZ_API_KEY });
await client.connect();
async function monitorLoop() {
const results = await client.twitter.searchPosts(
"your brand -is:retweet"
);
for (const tweet of results.data) {
if (tweet.likeCount > 1000) {
await alertTeam(tweet);
}
}
}Start Querying in 4 Steps
Sign up
Create a free account
Get API key
Generate from your dashboard
Install
npm install or pip install
Query
30 methods, 3 platforms
