API Documentation

FractAPI at fractapi.xyz. Paid routes accept POST with JSON and require MPP on production. Free smoke checks: GET /api/test, GET /api/health.

Quick Start (paid requests)

Prefer the official Tempo CLI on macOS/Linux/WSL. The mppx account command may report Unsupported platform: win32 on native Windows.

# Tempo CLI (recommended) — see https://docs.tempo.xyz/cli/
curl -fsSL https://tempo.xyz/install | bash
tempo wallet login
tempo wallet fund

tempo request -X POST \
  --json '{ "text": "hello world" }' \
  https://fractapi.xyz/api/qr
POST/api/scrape$0.001

Scrape a web page. Set mode to "markdown" for LLM-friendly output.

Request Body
{ "url": "https://example.com", "mode": "text" }
Response
{
  "success": true,
  "data": {
    "title": "Example Domain",
    "text": "This domain is for use in illustrative examples...",
    "links": ["https://www.iana.org/domains/example"],
    "wordCount": 28
  },
  "meta": { "latencyMs": 420, "cost": "0.001", "currency": "USDC" }
}
POST/api/convert$0.001

Convert between formats: markdown→html, csv→json, yaml→json, xml→json.

Request Body
{ "input": "# Hello\nWorld", "from": "markdown", "to": "html" }
Response
{
  "success": true,
  "data": { "result": "<h1>Hello</h1>\n<p>World</p>", "format": "html" },
  "meta": { "latencyMs": 5, "cost": "0.001", "currency": "USDC" }
}
POST/api/meta$0.001

Extract OG tags, favicon, Twitter cards, and theme color from any URL.

Request Body
{ "url": "https://github.com" }
Response
{
  "success": true,
  "data": {
    "title": "GitHub",
    "description": "Where the world builds software.",
    "image": "https://github.githubassets.com/images/og-image.png",
    "favicon": "https://github.githubassets.com/favicons/favicon.svg",
    "siteName": "GitHub",
    "twitter": { "card": "summary_large_image", "site": "@github" }
  },
  "meta": { "latencyMs": 300, "cost": "0.001", "currency": "USDC" }
}
POST/api/hash$0.001

Hash text with SHA-256, SHA-512, or MD5.

Request Body
{ "text": "hello world", "algorithm": "sha256" }
Response
{
  "success": true,
  "data": {
    "hash": "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9",
    "algorithm": "sha256",
    "inputLength": 11
  },
  "meta": { "latencyMs": 1, "cost": "0.001", "currency": "USDC" }
}
POST/api/diff$0.001

Compare two texts. Modes: lines, words, chars.

Request Body
{ "original": "hello world", "modified": "hello mars", "mode": "words" }
Response
{
  "success": true,
  "data": {
    "changes": [
      { "value": "hello " },
      { "value": "world", "removed": true },
      { "value": "mars", "added": true }
    ],
    "stats": { "additions": 1, "deletions": 1, "unchanged": 1 },
    "patch": "  hello\n- world\n+ mars"
  },
  "meta": { "latencyMs": 2, "cost": "0.001", "currency": "USDC" }
}
POST/api/placeholder$0.001

Generate mock data: users, addresses, companies, text, uuids. Supports en, ru, de, fr, es, ja.

Request Body
{ "type": "user", "count": 3, "locale": "en" }
Response
{
  "success": true,
  "data": {
    "type": "user",
    "count": 3,
    "items": [
      { "id": "a1b2c3...", "firstName": "Emma", "lastName": "Johnson", "email": "emma.johnson@acme.com", "age": 29 },
      ...
    ]
  },
  "meta": { "latencyMs": 1, "cost": "0.001", "currency": "USDC" }
}
POST/api/minify$0.001

Minify CSS, JavaScript, or HTML code.

Request Body
{ "code": "body {\n  color: red;\n}", "language": "css" }
Response
{
  "success": true,
  "data": {
    "minified": "body{color:red}",
    "originalSize": 24,
    "minifiedSize": 14,
    "savings": "41.7%"
  },
  "meta": { "latencyMs": 5, "cost": "0.001", "currency": "USDC" }
}
POST/api/uptime$0.002

