Repository avatar
AI Tools
v1.1.0
active

data-utilities

com.duoleads.api/data-utilities

IBAN, ISIN, VAT/tax ID, GTIN validation; timezone, geo, text, chain utilities. Pay per call

Documentation

IBAN, ISIN, VAT/tax ID and GTIN barcode validation plus 29 more utilities for AI agents. Pay per call ($0.05 USDC on Base via x402), no API key, no signup.

Timezone and DST, geo distance and geohash, hashes and JWT decoding, airport, country, currency and NUTS lookups, money split, base conversion and more. Every call is one HTTP GET, paid per request.

Also crypto derivatives data for trading agents: perp funding rates, funding arbitrage, open interest, futures basis, implied volatility, liquidations and order book depth across Bybit, Hyperliquid, dYdX, Gate, Kraken, Bitfinex, Deribit and OKX, at $0.003 or $0.005 per call (below).

Also SEO and keyword data: Google search volume, CPC, keyword difficulty, keyword ideas, Google Trends, SERP results, backlinks, domain rankings, keyword gap, on-page audits and more, 44 routes at $0.012 to $0.25 (below). And social media data for social listening: public posts, profiles, comments and search on X (Twitter), Reddit, TikTok, Instagram, YouTube, LinkedIn, Bluesky and Hacker News, 26 routes at $0.01 to $0.025 (below).

Only need one service? The same clients ship as small standalone packages: x402-seo-keyword-data, x402-crypto-derivatives-data and x402-social-media-data.

Install

npm install duo-data-utilities viem

viem creates the wallet account that pays. This package also depends on it. Node.js 20 or later.

Python (all four services; or one service: pip install x402-seo-keyword-data, x402-crypto-derivatives-data or x402-social-media-data):

pip install duo-data-utilities

Quick start

import { privateKeyToAccount } from "viem/accounts";
import { createClient } from "duo-data-utilities";

// Your wallet holds USDC on Base. Read the key from the environment, never a literal.
const client = createClient({ account: privateKeyToAccount(process.env.DUO_PAYER_KEY as `0x${string}`) });

const iban = await client.iban.validate({ iban: "NL91 ABNA 0417 1643 00" }); // $0.05
console.log(iban.valid, iban.country); // true NL

Counterparty check

checkCounterparty runs three checks in one call: IBAN (/v1/id/iban), tax ID (/v1/id/national) and country (/v1/ref/country). It costs $0.15.

const check = await client.checkCounterparty({
  iban: "NL91 ABNA 0417 1643 00",
  country: "NL",
  taxIdType: "bsn",
  taxId: "111222333",
});
console.log(check.verdict, check.reasons); // "pass", "fail" or "review"
  • fail: the IBAN or the tax ID fails its checksum, the country is not an ISO 3166-1 country, or the API rejects an input as malformed.
  • review: the IBAN country differs from the tax ID country, or the API does not cover that country or tax ID kind.
  • pass: every check passed.

Structure and checksum only. The check does not query a company register, a bank or a tax authority, and it does not confirm that an account exists. UK is read as GB.

Crypto derivatives data: perp funding rates, open interest, futures basis, implied volatility, liquidations, order book depth

client.derivs calls https://derivs.duoleads.com: crypto derivatives data from 8 exchanges (Bybit, Hyperliquid, dYdX, Gate, Kraken, Bitfinex, Deribit, OKX) for trading agents and bots. Perpetual futures (perp) funding rates with predicted funding, funding rate history and a funding arbitrage scanner, a perp screener, open interest (OI), futures basis and term structure, options implied volatility (IV), skew and max pain, liquidations, and order book depth with slippage. $0.003 or $0.005 per call, same wallet, same x402 payment, no API key.

import { privateKeyToAccount } from "viem/accounts";
import { createClient, createDerivsClient } from "duo-data-utilities";

const account = privateKeyToAccount(process.env.DUO_PAYER_KEY as `0x${string}`);
const client = createClient({ account });

const funding = await client.derivs.fundingRates({ coin: "BTC" }); // $0.003
for (const v of funding.venues) console.log(v.venue, v.apr_pct, v.next_funding_time);

