Metadata-Version: 2.5
Name: lordevo-x402
Version: 0.1.5
Summary: Client for Lordevo's pay-per-call web, DNS, email, domain and data checks for AI agents: 58 tools from $0.002, paid with x402 (USDC on Base), with an opt-in free trial. LangChain and CrewAI tools included.
Project-URL: Homepage, https://shop.lordevo.com
Project-URL: Documentation, https://shop.lordevo.com/llms.txt
Author-email: Lordevo <hello@lordevo.com>
License-Expression: MIT
License-File: LICENSE
Keywords: a2a,ai-agents,base,crewai,dns,langchain,mcp,robots.txt,security,seo,usdc,x402
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: crewai
Requires-Dist: crewai>=0.80; extra == 'crewai'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3; extra == 'langchain'
Provides-Extra: pay
Requires-Dist: eth-account>=0.13; extra == 'pay'
Requires-Dist: x402[evm,httpx,requests]>=2.25; extra == 'pay'
Description-Content-Type: text/markdown

# lordevo-x402 (Python)

Python client for the pay-per-call checks at **[shop.lordevo.com](https://shop.lordevo.com)**. It has 58 web, DNS, email, domain and data tools for AI agents, priced from $0.002 per call and paid with [x402](https://x402.org) (USDC on Base). There's no account or API key: each call is one micro-payment from the agent's wallet. Instant tools that fail or are refused (any answer of 400 or higher) are not charged. Long jobs (202) are charged when accepted and are not refunded automatically if they fail later. If a paid job failed, email hello@lordevo.com with the transaction hash and we'll review it, usually within 2 business days. LangChain and CrewAI tools are included.

```bash
pip install lordevo-x402==0.1.5     # free helpers
pip install "lordevo-x402[pay]==0.1.5"     # paid calls (x402 + eth-account)
pip install "lordevo-x402[pay,langchain]==0.1.5"   # or [pay,crewai]
```

## Try it free (no wallet)

3 free calls per IP per UTC day on tools priced up to $0.005. When they are used up the call raises `LordevoError` with status 402; then pay per call as below.

```python
import lordevo_x402 as L
print(L.try_free("dns-lookup", "example.com"))
```

Or a whole client with `trial=True` (since 0.1.4): eligible calls try a free call first. With a wallet it pays once the free calls are used up (and skips the free attempt until 00:00 UTC); without one it raises `LordevoError` 402 with `e.used_up_today` / `e.trial == "used_up_today"`.

```python
import os
free = L.LordevoSync(trial=True)                                                  # no wallet: free calls only
lo = L.LordevoSync.from_private_key(os.environ["AGENT_WALLET_KEY"], trial=True)  # free first, then pay
lo.dns_lookup("example.com")
lo.trial_status()  # {"enabled": True, "status": "available" | "used_up_today" | ..., "free_calls_left_today": ..., "resets_at": ...}
```

## Quickstart

Free calls need no wallet:

```python
from lordevo_x402 import ask, quote, catalog

ask("dns-lookup example.com")            # A2A router: the endpoint, price and payment terms
quote("can-fetch", "https://example.com/blog")   # live x402 terms from the HTTP 402, nothing is paid
len(catalog()["quick_checks"])           # every tool on the shop (58 when this version was released)
```

Paid calls need a Base wallet holding a little USDC:

```python
import os
from lordevo_x402 import LordevoSync, Lordevo

lo = LordevoSync.from_private_key(os.environ["AGENT_WALLET_KEY"], max_price_usd=0.02)
lo.can_fetch("https://example.com/blog/post")    # robots.txt + AI-crawler gate, $0.002
lo.dns_lookup("example.com", type="MX")          # $0.002
lo.email_validate("jane@gmial.com")              # syntax + MX + disposable + typo hint, no SMTP, $0.002
lo.json_validate({"name": "Ada"}, schema={"type": "object", "required": ["name"]})   # $0.002
lo.text_chunk(url="https://example.com/post", max_tokens=300)                       # text or url, $0.002

# async
async with Lordevo.from_private_key(os.environ["AGENT_WALLET_KEY"]) as alo:
    await alo.link_check("https://bit.ly/xyz")
```

- `max_price_usd` (default 0.05): tools priced above it are refused before any request.
- `cache_seconds`: identical calls within the window are answered locally and not paid again.
- Dicts (`json`, `schema`) are sent as JSON text and lists (`urls`) as comma lists. Tools marked "POST ok" switch to a JSON POST by themselves when the GET URL would be longer than 2,000 characters.
- `trial` (default False): see "Try it free" above; `trial_client` (default a plain httpx client) sends the free attempt.
- Errors raise `LordevoError` with `status`, `code`, `charged` and `trial` (why a free call was refused). A refused payment always has `code` `"payment_required"`.
- Copy-paste guides for MCP clients, LangChain, CrewAI, OpenAI Agents SDK and more: https://shop.lordevo.com/guides
- You can also pass your own paying client: `Lordevo(x402HttpxClient(...))` or `LordevoSync(x402_requests(...))`.

## LangChain and CrewAI

```python
from lordevo_x402.langchain import langchain_tools
tools = langchain_tools(sync_client=lo, only=["can-fetch", "link-check", "dns-lookup"])

from lordevo_x402.crewai import crewai_tools
agent = Agent(role="Researcher", goal="...", backstory="...", tools=crewai_tools(lo, only=["can-fetch", "link-check"]))
```

## Tools

These are the prices from [catalog.json](https://shop.lordevo.com/catalog.json) when this version was released; `quote()` and `catalog()` always read the live ones. Call any of them with `lo.call(slug, value, **options)` or as a method (`lo.dns_lookup`).

<!-- tools:begin (generated by gen-tools.mjs from the shop QUICK_TOOLS) -->
| Tool | Input | Price | What it does |
|---|---|---|---|
| `site-check` | `url` | $0.02 | Site check: URL risk signals + AI readiness + security headers (recommended start) |
| `agent-readiness` | `url` | $0.002 | Agent readiness / AI visibility score (GEO) |
| `url-trust` | `url` | $0.002 | URL risk signals before you click or pay (evidence + risk level, never a safety claim) |
| `can-fetch` | `url` | $0.002 | Can I fetch this URL? robots.txt + AI-crawler permission gate |
| `link-check` | `url` | $0.002 | Link check: is it alive, where does it really go (redirects resolved) |
| `dns-lookup` | `host` (opt: type) | $0.002 | DNS records lookup (A, AAAA, CNAME, MX, TXT, NS, SOA, CAA) |
| `email-validate` | `email` | $0.002 | Email validation / email verification API (syntax + domain + MX, no SMTP probing) |
| `ssl-cert` | `host` | $0.002 | SSL/TLS certificate check (expiry, issuer, SANs, chain) |
| `domain-rdap` | `domain` | $0.002 | WHOIS / RDAP domain lookup: age, registrar, expiry |
| `ip-info` | `ip` | $0.002 | IP lookup: owner, network and abuse contact of an IP address (RDAP + reverse DNS) |
| `links-batch` | `urls` | $0.002 | Batch link check (up to 10 URLs per call) |
| `broken-links` | `url` | $0.002 | Broken links on a page (up to 40 links checked) |
| `sitemap-urls` | `url` | $0.002 | Sitemap URL extractor (robots.txt + sitemap index) |
| `link-preview` | `url` | $0.002 | Link preview / unfurl (title, description, image, favicon, logo) |
| `readability` | `url` | $0.002 | Readability and word count (Flesch, reading time, top terms) |
| `structured-data` | `url` | $0.002 | Structured data extractor (JSON-LD, microdata, RDFa) |
| `canonical-check` | `url` | $0.002 | Canonical, hreflang and indexability check |
| `cors-check` | `url` (opt: origin, method) | $0.002 | CORS check (preflight + allowed origins) |
| `http-ping` | `url` | $0.002 | HTTP ping: is a website up or down? Status and timings (DNS, TCP, TLS, TTFB) |
| `domain-lookalike` | `host` | $0.002 | Phishing lookalike domain check (homograph, punycode, typosquatting) |
| `myr-rates` | `currency` | $0.002 | Malaysian ringgit exchange rates + OPR (Bank Negara Malaysia data) |
| `domain-intel` | `domain` | $0.002 | Domain intel: DNS + RDAP/WHOIS + SPF/DMARC + TLS |
| `redirect-chain` | `url` | $0.002 | Redirect chain: every hop with status, Location and time |
| `text-chunk` | `text` or `url` (opt: max_tokens, overlap_tokens), POST ok | $0.002 | Text chunker for RAG (heading-aware, token-sized chunks) |
| `token-count` | `text`, POST ok | $0.002 | Token count estimate (plus characters, words, bytes) |
| `json-validate` | `json` (+ schema), POST ok | $0.002 | JSON Schema validator: check JSON (or LLM output) against a schema |
| `json-repair` | `json`, POST ok | $0.002 | JSON repair for LLM output (fences, quotes, commas, truncation) |
| `time-convert` | `to` (opt: from, datetime) | $0.002 | Time zone conversion (IANA zones, offsets, DST) |
| `cron-next` | `cron` (opt: tz, count, after) | $0.002 | Cron next run times + plain-English description |
| `url-clean` | `urls`, POST ok | $0.002 | URL cleaner: strip tracking parameters, normalise, dedupe (up to 50) |
| `feed-parse` | `url` (opt: limit) | $0.002 | Feed reader: RSS, Atom and JSON Feed to normalised items |
| `page-diff` | `url` (opt: previous_hash, previous_text), POST ok | $0.002 | Page change check: content hash, clean text and line diff |
| `pdf-text` | `url` (opt: max_pages) | $0.002 | PDF to text, page by page |
| `math-eval` | `expr` (opt: decimals), POST ok | $0.002 | Exact calculator: arithmetic, fractions, big integers, functions |
| `date-calc` | `date` (opt: add, subtract, until, tz, weekend, holidays) | $0.002 | Date calculator: add durations, business days, difference between dates |
| `regex-test` | `pattern` (+ text) (opt: flags, mode, replace, max_matches), POST ok | $0.002 | Regex tester: matches, groups, replace and split (JavaScript flavor) |
| `text-diff` | `before` (+ after) (opt: mode, context, ignore_whitespace, ignore_case), POST ok | $0.002 | Text diff: unified diff, hunks and similarity of two texts |
| `csv-parse` | `csv` (opt: delimiter, header, output, types, quote, max_rows), POST ok | $0.002 | CSV/TSV to JSON with delimiter, header and type detection |
| `json-query` | `json` (+ query) (opt: max_results), POST ok | $0.002 | JSON query: JSONPath (RFC 9535) or JSON Pointer |
| `json-schema-infer` | `json` (opt: samples, enums, strict), POST ok | $0.002 | JSON Schema 2020-12 inferred from sample JSON |
| `unit-convert` | `value` (+ from) (opt: to, decimals) | $0.002 | Unit converter with exact factors (NIST SP 811) |
| `text-extract` | `text` (opt: types, max_items), POST ok | $0.002 | Text extraction: URLs, dates, money, numbers and more |
| `prompt-injection-scan` | `text` (opt: format, max_findings, clean), POST ok | $0.002 | Prompt-injection scan for untrusted text |
| `federal-register` | `term` (opt: agency, type, since, until, order, max_results) | $0.002 | US Federal Register search (rules, notices) |
| `sec-filings` | `company` (opt: forms, since, max_results) | $0.002 | SEC EDGAR filings of a listed company |
| `verdict-card` | `url` | $0.01 | Shareable risk-signals card for a site (SVG) |
| `page-markdown` | `url` (opt: include_links, max_tokens) | $0.002 | URL to Markdown: LLM-ready web page reader (main content) |
| `page-markdown-batch` | `urls` (opt: include_links, max_tokens) | $0.01 | Batch URL to Markdown: up to 5 web pages per call (LLM-ready) |
| `page-meta` | `url` | $0.002 | Page metadata + Markdown |
| `email-auth` | `domain` | $0.002 | Email authentication check (SPF, DKIM, DMARC) |
| `security-headers` | `url` | $0.002 | Security headers + TLS quick grade |
| `tech-stack` | `url` | $0.002 | Tech stack detection |
| `seo-page` | `url` | $0.002 | On-page SEO check (one page) |
| `site-snapshot` | `url` | $0.02 | Site snapshot (SEO + security + tech + email) |
| `page-quality` | `url` | $0.005 | Page quality verdict (AI) |
| `site-verdict` | `url` | $0.01 | Business-site risk signals (evidence + risk level, AI-assisted) |
| `seo-audit-lite` | `url` | $0.002 | SEO audit, one page: top 10 issues with fixes (LITE) |
| `security-scan-lite` | `url` | $0.02 | Website Security Scan LITE (passive summary) |
<!-- tools:end -->

## Other ways in

| Interface | Endpoint |
|---|---|
| MCP (streamable HTTP, x402 MCP transport) | `https://shop.lordevo.com/mcp` |
| A2A JSON-RPC (`message/send`, a free router) | `https://shop.lordevo.com/a2a` |
| x402 manifest | `https://shop.lordevo.com/.well-known/x402.json` |
| OpenAPI 3.1 | `https://shop.lordevo.com/openapi.json` |

Only check sites you are allowed to check. All checks are passive and read-only.

JavaScript package: [`lordevo-x402` on npm](https://www.npmjs.com/package/lordevo-x402). Docs: [shop.lordevo.com/llms.txt](https://shop.lordevo.com/llms.txt). MIT licence.
