Skip to main content

Python (async, httpx + x402)

pip install "x402[httpx,evm]"
import asyncio
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

async def main():
    private_key = "0xYOUR_PRIVATE_KEY"  # EVM wallet with USDC on Base
    account = Account.from_key(private_key)

    client = x402Client()
    register_exact_evm_client(client, EthAccountSigner(account))

    async with x402HttpxClient(client) as http:
        # Search by category and country
        response = await http.get(
            "https://socialintel.dev/v1/search",
            params={
                "category": "Fitness",
                "country": "US",
                "gender": "female",
                "min_followers": 10000,
                "limit": 50
            }
        )
        data = response.json()
        print(f"Found {data['count']} influencers")

        # Extract emails from business accounts
        emails = [
            user["public_email"]
            for user in data["results"]
            if user.get("public_email")
        ]
        print(f"Got {len(emails)} business emails")

asyncio.run(main())

Node.js (@x402/axios + viem)

npm install @x402/axios @x402/evm viem axios
import axios from "axios";
import { x402Client, wrapAxiosWithPayment } from "@x402/axios";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const privateKey = "0xYOUR_PRIVATE_KEY"; // EVM wallet with USDC on Base
const signer = privateKeyToAccount(privateKey);

const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));

const api = wrapAxiosWithPayment(axios.create(), client);

// Search by keyword
const response = await api.get("https://socialintel.dev/v1/search", {
  params: {
    query: "yoga teacher NYC",
    limit: 20,
  },
});

const { results, count } = response.data;
console.log(`Found ${count} influencers`);

// Filter for business accounts with emails
const withEmails = results.filter((u) => u.public_email);
console.log(`${withEmails.length} have public emails`);

curl (demo / manual flow)

# Free preview — no payment required (3 results, cached)
curl "https://socialintel.dev/v1/search?category=Fitness&country=US&demo=true"

# Full request returns 402 with payment requirements
curl -s -i "https://socialintel.dev/v1/search?category=Beauty&country=US&limit=10"
# HTTP/1.1 402 Payment Required
# Payment-Required: <base64-encoded payment details>
#
# Use Python/Node.js x402 clients to handle payment automatically.
# curl alone cannot complete the x402 payment flow.

AgentCash

If you’re using AgentCash with an AI agent (Claude, GPT, etc.):
# Discover the API
npx agentcash@latest discover https://socialintel.dev

# AgentCash handles wallet setup, USDC funding, and payment.
# Your agent just calls the search endpoint — payment is automatic.

Common patterns

Fan-out search across countries

import asyncio
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

private_key = "0xYOUR_PRIVATE_KEY"

async def search_country(http, country):
    response = await http.get(
        "https://socialintel.dev/v1/search",
        params={"category": "Travel", "country": country, "limit": 50}
    )
    return response.json()["results"]

async def main():
    account = Account.from_key(private_key)
    client = x402Client()
    register_exact_evm_client(client, EthAccountSigner(account))

    async with x402HttpxClient(client) as http:
        countries = ["US", "UK", "DE", "AU", "BR"]
        tasks = [search_country(http, c) for c in countries]
        results = await asyncio.gather(*tasks)

    all_leads = [lead for batch in results for lead in batch]
    print(f"Found {len(all_leads)} leads across {len(countries)} countries")
    # Total cost: 5 x $0.16 = $0.80

asyncio.run(main())

Email harvesting from business accounts

async with x402HttpxClient(client) as http:
    response = await http.get(
        "https://socialintel.dev/v1/search",
        params={
            "category": "Beauty",
            "country": "US",
            "limit": 100  # Max results, $0.26
        }
    )
    leads = response.json()["results"]
    emails = [
        {"email": u["public_email"], "name": u["full_name"], "followers": u["follower_count"]}
        for u in leads
        if u.get("public_email")
    ]
    # Typical yield: 15-25% of results have public_email