const arb = await client.derivs.fundingArbitrage({ min_apr: 20, min_volume_usd: 1_000_000 }); // $0.005, all coins
const snap = await client.derivs.derivativesSnapshot({ coin: "ETH" }); // $0.005: funding, OI, basis, liquidations, long/short

// Or a derivs-only client:
const derivs = createDerivsClient({ account });
await derivs.openInterest({ coin: "SOL" }); // $0.003
import os

from eth_account import Account
from duo_data_utilities import DerivsClient, DuoClient

client = DuoClient(Account.from_key(os.environ["DUO_PAYER_KEY"]))
rates = client.derivs.funding_rates(coin="BTC")               # $0.003
book = client.derivs.orderbook(coin="BTC", size_usd=250_000)  # $0.003
derivs = DerivsClient(Account.from_key(os.environ["DUO_PAYER_KEY"]))  # derivs only
  • Price guard: client.derivs has its own cap. By default each route is capped at its own listed price ($0.003 or $0.005), so a challenge above it is refused. createClient({ account, derivs: { maxPriceUsd: 0.003 } }) sets one cap for every route and refuses the $0.005 routes (Python: derivs_max_price_usd=0.003). The other rules are the same: Base USDC only, only to 0xCD673f7e1daD254347AEab6be0DEFe8b9C6b3A39, nothing is signed before the check.
  • Not charged: bad input is a free 400 with error.expected. When fewer venues answer than the route needs, the answer is a 503 and nothing is charged. Both throw DuoApiError.
  • Answers are the JSON body itself (no data envelope), with venues_missing, units, as_of and a see_also pointer to the next useful route. TypeScript types: DerivsFundingRatesData and so on.
  • Coins: BTC, btc, BTCUSDT, BTC-PERP, XBT, 1000PEPE and kPEPE all name a coin.
  • MCP: the same 10 tools at https://derivs.duoleads.com/mcp. Snippets for Claude Code, Claude Desktop, Cursor and VS Code: mcp/README.md.
  • Data only, not investment advice, not affiliated with any exchange.
TypeScriptPythonRoutePriceWhat it returns
derivs.fundingRatesderivs.funding_rates/v1/funding-rates$0.003Perp funding rates per exchange for one coin: rate, 8h rate, APR, next funding, predicted funding (incl. Binance and Bybit, as Hyperliquid publishes it), last 24 prints
derivs.fundingHistoryderivs.funding_history/v1/funding-history$0.003Funding rate history of one coin on one exchange, up to 30 days, with avg/min/max/% positive
derivs.fundingArbitragederivs.funding_arbitrage/v1/funding-arbitrage$0.005Funding arbitrage scanner for all coins: widest cross-venue spread, long and short venue, fee-adjusted net APR, breakeven days
derivs.perpScreenerderivs.perp_screener/v1/perp-screener$0.005Perp screener: every perpetual across venues, sorted by funding APR, open interest, 24h volume or 24h change
derivs.openInterestderivs.open_interest/v1/open-interest$0.003Open interest (OI) per exchange in coins and USD, share, and 1h/4h/24h OI change
derivs.basisderivs.basis/v1/basis$0.003Futures basis and term structure (annualised, contango/backwardation), perp premium, predicted funding
derivs.optionsderivs.options/v1/options$0.003Implied volatility (ATM IV), 25-delta skew, put/call OI ratio, max pain, DVOL; options chain with greeks for one expiry
derivs.liquidationsderivs.liquidations/v1/liquidations$0.003Long and short liquidations in USD per venue over 1-24h, totals and the largest events
derivs.orderbookderivs.orderbook/v1/orderbook$0.003Order book depth within 0.1/0.5/1/2% of mid, spread, imbalance, slippage for your order size, walls
derivs.derivativesSnapshotderivs.derivatives_snapshot/v1/derivatives-snapshot$0.005One-call snapshot: funding, open interest, perp premium and nearest basis, 24h liquidations, long/short ratio

