Skip to main content

x402-social-media-data (Python)

Social media data API for AI agents: social listening on X (Twitter), Reddit, TikTok, Instagram, YouTube, Threads, LinkedIn, Bluesky and Hacker News, plus Facebook ads, cross-platform search and mentions. Public posts, profiles, comments, transcripts and search. 26 routes, $0.01 to $0.025 per call, paid per request with x402 (USDC on Base). No API key, no signup.

This is the Python client for https://social.duoleads.com. It is also part of duo-data-utilities (as DuoClient(...).social); this package has the social client only and does not depend on it. TypeScript: x402-social-media-data on npm.

Install

pip install x402-social-media-data

Python 3.10 or later. eth-account (installed with it) creates the wallet account that pays.

Quick start

import os

from eth_account import Account
from x402_social_media_data import SocialClient

# Your wallet holds USDC on Base. Read the key from the environment, never a literal.
client = SocialClient(Account.from_key(os.environ["PAYER_KEY"]))

posts = client.bluesky_search(q="x402", limit=10)          # $0.01
stories = client.hackernews_search(q="x402")               # $0.01
tweets = client.x_search(q="x402 payments")                # $0.02
everywhere = client.social_search(q="x402")                # $0.025, several platforms in one call

Every route is a GET; each method pays the 402 challenge with your wallet and returns the JSON answer as a dict. Method names are the route paths in snake_case (/v1/x/search is x_search). SOCIAL_ROUTES lists all 26 routes with price and MCP tool. client.call_with_receipt(path, params) also returns the settlement receipt.

Price guard

Before anything is signed, the client checks the payment requirement: Base USDC only, only to the service's address 0xCD673f7e1daD254347AEab6be0DEFe8b9C6b3A39, and never above the cap. By default each route is capped at its own listed price ($0.01, $0.02 or $0.025); SocialClient(account, max_price_usd=0.01) allows the $0.01 routes only. A refused call signs nothing and raises PriceGuardError. The client never retries a paid call on its own.

Errors and charges

A bad input is a free 400; not found or no match is not charged. Both raise DuoApiError with code, param, expected and request_id.

Responsible use

Answers are third parties' public data. Read the service's terms and privacy notice (https://social.duoleads.com/terms, https://social.duoleads.com/privacy); do not use the data to profile, target or train AI on individuals.

Not affiliated with or endorsed by X, Reddit, TikTok, Meta, LinkedIn, YouTube, Bluesky, Hacker News or any other platform. The client sends a User-Agent naming this package and its version; pass user_agent= to change it.

MIT licensed.

Metadata

Release files for x402-social-media-data 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for x402-social-media-data 0.3.0
File Size Uploaded Provenance Actions
x402_social_media_data-0.3.0.tar.gz 19.5 kB Without provenance Details for x402_social_media_data-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for x402-social-media-data 0.3.0
File Interpreter ABI Platform Actions
x402_social_media_data-0.3.0-py3-none-any.whl Python 3 none any Details for x402_social_media_data-0.3.0-py3-none-any.whl

Total release size: 40.1 kB

Release files / x402_social_media_data-0.3.0.tar.gz

Download URL x402_social_media_data-0.3.0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b9b5c5f47317a42a2bfca3aa156800852c324c915f2e13257c5ed33d900723bb
BLAKE2b-256 checksum
How to use checksums
f657b8f1f1ba08d1a900ea647793c7d62bebd30bf1aaf2a8e811936876ca59ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / x402_social_media_data-0.3.0-py3-none-any.whl

Download URL x402_social_media_data-0.3.0-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22beebfbe497ea9b820d53f580a5d5fdeb2bdf2e67de2ad87bfe98e7cc174c4d
BLAKE2b-256 checksum
How to use checksums
e248df3a7f42137148ea292603910e03168609db7bdf180e82eed586b285520a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for x402-social-media-data 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page