Document to text: Word, Excel, PowerPoint, PDF
No account. Pay by card from $1 and your key appears right after payment. Get a key by card
Document to text API: code samples in curl, Python and Node, and monthly plans.
Convert a document to text or Markdown: Word (.docx), Excel (.xlsx), PowerPoint (.pptx), PDF, plain UTF-8 text (.txt/.md/.csv/.json), and scans or images (PNG, JPEG, WebP) by OCR. Give a public URL or POST the file (10 MB default; 10-20 MB URLs retry once at 20 MB; images 3 MB). Old formats and protected files fail uncharged. Use for attachments, scans and spreadsheets in an agent, RAG or workflow.
Inputs
| Name | Type | Description |
|---|---|---|
url (required) | string | Absolute public http(s) URL of the file (or send the file in a POST body instead) |
format | string | markdown (default: headings, lists and tables kept) or text. One of: markdown, text. |
maxChars | integer | Maximum characters of text returned (1000-200000, default 50000) |
maxBytes | integer | Maximum file size in MB for a URL read (10 default, up to 20). If omitted, a file over 10 MB is retried once at 20 MB; an explicit value is respected |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://glyphtools.com/document/text?url=https%3A%2F%2Fcalibre-ebook.com%2Fdownloads%2Fdemos%2Fdemo.docx"
Node.js
const r = await fetch("https://glyphtools.com/document/text?url=https%3A%2F%2Fcalibre-ebook.com%2Fdownloads%2Fdemos%2Fdemo.docx", {
headers: { Authorization: "Bearer adt_…" },
});
const data = await r.json(); // 402 until the key is in the header
Python
import requests
r = requests.get("https://glyphtools.com/document/text?url=https%3A%2F%2Fcalibre-ebook.com%2Fdownloads%2Fdemos%2Fdemo.docx", headers={"Authorization": "Bearer adt_…"}, timeout=60)
data = r.json()
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"url": "https://calibre-ebook.com/downloads/demos/demo.docx",
"type": "docx",
"format": "markdown",
"chars": 1000,
"truncated": true,
"text": "# Demonstration of DOCX support in calibre\n\nThis document demonstrates the ability of the calibre DOCX Input plugin to convert the various typographic features in a Microsoft Word (2007 and newer) document."
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is document_text, paid from the first call:
https://glyphtools.com/mcp