Check URL availability, latency, HTTP status, and SSL certificate details.

Request Body
{ "url": "https://google.com", "method": "HEAD" }
Response
{
  "success": true,
  "data": {
    "url": "https://google.com",
    "status": 200,
    "alive": true,
    "latencyMs": 120,
    "ssl": { "valid": true, "issuer": "Google Trust Services", "daysUntilExpiry": 62 },
    "redirectedTo": "https://www.google.com/"
  },
  "meta": { "latencyMs": 150, "cost": "0.002", "currency": "USDC" }
}
POST/api/qr$0.001

Generate a QR code. Set format to "dataurl" for base64, or "png" for binary.

Request Body
{ "text": "https://fractapi.xyz", "format": "dataurl", "width": 400 }
Response
{
  "success": true,
  "data": { "dataUrl": "data:image/png;base64,iVBORw0K..." },
  "meta": { "latencyMs": 50, "cost": "0.001", "currency": "USDC" }
}
POST/api/dns$0.001

Query DNS records. Supports A, AAAA, MX, NS, TXT, CNAME, SOA.

Request Body
{ "domain": "google.com", "type": "MX" }
Response
{
  "success": true,
  "data": {
    "domain": "google.com",
    "type": "MX",
    "records": [{ "name": "google.com.", "data": "10 smtp.google.com." }],
    "ttl": 300
  },
  "meta": { "latencyMs": 100, "cost": "0.001", "currency": "USDC" }
}
POST/api/validate-email$0.002

Validate email format, check MX records, detect disposable domains.

Request Body
{ "email": "user@example.com" }
Response
{
  "success": true,
  "data": {
    "email": "user@example.com",
    "valid": true,
    "reason": "Valid email address",
    "details": { "formatValid": true, "domainExists": true, "disposable": false }
  },
  "meta": { "latencyMs": 350, "cost": "0.002", "currency": "USDC" }
}
POST/api/whois$0.002

Look up domain registration data via the RDAP protocol.

Request Body
{ "domain": "google.com" }
Response
{
  "success": true,
  "data": {
    "domain": "google.com",
    "available": false,
    "parsed": {
      "registrar": "MarkMonitor Inc.",
      "createdDate": "1997-09-15T04:00:00Z",
      "expiryDate": "2028-09-14T04:00:00Z",
      "nameServers": ["ns1.google.com", "ns2.google.com"]
    }
  },
  "meta": { "latencyMs": 500, "cost": "0.002", "currency": "USDC" }
}
POST/api/summarize$0.003

Summarize text using AI (GPT-4o-mini). Formats: "paragraph", "bullets", "tweet".

Request Body
{ "text": "Your long text here...", "format": "bullets" }
Response
{
  "success": true,
  "data": {
    "summary": "• Key point one...\n• Key point two...\n• Key point three...",
    "format": "bullets",
    "originalLength": 5000,
    "summaryLength": 150
  },
  "meta": { "latencyMs": 800, "cost": "0.003", "currency": "USDC" }
}
POST/api/translate$0.003

Translate text to any language with auto-detection. Uses ISO 639-1 codes.

Request Body
{ "text": "Hello, world!", "to": "es" }
Response
{
  "success": true,
  "data": {
    "original": "Hello, world!",
    "translated": "¡Hola, mundo!",
    "from": "en",
    "to": "es"
  },
  "meta": { "latencyMs": 600, "cost": "0.003", "currency": "USDC" }
}
POST/api/screenshot$0.005

Capture a screenshot of a web page. Coming soon.

Request Body
{ "url": "https://example.com", "width": 1280, "height": 720 }
Response
Coming soon — requires dedicated rendering infrastructure.

Free endpoints (no MPP)

Use these to verify the deployment without a Tempo wallet.

Health
GET https://fractapi.xyz/api/health
Smoke test
GET https://fractapi.xyz/api/test
POST https://fractapi.xyz/api/test  (JSON body echoed)