Derivs docs: https://derivs.duoleads.com/docs · OpenAPI: https://derivs.duoleads.com/openapi.json · Index: https://derivs.duoleads.com/llms.txt · Terms: https://derivs.duoleads.com/terms · Privacy: https://derivs.duoleads.com/privacy

SEO and keyword data: search volume, CPC, keyword difficulty, Google Trends, SERP, backlinks

client.keywords calls https://keywords.duoleads.com, 44 routes. Keyword research: Google search volume, CPC, competition, keyword difficulty and search intent (Google Ads data), keyword ideas, related keywords, variations and volume history. Google Trends. Domains and rankings: domain overview, traffic estimate, ranked keywords, competitors, keyword gap, SERP competitors, historical rank. Backlinks: summary, list, referring domains, anchors, history. Site tools: on-page audit and PageSpeed. Amazon keywords and search. Google, Bing, YouTube and Maps results, SERP history and business listings. Brand mentions and AI-answer (LLM) mentions, tech stack and WHOIS. Calls cost $0.012 to $0.25 each and use the same wallet and the same x402 payment, with no API key.

const volume = await client.keywords.searchVolume({ keywords: ["phone", "watch"], country: "us" }); // $0.04, up to 20 keywords
const overview = await client.keywords.keywordOverview({ keywords: myList });                        // $0.04, up to 100 keywords (POST)
const ideas = await client.keywords.keywordIdeas({ keyword: "seo api", limit: 50 });                 // $0.04 (POST)
const trend = await client.keywords.trend({ keyword: "seo tools", timeframe: "past_12_months" });    // $0.045
const gap = await client.keywords.keywordGap({ domain: "example.com", competitor: "example.org" });  // $0.048
const serp = await client.keywords.serp({ q: "coffee maker", country: "us" });                       // $0.018
const links = await client.keywords.backlinks({ target: "example.com" });                            // $0.048

// Or a keywords-only client (also published alone as x402-seo-keyword-data):
const keywords = createKeywordsClient({ account });
await keywords.relatedQueries({ keyword: "seo api", country: "us" }); // $0.03
  • Price guard: client.keywords has its own cap. By default each of the 44 routes is capped at its own listed price, so a challenge above it is refused. createClient({ account, keywords: { maxPriceUsd: 0.04 } }) sets one cap for every route (that one refuses trend and every route above $0.04). The other rules are the same: Base USDC only, only to 0xCD673f7e1daD254347AEab6be0DEFe8b9C6b3A39, and nothing is signed before the check.
  • Methods: each route has its own HTTP method (most are POST with a JSON body); the client picks it. SEO_KEYWORD_ROUTES lists all 44 with method, price and MCP tool.
  • Errors: a bad input is a free 400. An upstream failure is a 503 with "nothing was charged". Both throw DuoApiError.
  • MCP: the same 44 tools are at https://keywords.duoleads.com/mcp.
