DEV Community

Building an Influencer Vetting Pipeline with Two x402 APIs (Python)

When I started building an influencer vetting tool, I realized there are two distinct problems:

  1. Discovery — finding accounts that match your criteria (niche, location, follower count)
  2. Research — pulling data on specific accounts you've already identified

Most tools conflate these. I've been building a pipeline that uses two different x402-native APIs for each stage, and it works surprisingly well.

Stage 1: Discovery (who exists?)

Social Intel is purpose-built for discovery. You give it a niche and filters, it returns matching Instagram accounts.

import httpx

# Find yoga micro-influencers in the US
discovery = httpx.get(
    "https://api.socialintel.dev/v1/search",
    params={
        "query": "yoga instructor",
        "country": "United States",
        "gender": "woman",
        "followers_min": 10000,
        "followers_max": 100000,
        "limit": 20
    }
)

candidates = discovery.json().get("results", [])
# Returns: username, followers, category, city, email, is_verified
# Price: $0.10 USDC via x402
Enter fullscreen mode Exit fullscreen mode

One call returns up to 20 matching accounts with follower counts, location, and contact email. Good for building the initial candidate list.

Stage 2: Research (what do they post?)

Once you have usernames, StableSocial handles the deep profile pull. Posts, stories, highlights — all the data you need to evaluate fit and engagement.

# For each candidate, pull their recent posts
for creator in candidates[:5]:  # start with top 5
    posts = httpx.post(
        "https://stablesocial.dev/api/instagram/posts",
        json={"username": creator["username"], "limit": 12}
    )
    # Returns: post content, likes, comments, timestamp
    # Price: $0.06 USDC via x402
Enter fullscreen mode Exit fullscreen mode

Putting It Together

import httpx
from dataclasses import dataclass

@dataclass
class InfluencerProfile:
    username: str
    followers: int
    email: str
    avg_likes: float
    recent_posts: list

def build_shortlist(niche: str, country: str, min_followers: int, max_followers: int):
    # Stage 1: Discovery — $0.10
    discovery_response = httpx.get(
        "https://api.socialintel.dev/v1/search",
        params={
            "query": niche,
            "country": country,
            "followers_min": min_followers,
            "followers_max": max_followers,
            "limit": 10
        }
    )
    candidates = discovery_response.json().get("results", [])

    profiles = []
    for candidate in candidates:
        # Stage 2: Research — $0.06 each
        posts_response = httpx.post(
            "https://stablesocial.dev/api/instagram/posts",
            json={"username": candidate["username"], "limit": 12}
        )
        posts = posts_response.json().get("posts", [])
        avg_likes = sum(p.get("likes", 0) for p in posts) / len(posts) if posts else 0

        profiles.append(InfluencerProfile(
            username=candidate["username"],
            followers=candidate["followers"],
            email=candidate.get("email", ""),
            avg_likes=avg_likes,
            recent_posts=posts[:3]
        ))

    # Sort by engagement rate
    profiles.sort(key=lambda p: p.avg_likes / p.followers if p.followers else 0, reverse=True)
    return profiles

# Run it
shortlist = build_shortlist("yoga instructor", "United States", 10000, 100000)
for p in shortlist:
    engagement_rate = (p.avg_likes / p.followers * 100) if p.followers else 0
    print(f"@{p.username}{p.followers:,} followers | {engagement_rate:.1f}% engagement | {p.email}")
Enter fullscreen mode Exit fullscreen mode

Cost Per Run

  • Discovery call: $0.10
  • Research calls (10 profiles): $0.60
  • Total: $0.70 USDC for a qualified shortlist of 10 influencers sorted by engagement

Both APIs use x402 — your agent handles payments automatically if you're using an x402-compatible wallet like AgentCash.

When to Use Each

Task Use
"Find yoga influencers in LA" Social Intel
"Get @username's recent posts" StableSocial
"Build an influencer shortlist from scratch" Both, in sequence
"Monitor a specific creator's content" StableSocial only

Try Without Paying First

Both services have free demo endpoints. Use them to validate the data before committing:

# Social Intel free demo
curl "https://api.socialintel.dev/v1/search/free?query=yoga+instructor&country=United+States"

# StableSocial — standard x402 free tier on first call
Enter fullscreen mode Exit fullscreen mode

Social Intel docs: https://socialintel.dev

Top comments (0)