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.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-seo-keyword-data 0.3.1
File Size Uploaded Provenance Actions
x402_seo_keyword_data-0.3.1.tar.gz 26.4 kB Without provenance Details for x402_seo_keyword_data-0.3.1.tar.gz

Built distribution (wheel)

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

Total release size: 53.3 kB

Release files / x402_seo_keyword_data-0.3.1.tar.gz

Download URL x402_seo_keyword_data-0.3.1.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4badec885fe2b2748e99bce7bdac19c53db6116c29f08b72ec6a382c5b94b787
BLAKE2b-256 checksum
How to use checksums
f3002768e68022c9d50468adebb25369d65fe93167c960bde81b86592233fe86
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.1-py3-none-any.whl

Download URL x402_seo_keyword_data-0.3.1-py3-none-any.whl
Size 27.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a207f553d2ffc1f6eeae354afa9651eaf5cdf94127334b5c034dc5d9b995d4af
BLAKE2b-256 checksum
How to use checksums
90e1854651a0d2076550331a8f35220bca90870be4f9a7450e2f9118638f2ad4
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.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