MethodRoutePriceMCP toolWhat it returns
keywords.keywordOverviewPOST /v1/keyword-overview$0.04keyword_overviewKeyword overview (up to 100 keywords)
keywords.searchVolumeGET /v1/search-volume$0.04keyword_search_volumeSearch volume (GET, up to 20 keywords)
keywords.keywordIdeasPOST /v1/keyword-ideas$0.04keyword_ideasKeyword ideas (up to 100 per seed)
keywords.trendGET /v1/trend$0.045google_trendsGoogle Trends interest over time
keywords.relatedQueriesGET /v1/related-queries$0.03google_trends_related_queriesGoogle Trends related queries
keywords.interestByRegionGET /v1/interest-by-region$0.03google_trends_by_regionGoogle Trends interest by region
keywords.relatedKeywordsPOST /v1/related-keywords$0.04related_keywordsRelated keywords (up to 100, depth 0-4)
keywords.keywordVariationsPOST /v1/keyword-variations$0.04keyword_variationsKeyword variations containing a phrase (up to 100)
keywords.keywordDifficultyPOST /v1/keyword-difficulty$0.04keyword_difficultyKeyword difficulty (up to 100 keywords)
keywords.searchIntentPOST /v1/search-intent$0.04search_intentSearch intent (up to 100 keywords)
keywords.keywordVolumeHistoryPOST /v1/keyword-volume-history$0.048keyword_volume_historyMonthly search volume history (up to 20 keywords)
keywords.keywordSuggestionsPOST /v1/keyword-suggestions$0.04keywords_for_siteKeywords for a site or page (up to 100)
keywords.trendsPOST /v1/trends$0.045google_trends_compareGoogle Trends comparison (up to 5 keywords)
keywords.domainOverviewPOST /v1/domain-overview$0.04domain_overviewDomain overview (organic and paid visibility)
keywords.trafficEstimatePOST /v1/traffic-estimate$0.04traffic_estimateTraffic estimate (up to 100 domains)
keywords.rankedKeywordsPOST /v1/ranked-keywords$0.048ranked_keywordsRanked keywords of a domain (up to 100)
keywords.competitorsPOST /v1/competitors$0.048competitor_domainsCompetitor domains (up to 100)
keywords.keywordGapPOST /v1/keyword-gap$0.048keyword_gapKeyword gap: competitor-only keywords (up to 100)
keywords.serpCompetitorsPOST /v1/serp-competitors$0.048serp_competitorsDomains ranking for a keyword set (up to 100)
keywords.relevantPagesPOST /v1/relevant-pages$0.048relevant_pagesTop pages of a domain (up to 100)
keywords.historicalRankPOST /v1/historical-rank$0.25historical_rankMonthly rank history of a domain (24 months)
keywords.pageIntersectionPOST /v1/page-intersection$0.048page_intersectionKeywords shared by pages (up to 20 pages)
keywords.backlinksPOST /v1/backlinks$0.048backlinks_summaryBacklink profile summary
keywords.backlinksListPOST /v1/backlinks-list$0.048backlinks_listBacklinks list (up to 100)
keywords.referringDomainsPOST /v1/referring-domains$0.048referring_domainsReferring domains (up to 100)
keywords.backlinkAnchorsPOST /v1/backlink-anchors$0.048backlink_anchorsBacklink anchor texts (up to 100)
keywords.backlinksHistoryPOST /v1/backlinks-history$0.048backlinks_historyBacklink profile history (up to 24 months)
keywords.onPagePOST /v1/on-page$0.012on_page_auditOn-page SEO audit of a URL
keywords.pagespeedPOST /v1/pagespeed$0.018pagespeedPage speed (Lighthouse Core Web Vitals)
keywords.amazonKeywordsPOST /v1/amazon-keywords$0.04amazon_keywordsAmazon keyword ideas and volume
keywords.amazonSearchPOST /v1/amazon-search$0.012amazon_searchAmazon search results (products)
keywords.serpGET /v1/serp$0.018google_searchGoogle search results (10, 20 or 50)
keywords.mapsSearchGET /v1/maps-search$0.018google_maps_searchGoogle Maps places (up to 100)
keywords.serpHistoryPOST /v1/serp-history$0.018serp_historyGoogle results-page history (one past snapshot)
keywords.businessListingsPOST /v1/business-listings$0.08business_listingsBusiness listings by name or category (up to 50)
keywords.autocompleteGET /v1/autocomplete$0.012google_autocompleteGoogle autocomplete suggestions
keywords.bingSerpGET /v1/bing-serp$0.018bing_searchBing search results (10, 20 or 50)
keywords.youtubeSearchGET /v1/youtube-search$0.012youtube_searchYouTube search results (20 or 40)
keywords.googleAdsKeywordsPOST /v1/google-ads-keywords$0.16google_ads_keywordsGoogle Ads keyword ideas (up to 100)
keywords.clickstreamSearchVolumePOST /v1/clickstream-search-volume$0.04clickstream_search_volumeClickstream search volume (up to 100 keywords)
keywords.brandMentionsPOST /v1/brand-mentions$0.048brand_mentionsBrand mentions on the web (up to 100)
keywords.techStackPOST /v1/tech-stack$0.024tech_stackWebsite technology stack
keywords.whoisPOST /v1/whois$0.21whois_overviewWHOIS overview of a domain
keywords.llmMentionsPOST /v1/llm-mentions$0.21llm_mentionsAI answers mentioning a keyword (up to 20)

