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.1

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.1
File Size Uploaded Provenance Actions
x402_social_media_data-0.3.1.tar.gz 19.6 kB Without provenance Details for x402_social_media_data-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 40.2 kB

Release files / x402_social_media_data-0.3.1.tar.gz

Download URL x402_social_media_data-0.3.1.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ba0aed4eb872e10051bafb1c2421e7d512807745ce5cffdc136ba362e96e0ad0
BLAKE2b-256 checksum
How to use checksums
90e5338b0147a4ca8b2171b8a6b0c2436b5acdfb8a80126d0318ddf2f3e08da3
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.1-py3-none-any.whl

Download URL x402_social_media_data-0.3.1-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a239db75db51bae7b137132f9af79f2894beaa3af6dff7bf8d36ec0d5ef28bad
BLAKE2b-256 checksum
How to use checksums
2dfd9ffbeaadb6c6e19af28b30def6b39a0ade4fd1c506a7779e8109df586fe7
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.1

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.1 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