Skip to main content

x402-seo-keyword-data (Python)

SEO and keyword data API for AI agents: Google search volume, CPC, keyword difficulty, keyword ideas, Google Trends, SERP results, backlinks, domain rankings, keyword gap, on-page audits and more. 44 routes, $0.012 to $0.25 per call, paid per request with x402 (USDC on Base). No API key, no signup, no subscription.

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

Install

pip install x402-seo-keyword-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_seo_keyword_data import KeywordsClient

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

volume = client.search_volume(keywords=["phone", "watch"], country="us")       # $0.04 (GET)
ideas = client.keyword_ideas(keyword="seo api", limit=50)                       # $0.04 (POST, JSON body)
trend = client.trend(keyword="seo tools", timeframe="past_12_months")           # $0.045
serp = client.serp(q="coffee maker", country="us")                              # $0.018
gap = client.keyword_gap(domain="example.com", competitor="example.org")        # $0.048
for row in volume["results"]:
    print(row["keyword"], row["volume"], row["cpc"])

Each method sends the route's request (most are POST with a JSON body, a few GET), 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/keyword-gap is keyword_gap); parameters keep their API names (locationCode, includeMonthly). SEO_KEYWORD_ROUTES lists all 44 routes with HTTP method, price and MCP tool. client.call_with_receipt(path, params) also returns the settlement receipt (transaction hash).

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; KeywordsClient(account, max_price_usd=0.05) sets one cap for every route. 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 answered free with a 400; an upstream failure is a 503 with "nothing was charged". Both raise DuoApiError with code, param, expected and request_id.

The client sends a User-Agent naming this package and its version (x402-seo-keyword-data-py/<version> (+https://github.com/hiesem/duo-data-utilities)); pass user_agent= to change it. Not affiliated with or endorsed by Google, Amazon, Microsoft or any other platform.

MIT licensed.

Metadata

Release files for x402-seo-keyword-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-seo-keyword-data 0.3.0
File Size Uploaded Provenance Actions
x402_seo_keyword_data-0.3.0.tar.gz 26.3 kB Without provenance Details for x402_seo_keyword_data-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 53.2 kB

Release files / x402_seo_keyword_data-0.3.0.tar.gz

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

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

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

Security for x402-seo-keyword-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