Python: the same 44 routes, in snake_case, on DuoClient(account).keywords or KeywordsClient(account) (also published alone on PyPI as x402-seo-keyword-data). Parameters keep their API names:

volume = client.keywords.search_volume(keywords=["phone", "watch"], country="us")  # $0.04 (GET)
gap = client.keywords.keyword_gap(domain="example.com", competitor="example.org")   # $0.048 (POST, JSON body)

Keyword docs: https://keywords.duoleads.com/docs · OpenAPI: https://keywords.duoleads.com/openapi.json · Index: https://keywords.duoleads.com/llms.txt · Terms: https://keywords.duoleads.com/terms · Privacy: https://keywords.duoleads.com/privacy

Social media data: X (Twitter), Reddit, TikTok, Instagram, YouTube, LinkedIn, Bluesky, Hacker News

client.social calls https://social.duoleads.com, 26 routes for social listening and research: public posts, profiles, comments and search on X (Twitter), Reddit, TikTok, Instagram, YouTube (also transcripts), Threads, Facebook ads, LinkedIn, Bluesky and Hacker News, cross-platform search and mentions, in one shared answer schema. Calls cost $0.01 to $0.025 each, same wallet, same x402 payment, no API key.

const posts = await client.social.blueskySearch({ q: "open source", limit: 10 }); // $0.01
const tweets = await client.social.xSearch({ q: "nasa" });                        // $0.02
const all = await client.social.socialSearch({ q: "open source" });              // $0.025, several platforms at once

// Or a social-only client (also published alone as x402-social-media-data):
const social = createSocialClient({ account });
await social.hackernewsSearch({ q: "x402" }); // $0.01
  • Price guard: by default each route is capped at its own listed price; maxPriceUsd sets one cap for every route.
  • Errors: a bad input is a free 400; not found or no match is not charged. Both throw DuoApiError.
  • Responsible use: answers are third parties' public data. Read the service's terms and privacy notice; do not use the data to profile, target or train AI on individuals.
  • MCP: the same 26 tools are at https://social.duoleads.com/mcp.
MethodRoutePriceMCP toolWhat it returns
social.blueskySearchGET /v1/bluesky/search$0.01bluesky_searchBluesky post search
social.blueskyPostsGET /v1/bluesky/posts$0.01bluesky_postsBluesky account feed
social.blueskyProfileGET /v1/bluesky/profile$0.01bluesky_profileBluesky profile
social.hackernewsSearchGET /v1/hackernews/search$0.01hackernews_searchHacker News search
social.hackernewsThreadGET /v1/hackernews/thread$0.01hackernews_threadHacker News thread
social.socialMentionsGET /v1/social/mentions$0.01social_mentionsSocial mentions and sentiment (aggregate)
social.xSearchGET /v1/x/search$0.02x_searchX (Twitter) post search
social.xPostsGET /v1/x/posts$0.02x_postsX (Twitter) user timeline
social.xProfileGET /v1/x/profile$0.02x_profileX (Twitter) profile
social.redditSearchGET /v1/reddit/search$0.02reddit_searchReddit post search
social.redditCommentsGET /v1/reddit/comments$0.02reddit_commentsReddit post comments
social.tiktokVideosGET /v1/tiktok/videos$0.02tiktok_videosTikTok account videos
social.tiktokSearchGET /v1/tiktok/search$0.02tiktok_searchTikTok video search
social.instagramProfileGET /v1/instagram/profile$0.02instagram_profileInstagram profile and posts
social.youtubeTranscriptGET /v1/youtube/transcript$0.02youtube_transcriptYouTube transcript
social.youtubeCommentsGET /v1/youtube/comments$0.02youtube_commentsYouTube video comments
social.threadsPostsGET /v1/threads/posts$0.02threads_postsThreads account posts
social.facebookAdsGET /v1/facebook/ads$0.02facebook_adsMeta Ad Library search
social.socialSearchGET /v1/social/search$0.025social_searchSocial search on X, Reddit and TikTok
social.socialAudienceGET /v1/social/audience$0.02social_audienceAudience and engagement stats
social.socialAccountsGET /v1/social/accounts$0.02social_accountsCreator and brand account search
social.linkedinCompanyGET /v1/linkedin/company$0.02linkedin_companyLinkedIn company page
social.socialPeopleGET /v1/social/people$0.02people_searchProfile search (TikTok, Instagram, Threads)
social.tiktokFollowersGET /v1/tiktok/followers$0.02tiktok_followersTikTok followers list
social.tiktokFollowingGET /v1/tiktok/following$0.02tiktok_followingTikTok following list
social.linkedinProfileGET /v1/linkedin/profile$0.02linkedin_profileLinkedIn profile

