Endpoints

PDF to Markdown API: Parse Any Document

A PDF, Word, HTML or text file you already have, as markdown.

Parse reads a document you already have and returns its text as markdown. It takes the file itself, not a link. For a document that lives at a URL, Scrape reads PDFs and web pages the same way, and your agent can call the parse tool on the MCP server.

POST /v1/parse

Request

Send one file as multipart/form-data, in a field named file. There is no JSON body.

import requestswith open('report.pdf', 'rb') as f:    r = requests.post(        'https://api.snoopscan.com/v1/parse',        headers={'Authorization': 'Bearer sk_YOUR_KEY'},        files={'file': f},    )print(r.json()['data']['markdown'])
import { readFile } from 'node:fs/promises';const form = new FormData();form.append('file', new Blob([await readFile('report.pdf')]), 'report.pdf');const r = await fetch('https://api.snoopscan.com/v1/parse', {  method: 'POST',  headers: { Authorization: 'Bearer sk_YOUR_KEY' },  body: form,});console.log((await r.json()).data.markdown);
curl -X POST https://api.snoopscan.com/v1/parse \  -H 'Authorization: Bearer sk_YOUR_KEY' \  -F 'file=@report.pdf'
Returns the markdown, the page count and the kind of file.

What it reads

KindFilesHow it is read
pdf.pdfPage by page.
docx.docxBy paragraph and table.
html.html, .htmWith the converter the Scrape endpoint uses.
text.txt, .md, .markdownPassed through.

Any other file type is refused with INVALID_REQUEST, as is an empty file or one over the size limit. See Errors.

Response

{    "success": true,    "data": {        "markdown": "# Quarterly report\n\n…",        "pages": 12,        "kind": "pdf",        "filename": "report.pdf",        "cost": {            "pdf_pages": 12,            "credits": 2        }    }}
A success holds the markdown and what the call was charged.

Billing

Pages are the unit. A PDF counts its real pages. A Word or HTML file counts one page for every 3,000 characters, rounded up, so a long Word document is not billed as one page. The rate is 1 credit for every 10 pages, or part of 10. A failed request is not charged. See Credits for every rate.

SDKs

The Python and JavaScript clients have a parse method that takes a file path, bytes or a URL, and sends the upload for you.

Related