Free, programmatic access to mate.tools utilities. Designed for AI agents, automation scripts and frontend apps.
curl -X POST https://mate.tools/api/v1/count-lines.php \
-H "Content-Type: application/json" \
-d '{"text":"line one\nline two\n\nline four"}'import urllib.request, json
req = urllib.request.Request(
"https://mate.tools/api/v1/count-lines.php",
data=json.dumps({"text": "line one\nline two\n\nline four"}).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)["metrics"])const res = await fetch("https://mate.tools/api/v1/count-lines.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "line one\nline two\n\nline four" }),
});
console.log((await res.json()).metrics);fetch("https://mate.tools/api/v1/count-lines.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "line one\nline two\n\nline four" }),
})
.then(r => r.json())
.then(console.log);| Endpoint | What it does |
|---|---|
| GET/api/v1/health.php | Liveness probe. Returns the API version and the full list of endpoints. Excluded from rate limits. |
| POST/api/v1/count-lines.php | Sixteen text metrics: lines, words, sentences, paragraphs, characters, duplicates, line endings, longest word, reading time and more. |
| POST/api/v1/base64-encode.php | Encode text to Base64. Optional URL-safe alphabet (RFC 4648 §5) without padding. |
| POST/api/v1/base64-decode.php | Decode Base64 to text. Accepts both standard and URL-safe input. Returns hex when output is not valid UTF-8. |
| POST/api/v1/hash.php | Compute hashes of a text input — defaults to MD5, SHA-1, SHA-256, SHA-384, SHA-512, CRC32, SHA3-256 and SHA3-512. |
| POST/api/v1/password.php | Generate cryptographically random passwords. Configurable length, count, character classes and ambiguous-character exclusion. Reports entropy in bits. |
| POST/api/v1/json-format.php | Validate, pretty-print, minify or analyse a JSON document. Returns a structural summary (node counts, max depth, top keys). |
| POST/api/v1/json-to-csv.php | Convert a JSON array of objects to CSV. Configurable delimiter, columns, optional flattening of nested objects. |
| POST/api/v1/url-encode.php | Percent-encode a string for URL use. Component / form / path mode. |
| POST/api/v1/url-decode.php | Decode a percent-encoded URL string. |
| POST/api/v1/case-convert.php | Convert text into 9 case styles in one call: upper, lower, title, sentence, snake, kebab, camel, pascal, constant. |
| POST/api/v1/slugify.php | Convert any text to a URL-safe slug. Unicode-aware, configurable separator, max-length, transliteration. |
| POST/api/v1/sort-lines.php | Sort lines: asc/desc, case sensitivity, dedupe, natural-sort, locale-aware collation. |
| POST/api/v1/lorem-ipsum.php | Generate placeholder text — N paragraphs, sentences or words. |
| POST/api/v1/timestamp.php | Convert any moment in time between formats: epoch ↔ ISO 8601 ↔ human, with timezone support and natural-language parsing. |
| POST/api/v1/date-math.php | Add/subtract a duration from a date, or compute the diff between two dates (with optional business-day count). |
| POST/api/v1/regex-test.php | Match, replace or split with a regex. Returns offsets and capture groups. ReDoS-protected. |
| POST/api/v1/password-strength.php | Score a password (0-4), entropy bits, time-to-crack estimate, concerns and suggestions. |
| POST/api/v1/sitemap-extract.php | Fetch + parse XML sitemaps. SSRF-protected. Optional recursive expansion. lastmod/changefreq/priority metadata. |
| POST/api/v1/credit-card-validate.php | Luhn check + brand detection (Visa, MC, Amex, Discover, JCB, Diners, UnionPay, Maestro, RuPay). PAN never logged. |
| POST/api/v1/xml-validate.php | Validate XML well-formedness + optional XSD schema check. Error reports with line/column. |
| POST/api/v1/text-diff.php | Diff two strings by line/word/char. Unified diff + structured changes + similarity score. |
| POST/api/v1/stats.php | Descriptive statistics for a list of numbers — mean / median / mode / stddev / percentiles / IQR / geometric / harmonic. |
| POST/api/v1/number-base.php | Convert numbers between bases 2..36 plus Roman numerals. Big-int safe. |
| POST/api/v1/finance-calc.php | Multi-mode financial calculations: loan, compound_interest, simple_interest, discount, tip, sales_tax, roi, percentage, markup. |
| POST/api/v1/color-convert.php | Convert any color into hex / rgb / rgba / hsl / hsv / cmyk + closest CSS named color + WCAG luminance & contrast. |
| POST/api/v1/age-calc.php | Age in years/months/days from DOB, next birthday, zodiac, generation, total days/seconds. |
| POST/api/v1/aspect-ratio.php | Compute reduced aspect ratio from width × height, or scale a dimension to a target ratio. |
| POST/api/v1/url-metadata.php | Fetch URL and extract title / description / OpenGraph / Twitter Card / canonical / hreflang / JSON-LD / favicon. SSRF-protected. |
| POST/api/v1/meta-tags-generate.php | Generate complete <meta> + OpenGraph + Twitter Card + JSON-LD from inputs. Returns ready-to-paste HTML + SEO score. |
| POST/api/v1/text-cleanup.php | Apply chained cleanup ops: trim, dedupe, strip HTML/emoji/URLs, normalize quotes/dashes, etc. |
| POST/api/v1/random-gen.php | Multi-mode CSPRNG: number, string, word, list-picker, team-balancer, dice, coin, country, UUID v4/v7. |
| POST/api/v1/hashtag-tools.php | Extract, remove, generate (from text) or format hashtags. Unicode-aware. |
| POST/api/v1/dns-lookup.php | Resolve DNS records: A, AAAA, MX, TXT, NS, CNAME, SOA, CAA (+ optional PTR/SRV). Reverse PTR for A. |
| POST/api/v1/ssl-check.php | Inspect TLS certificate: subject, issuer, validity, fingerprint, alt names, chain, days remaining. SSRF-protected. |
| POST/api/v1/jwt-decode.php | Decode JWT — header, payload, expiry status. Optional HS256/384/512 (secret) or RS256/384/512 (public key) signature verify. Token never logged. |
| More endpoints coming. Tell us which tool you want next. | |
All endpoints (except /health.php) are subject to per-IP rate limits: 60 requests per minute and 600 requests per hour. Each response carries X-RateLimit-Limit-Minute, X-RateLimit-Remaining-Minute, X-RateLimit-Limit-Hour, X-RateLimit-Remaining-Hour and X-RateLimit-Reset headers. When exceeded the API returns 429 with a Retry-After header — back off for that many seconds.
Use mate.tools as an MCP server inside Claude Desktop, Claude Code, Cursor, Windsurf, or any other MCP-compatible client. Add to your client's config:
{
"mcpServers": {
"mate-tools": {
"command": "npx",
"args": ["-y", "@mate-tools/mcp-server"]
}
}
}
That's it. No global install, no git clone. npx fetches the latest version on first run and caches it.
npm: @mate-tools/mcp-server · Source & full install guide: /api/mcp/
For ChatGPT Custom GPT Actions, Microsoft Copilot Studio, Perplexity Spaces, or any agent framework that consumes OpenAPI:
https://mate.tools/api/openapi.json
Discoverable site manifest for crawling LLMs: https://mate.tools/llms.txt
| Base URL | https://mate.tools/api/v1/ |
|---|---|
| Methods | Most endpoints accept POST with JSON. Some allow GET for trivial probes. |
| Encoding | UTF-8 only. Bodies are JSON or application/x-www-form-urlencoded. |
| Body size | Capped at 1 MB per request. Returns 413 above that. |
| Auth | None. Anonymous traffic only. Rate limits enforced by Cloudflare. |
| CORS | Open: Access-Control-Allow-Origin: *. |
| Indexing | API responses send X-Robots-Tag: noindex. The endpoint URLs are not advertised in sitemap.xml. |
| Errors | Non-200 responses return {"error":{"code":N,"message":"...","field":"..."}}. |
.php extension on endpoint URLs is intentional. v1 routes directly to PHP-FPM with no rewrite layer in front, which keeps the API dependency-free and rock-solid. Future versions may add clean URLs.
This API is free and unlimited for honest use — automation, AI agents, personal projects, internal tooling, hobby apps and small commercial workloads are all welcome. Cloudflare protects the underlying infrastructure from abuse. Please don't:
X-Throttle-After-Ms header (when present) to back off.The path includes the major version (/v1/). Breaking changes ship under a new path. Within a major version, only additive changes (new fields, new endpoints) are permitted.