Python: the same 26 routes, in snake_case, on DuoClient(account).social or SocialClient(account) (also published alone on PyPI as x402-social-media-data):

posts = client.social.bluesky_search(q="open source", limit=10)  # $0.01
tweets = client.social.x_search(q="nasa")                        # $0.02

Social docs: https://social.duoleads.com/docs · OpenAPI: https://social.duoleads.com/openapi.json · Index: https://social.duoleads.com/llms.txt · Terms: https://social.duoleads.com/terms · Privacy: https://social.duoleads.com/privacy

Methods

Every method costs $0.05 per call. Each method's JSDoc gives the route and the parameters. client.call(path, params) calls any route, and client.callWithReceipt(path, params) also returns the settlement receipt.

MethodRouteWhat it does
iban.validate/v1/id/ibanIBAN validator: length, mod-97 check digits, bank/branch/account breakdown (89 countries)
iban.generate/v1/id/iban-buildIBAN generator: build an IBAN from country and BBAN or bank/branch/account, computing check digits
taxId.validate/v1/id/nationalVAT, tax ID and national ID validator: 23 countries, checksum only (VAT formats BE, DE, FR, IT, PL, AT, CH, IE)
isin.validate/v1/id/securityISIN validator plus CUSIP, SEDOL and FIGI check-digit validation; builds an ISIN from an NSIN
barcode.validate/v1/id/gs1GTIN barcode validator: EAN-13, UPC-A (GTIN-12), GTIN-8/14, GLN and SSCC check digits
timezone.convert/v1/time/zoneTimezone converter: instant to local time in an IANA time zone and back, with UTC offset and DST state
timezone.dstTransitions/v1/time/dstDST transitions: next daylight-saving time changes for an IANA time zone
businessDays.calculate/v1/time/business-daysBusiness days calculator: add or count working days with your weekend mask and holiday list
rrule.expand/v1/time/rruleRRULE expander: RFC 5545 recurrence rule to concrete occurrence dates
calendar.convert/v1/time/calendarCalendar converter: Gregorian to Hijri, Hebrew, Japanese era, Persian and more, plus Easter date
text.similarity/v1/text/similarityString similarity: Levenshtein, Jaro-Winkler distance and Soundex/Metaphone phonetic keys
text.slug/v1/text/slugSlug generator: Unicode-aware URL slug with transliteration
text.transliterate/v1/text/transliterateCyrillic transliteration to Latin (ISO 9:1995, BGN/PCGN Russian)
text.unicode/v1/text/unicodeUnicode normalization (NFC/NFKC), script detection and homoglyph/confusable check
hash.generate/v1/code/hashHash generator: SHA-256, SHA-512, SHA-3, Keccak-256, BLAKE2 and HMAC digests
punycode.convert/v1/code/idnPunycode converter: IDN domain to ASCII and back, with IDNA2008 label validation
jwt.decode/v1/code/jwtJWT decoder: header, claims and expiry state (no signature verification)
semver.compare/v1/code/semverSemver parser: parse and compare versions, check range satisfaction
url.parse/v1/code/urlURL parser: parse, canonicalize and extract the registrable domain (eTLD+1)
geohash.encodeDecode/v1/geo/geohashGeohash encoder and decoder with neighbour cells
plusCode.encodeDecode/v1/geo/pluscodePlus code (Open Location Code) encoder and decoder
polygon.check/v1/geo/polygonPoint in polygon check, plus bounding box, centroid and area for GeoJSON
distance.calculate/v1/geo/distanceDistance calculator: geodesic distance, bearing and destination point on WGS-84
cryptoAddress.validate/v1/chain/addressCrypto address validator: detect the blockchain and verify the checksum (EVM, Bitcoin, Solana and more)
solidity.selector/v1/chain/selectorSolidity function selector: Keccak-256, 4-byte selector and event topic from a signature
airport.lookup/v1/ref/airportAirport lookup by IATA or ICAO code: name, coordinates, elevation, time zone; nearest airports
country.lookup/v1/ref/countryCountry lookup: ISO 3166 codes, currency, TLD, UN region and ISO 3166-2 subdivisions
currency.lookup/v1/ref/currencyCurrency lookup: ISO 4217 codes, names, minor units and cash rounding
nuts.lookup/v1/ref/nutsNUTS region lookup: EU statistical region codes, names and hierarchy
money.split/v1/num/allocateMoney split: allocate an amount into shares with no rounding loss
base.convert/v1/num/radixBase converter: integers between number bases 2 to 36 (hex, binary, octal)
statistics.calculate/v1/num/statsStatistics calculator: mean, median, standard deviation, quartiles and percentiles
numberWords.convert/v1/num/wordsNumber to words in 12 languages, with ordinal and currency forms

