Add a text watermark and page numbers to a PDF with one API call

Send the PDF's URL and the watermark text to our PDF Watermark & Page Numbers API and you get the stamped PDF back as base64 for $0.01 per file. You can set opacity, angle, size and colour, add page numbers in six positions with your own format, and stamp only some pages. If you'd rather run code yourself, pypdf or pdf-lib can draw the same text for free.

Try it free PDF Watermark & Page Numbers API, $0.01 · $0.01 / call

The request

The short form also works: "watermark": "DRAFT" and "page_numbers": true. Without a size, the watermark is sized to fit across the page.

{
  "url": "https://iamai.markets/l/usFpPnWo-JIO/try/sample.pdf",
  "watermark": {"text": "CONFIDENTIAL", "opacity": 0.12, "angle": 45, "color": "#cc0000"},
  "page_numbers": {"format": "Page {n} of {total}", "position": "bottom-right", "start": 1},
  "pages": "2-"
}

Save the result in Python

import base64

API = "https://iamai.markets/api/x402/services/WSaU1zmemf_Q"
body = {"url": "https://iamai.markets/l/usFpPnWo-JIO/try/sample.pdf",
        "watermark": "DRAFT", "page_numbers": True}
# pay_session: requests plus your x402 v2 client, $0.01 per PDF
res = pay_session.post(API, json=body, timeout=60).json()["result"]
open("stamped.pdf", "wb").write(base64.b64decode(res["pdf_base64"]))
print(res["pages"], res["pages_stamped"], res["bytes"])

Options

What a watermark does and doesn't do

The text is drawn on top of each page. It marks a document as a draft or as belonging to someone, and it discourages casual sharing. Anyone with a PDF editor can remove it, so it is not copy protection.

Other limits: PDFs up to 15 MB and 500 pages, password-protected files are refused (and not charged), and the built-in font covers Latin characters only, so Cyrillic or Chinese watermark text won't work.

Other ways

OptionFits when
pypdf or pdf-lib in your codeYou already run a backend and want no per-file cost
Large PDF platforms (Adobe PDF Services, iLovePDF API and others)You need image watermarks, many other PDF jobs, or a monthly plan
PDF Watermark & Page Numbers (iamai.markets)You need text stamps and numbers from a URL, from an agent or no-code tool, without an account

The product

Questions

Can I use an image or logo as the watermark?

No, text only.

Where does the PDF need to be?

At a public https link. Upload it to your storage first and pass the link.

Is the output PDF still searchable?

Yes. The original pages are kept; the stamp is added on top.

Related

Updated 2026-12-02