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 URL | https://nepalipdf.com |
|---|---|
| Upload | multipart/form-data, the PDF in a field named file |
| Limits | 20 MB and 50 pages per PDF; see limits |
| Errors | JSON: {"error": "…"} with a 4xx or 5xx status |
| Privacy | Nothing 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.
| Field | Required | Description |
|---|---|---|
file | yes | The PDF |
file | yes | The PDF. |
ascii_digits | no | true to write Nepali digits (०१२३) as 0123. Default false. |
tables | no | How tables are found: auto (default, from ruling lines), text (from text alignment, for tables without lines) or none. |
ocr | no | Scanned 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.
| Field | Required | Description |
|---|---|---|
file | yes | The PDF |
file | yes | The PDF. |
format | no | text (default) or markdown. Plain text separates table columns with tabs; Markdown keeps headings and writes tables as pipe tables. |
ascii_digits | no | As above. |
tables | no | As above. |
ocr | no | As 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.
| Field | Required | Description |
|---|---|---|
file | yes | A 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_size | no | a4 (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.
| Field | Required | Description |
|---|---|---|
file | yes | The PDF (up to 20 MB and 200 pages). |
pages | no | Which 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-Pages | Number of pages in the PDF. |
|---|---|
X-Tables | Number of tables found. |
X-Flags | How 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-Details | What 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-Pages | Pages 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-Seconds | Time 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
| Status | Meaning |
|---|---|
400 | Missing file or an invalid field value. |
413 | The file is larger than 20 MB, or has more than 50 pages. |
415 | The file is not a PDF. |
422 | The PDF took longer than 120 seconds to convert and was stopped. |
429 | Too many conversions from your address, or your previous conversion is still in progress. Wait for the number of seconds in the Retry-After header. |
500 | The PDF could not be converted. |
503 | The 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 PDF | 20 MB, 50 pages, 120 seconds of conversion time |
|---|---|
| Per address | 20 conversions per 10 minutes and 100 per day, shared with the website |
| At once | 1 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.