MCP

The MCP server is at https://api.duoleads.com/mcp (Streamable HTTP). tools/list is free. Each tools/call costs $0.05 and needs an x402-capable client or wallet bridge. The derivatives tools are a second server at https://derivs.duoleads.com/mcp ($0.003 or $0.005 per call), the keyword tools a third at https://keywords.duoleads.com/mcp ($0.012 to $0.25) and the social tools a fourth at https://social.duoleads.com/mcp ($0.01 to $0.025). See mcp/README.md for Claude Code, Claude Desktop, Cursor, VS Code and AgentCash.

Python

Python 3.10 or later. The client is typed (py.typed) and uses requests with x402's EVM signer. Routes and method names match the TypeScript client, in snake_case. The Python client covers all four services: client.derivs, client.keywords and client.social share the wallet of DuoClient, and DerivsClient, KeywordsClient and SocialClient work on their own. Each per-service client is also published alone on PyPI (x402-crypto-derivatives-data, x402-seo-keyword-data, x402-social-media-data), standalone like the npm packages.

import os

from eth_account import Account
from duo_data_utilities import DuoClient

client = DuoClient(Account.from_key(os.environ["DUO_PAYER_KEY"]))  # your wallet, never a literal key
print(client.iban.validate(iban="NL91 ABNA 0417 1643 00")["valid"])

check = client.check_counterparty(iban="NL91 ABNA 0417 1643 00", country="NL", tax_id_type="bsn", tax_id="111222333")
print(check.verdict, check.reasons)

DuoClient(account, *, max_price_usd=0.05, timeout=None, pay_to=<service address>) applies the same price guard. Pass session= with a requests.Session that already pays to skip the guard. from_ is the Python name for the from query parameter.

Pricing and the price guard

  • Every main API route costs $0.05 per call, paid in USDC on Base (eip155:8453) with x402 v2. Derivs routes cost $0.003 or $0.005, keyword routes $0.012 to $0.25 and social routes $0.01 to $0.025, each capped by default at its own listed price. See each section.
  • maxPriceUsd defaults to 0.05. Before anything is signed, the client refuses a payment requirement that asks for more than that, a network other than Base, an asset other than Base USDC, or another payee. A refused call makes no payment and throws PriceGuardError.
  • The client only signs payments to the service's public address 0xCD673f7e1daD254347AEab6be0DEFe8b9C6b3A39 (payTo option; pay_to in Python). Set it if you point baseUrl at another deployment.
  • The client never retries a paid call on its own.
  • Plain http:// is refused except for loopback addresses (localhost, 127.0.0.1, [::1]).
  • With fetch instead of account, you pass a fetch that already pays. The price guard cannot check payments made inside it, so use account to keep the guard.

