Edit the text inside a PDF that already exists.

One API call changes the words and leaves everything else exactly where it was: the fonts the document embeds, the layout, the other 99 % of the page. Every change is verified before it comes back. Built for developers and for AI agents.

Get a free keyAPI reference200 pages a month free · no card
curl -sS https://api.niubai.vip/v1/edit -H "Authorization: Bearer sk_live_…" \
  -F file=@invoice.pdf \
  -F 'edits=[{"find": "$4,200", "replace": "$4,800"}]'
→ status: done · 1 change · font: document's own · collateral pixels: 0

How it works

Three steps, no SDK required. SDKs and an MCP server exist if you want them.

Get a key

Enter an email below. The free plan has 200 pages a month and needs no card.

Send the PDF and the edits

Upload the file or point at a URL, and list what to find and what to put there. Scope by page, region, anchor or occurrence.

Get the verified result

The edited PDF, plus per change: the font used, the pixel check, a before/after preview. A change that cannot be verified is rolled back, not returned.

Real output, not mock-ups

Each pair below was produced by the API itself over a real document. The request that made it is next to it.

Replace a figure in a Word-made invoice{"edits": [{"find": "$4,200", "replace": "$4,800"}]}
beforebefore
afterafter
Redact a card number, with the bytes actually gone{"edits": [{"op": "redact", "find": "4111 1111 1111 1111"}]}
beforebefore
afterafter
A longer sentence reflows the paragraph instead of overflowing{"edits": [{"find": "…", "replace": "…", "fit": "reflow"}]}
beforebefore
afterafter

Ten examples with their requests →

Five operations

Exact, case-insensitive, word and regex matching; OCR for scanned pages; batch mode for one template and many records.

replace

Rewrite a phrase in the document's own font. Longer text is fitted, or reflows the paragraph.

delete

Remove a phrase and tidy the punctuation and spacing it leaves behind.

redact

Remove text for real: content stream, image pixels, metadata, outlines. Reports anywhere else the string still occurs.

insert

Add text at a point or after an anchor phrase, in the surrounding style.

form

Fill AcroForm fields by name, read the value back, optionally flatten.

For agents: an MCP server

Claude Code, Cursor and Claude Desktop can edit PDFs through the same API with five tools. Local files are uploaded for you; every tool answers with what changed and a preview.

claude mcp add --env PDFEDIT_API_KEY=sk_live_… pdfedit -- npx -y @niubai/pdfedit-mcp

No key at all? The hosted endpoint answers anonymous callers with 20 pages a day per IP, output watermarked:
https://pdfedit-mcp-remote.niubai-pdfedit-remote-worker.workers.dev/mcp

SDKs: npm install @niubai/pdfedit · pip install pdfedit · source and examples at https://github.com/zp130221/pdfedit-mcp.

Pricing

Per page edited. A page is one page of the document an applied edit touched; OCR pages count as five. Prices in USD, tax added at checkout where the buyer's country requires it. Also: a 5,000-page pack for $19, never expires.

Free

$0

200 pages / month

No card. Flagged documents watermarked.

Get a free key

Try it

$4.90 once

500 pages, never expire

Pay once, no subscription.

Growth

$49 / month

20,000 pages

Watermark control on flagged documents.

Scale

$149 / month

100,000 pages

Highest concurrency and rate limits.

Subscriptions renew monthly and can be cancelled any time from the customer portal link on the receipt; the plan stays until the end of the paid period. Payments are handled by Creem, the merchant of record. See the refund policy.

Get a free key

One account per email. We'll email you a sign-in link; keys are made on your account page.

Questions

What counts as a page?

A page of the document that an applied edit touched. One edit on one page of a 300-page contract costs one page. Pages that needed OCR count as five.

Does it change anything I did not ask for?

It is built not to. Every change is rendered before and after and compared pixel by pixel outside its own area; if anything else on the page moved, the change is rolled back and the API says why. A request with one failing edit returns nothing rather than a document that is subtly wrong.

Which fonts does it use?

The document's own font when enough of it is embedded, a metric-compatible substitute when it is not, an approximation as a last resort. The response tells you which one you got for every change.

What about scans?

Pages without a text layer go through OCR; a replacement on such a page is drawn as pixels and verified by re-rendering. Redaction on a scanned word is refused, because the word is the image.

Where do my documents go?

They are stored only to serve the request and deleted automatically within 24 hours. Job records without document content are kept 30 days for support and billing. Nothing is used for anything else.

Is there a watermark?

Not on an ordinary document, on any plan. A document that looks like an invoice, a contract or a sealed paper is marked "Edited" by default; Growth and Scale accounts that accept the document-integrity terms may turn that off. A redaction is never watermarked.