Nepali PDF API

Convert Nepali PDFs to Word, plain text or Markdown from your own code. The same engine as the website, over plain HTTP. No sign-up and no API key.

Overview

Base URLhttps://nepalipdf.com
Uploadmultipart/form-data, the PDF in a field named file
Limits20 MB and 50 pages per PDF; see limits
ErrorsJSON: {"error": "…"} with a 4xx or 5xx status
PrivacyNothing is kept: files are deleted as soon as the response is sent

Requests are processed one at a time; if the service is busy, your request waits its turn. Allow a generous timeout (a few minutes) for long documents.

PDF to Word

POST /api/v1/pdf-to-word

Returns the Word document (.docx) as the response body.

mdash; or a photo or scan of a page (JPG, PNG or WebP), which is read with OCR whatever ocr says.
FieldRequiredDescription
fileyesThe PDF
fileyesThe PDF.
ascii_digitsnotrue to write Nepali digits (०१२३) as 0123. Default false.
tablesnoHow tables are found: auto (default, from ruling lines), text (from text alignment, for tables without lines) or none.
ocrnoScanned pages: auto (default) reads pages that have no text layer with OCR; always reads every page that way; off leaves scanned pages out. At most 3 pages per file are read; the rest are flagged.
curl -X POST https://nepalipdf.com/api/v1/pdf-to-word \
  -F "file=@notice.pdf" \
  -o notice.docx

PDF to text or Markdown

POST /api/v1/pdf-to-text

Returns UTF-8 text as the response body: text/plain or text/markdown.

mdash; or a photo or scan of a page (JPG, PNG or WebP), which is read with OCR whatever ocr says.
FieldRequiredDescription
fileyesThe PDF
fileyesThe PDF.
formatnotext (default) or markdown. Plain text separates table columns with tabs; Markdown keeps headings and writes tables as pipe tables.
ascii_digitsnoAs above.
tablesnoAs above.
ocrnoAs above.
curl -X POST https://nepalipdf.com/api/v1/pdf-to-text \
  -F "file=@notice.pdf" \
  -F "format=markdown" \
  -o notice.md

Merge PDFs and images

POST /api/v1/merge-pdf

Returns one PDF with every page of every file, in the order the files were sent. PDF pages are copied unchanged; each image becomes one page.

FieldRequiredDescription
fileyesA PDF, or a JPG, PNG or WebP image. Repeat the field once per file, in the order you want them merged (up to 10 files, 50 MB in total, 200 pages).
image_sizenoa4 (default): each image is fitted onto an A4 page, landscape for wide images. original: the page is the image's own size.
curl -X POST https://nepalipdf.com/api/v1/merge-pdf \
  -F "file=@notice.pdf" \
  -F "file=@annex.pdf" \
  -F "file=@photo.jpg" \
  -o merged.pdf

The response carries X-Pages and X-Files headers. A password-protected PDF is refused with 422.

Split and organise a PDF

POST /api/v1/split-pdf

Picks, reorders and rotates pages of one PDF. One selection returns a PDF; several return a ZIP with one PDF each. Pages are copied unchanged.

FieldRequiredDescription
fileyesThe PDF (up to 20 MB and 200 pages).
pagesnoWhich pages, in order: 1-3,7, 5- (to the end), 6-4 (backwards), 3@90 (rotate 90, 180 or 270 degrees). Separate PDFs with ;, e.g. 1-3;4-6;7-. Without it, every page becomes its own PDF.
curl -X POST https://nepalipdf.com/api/v1/split-pdf \
  -F "file=@notice.pdf" \
  -F "pages=1-3;4-" \
  -o parts.zip

Response headers

Both endpoints add a short summary of the conversion:

X-PagesNumber of pages in the PDF.
X-TablesNumber of tables found.
X-FlagsHow many things are worth checking by eye. 0 means every character was identified exactly; anything else means some text may be wrong, for example because the PDF uses a font the service has not seen before.
X-Flag-DetailsWhat those things are: a JSON list of messages, percent-encoded (decode with urllib.parse.unquote or decodeURIComponent, then parse the JSON). A very long list is cut short; X-Flags always has the full count.
X-OCR-PagesPages that had no text layer (scans) and were read by OCR, e.g. 2,3; empty when none. Check those pages, especially numbers.
X-Elapsed-SecondsTime spent converting.

Python example

import requests

with open("notice.pdf", "rb") as pdf:
    response = requests.post(
        "https://nepalipdf.com/api/v1/pdf-to-text",
        files={"file": pdf},
        data={"format": "text"},
        timeout=300,
    )
response.raise_for_status()
print(response.text)
print("flags:", response.headers["X-Flags"])

Errors

StatusMeaning
400Missing file or an invalid field value.
413The file is larger than 20 MB, or has more than 50 pages.
415The file is not a PDF.
422The PDF took longer than 120 seconds to convert and was stopped.
429Too many conversions from your address, or your previous conversion is still in progress. Wait for the number of seconds in the Retry-After header.
500The PDF could not be converted.
503The service is busy. Try again after the Retry-After header's delay.

Limits and fair use

The API is free and has no key, so it has limits that keep it available for everyone:

Per PDF20 MB, 50 pages, 120 seconds of conversion time
Per address20 conversions per 10 minutes and 100 per day, shared with the website
At once1 conversion in progress per address; send the next file when the previous response arrives

Send files one after another, not in parallel. Scanned pages take much longer than digital ones, so at most 3 are read with OCR per file.