Examples

Runnable agents in examples/. Each folder has a README with setup, environment variables and cost.

ExampleLanguageWhat it does
supplier-onboarding-agentTypeScriptSupplier / vendor onboarding check: builds and validates IBANs, checks VAT numbers, compares the account holder name. Approve, review or reject per supplier.
kyb-payout-agent-pythonPythonKYB payout validation agent with Claude tool use: IBAN, VAT / tax ID, country and name checks, with a spend cap.
mcp-paid-clientTypeScriptMCP client for https://api.duoleads.com/mcp that pays each tools/call with x402, plus an MCP host config.
funding-arbitrage-watcherTypeScriptFunding rate arbitrage watcher: scans perp funding spreads across 8 exchanges every few minutes and alerts on new fee-adjusted opportunities. $0.005 per scan; the default run costs $0.06.
derivs-snapshot-loop-pythonPythonPer-coin derivatives snapshot loop: funding, open interest, basis, liquidations and long/short for each coin; flags crowded positioning. $0.005 per coin per round; the default run costs $0.06.
keyword-research-agentTypeScriptSEO keyword research agent: keyword ideas with search volume, CPC and difficulty, ranked by opportunity, plus a Google Trends check on the best pick. The default run (1 seed) costs $0.085.
node-basic.tsTypeScriptIBAN, time zone, counterparty check and a settlement receipt in one script.
vercel-ai-sdk-tool.tsTypeScriptIBAN and counterparty checks as Vercel AI SDK tools.
langchain_tool.pyPythonIBAN and counterparty checks as LangChain tools.
claude-mcp.mdAdding the MCP server to Claude Code.

Main API calls cost $0.05, derivs calls $0.003 or $0.005, keyword calls $0.012 to $0.25 (the examples use the $0.03 to $0.045 keyword-research calls) and social calls $0.01 to $0.025, in USDC on Base, paid by the wallet you configure. The examples' tests run offline with mocked responses; nothing in CI pays.

User-Agent and privacy

The SDK sends a User-Agent naming the SDK and version; the API stores only a coarse client class, see https://api.duoleads.com/privacy

  • TypeScript: duo-data-utilities-js/<version> (+https://github.com/hiesem/duo-data-utilities). Override it with createClient({ userAgent }), or append your own product: userAgent: `${SDK_USER_AGENT} my-agent/1.0` .
  • Python: duo-data-utilities-py/<version> (+https://github.com/hiesem/duo-data-utilities). Override it with DuoClient(..., user_agent=...), or append to duo_data_utilities.USER_AGENT.
  • In browsers a page cannot set User-Agent, so the client sends none there, and it adds no other header in its place (one would make the browser send a CORS preflight, which the API does not accept). The browser's own User-Agent is sent instead.

What this is not

  • Not a registry lookup. IBAN, tax ID and VAT checks are structure and checksum only.
  • Not financial, legal or tax advice. Each response carries a disclaimer.
  • Derivatives data is data only: not investment advice, not a benchmark, not affiliated with any exchange.
  • Keyword and social data come from third-party providers and public sources; not affiliated with or endorsed by Google, X, Reddit, TikTok, Meta, LinkedIn or any other platform.

Links

The HTTP routes also work without this SDK. An unpaid GET returns 402 Payment Required with a PAYMENT-REQUIRED header, and any x402 v2 client can pay that challenge.

Development

npm install
npm run generate        # rebuild src/*generated.ts and the README route tables from spec/ (npm test checks they are current)
node scripts/refresh-specs.mjs   # re-fetch the services' published OpenAPI into spec/ (free), then review the diff
python3 python/scripts/generate.py   # the same for the Python package
npm run typecheck
npm test
npm run build

spec/ holds the snapshots the code is generated from. See spec/README.md. packages/ holds the three per-service packages (x402-seo-keyword-data, x402-crypto-derivatives-data, x402-social-media-data); each bundles the shared client code from src/, so none depends on this package.

License

MIT. See LICENSE.

No installation packages available.

Remote