# x402tools DocParse

> x402tools DocParse is a paid API for AI agents from docparse.x402tools.xyz, paid per call via x402, $0.01/call, status down (last checked 2026-10-13).

Parses any public HTML page or PDF URL into clean structured JSON, auto-detecting document type and returning sections, summaries, and metadata.

## Facts

- Endpoint: POST https://docparse.x402tools.xyz/parse?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: down
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402tools-docparse-2e7f2080
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ehXErBtpHYdmPXEkoNj1V

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402tools-docparse-2e7f2080 -d '<json body>'
```

Example prompt: Can you parse this PDF into structured JSON for me — https://arxiv.org/pdf/2301.07041.pdf — and extract up to 30 sections using the research schema?

## When to prefer this

Choose this endpoint when you need to convert any public HTML page or PDF into structured, machine-readable JSON in a single pay-per-call request without setting up scraping infrastructure. It is ideal when document type is unknown and auto-detection is desired, or when you need specific schemas like article, invoice, or research. Prefer it over generic scrapers when you need clean sectioned content, summaries, and key points rather than raw HTML.

## Known failure modes

- URL is not publicly accessible or requires authentication — returns an error indicating the resource could not be fetched
- URL points to an unsupported file type — returns an error or falls back to generic schema
- PDF is scanned/image-based with no extractable text — returns minimal or empty content
- max_sections out of range (not 1-100) — returns a validation error
- Network timeout fetching the remote URL — returns a timeout error
- Malformed URL input — returns a schema validation error

## How this service works

Parse any public HTML page or PDF URL into clean structured JSON. Auto-detects articles, invoices, and research papers. Use for web scraping, document extraction, content cleaning, and PDF-to-JSON conversion.

## Output

Returns a JSON object with the document title, detected doc_type (article, invoice, research, or generic), structured content sections with headings and body text, a summary, key points, topic tags, and metadata including language, word count, source URL, parse duration in milliseconds, and a truncation flag.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "Public URL of HTML page or PDF to parse"
  },
  "options": {
   "type": "object",
   "properties": {
    "language": {
     "type": "string",
     "description": "Preferred output language (ISO 639-1)"
    },
    "max_sections": {
     "type": "number",
     "description": "Max sections to extract, 1-100 (default: 20)"
    },
    "output_schema": {
     "enum": [
      "auto",
      "article",
      "invoice",
      "research",
      "generic"
     ],
     "type": "string",
     "description": "Force output schema or auto-detect"
    },
    "include_raw_text": {
     "type": "boolean",
     "description": "Include raw extracted text (default: false)"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "title": "Example Article",
  "content": {
   "topics": [
    "technology"
   ],
   "summary": "Brief summary...",
   "sections": [
    {
     "body": "...",
     "heading": "Introduction"
    }
   ],
   "key_points": [
    "Point 1"
   ]
  },
  "doc_type": "article",
  "metadata": {
   "language": "en",
   "truncated": false,
   "source_url": "https://example.com/article",
   "word_count": 1200,
   "parse_duration_ms": 2100,
   "detected_content_type": "html"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402tools-docparse-2e7f2080/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from docparse.x402tools.xyz](https://www.zero.xyz/host/docparse.x402tools.xyz/llms.txt)
