Automate with PyPaper API.
Integrate professional Jupyter Notebook to PDF conversion into your apps, scripts, and CI/CD pipelines with our lightning-fast REST API. Native Vietnamese support included.
Authentication
API access is an exclusive feature for Pro Plan subscribers. All API requests must include your private API key in the headers to authenticate.
x-api-keyYour unique API key starting with pp_...The Endpoint
Our conversion engine exposes a single, powerful endpoint. Send a POST request with multipart/form-data to convert your notebooks.
http://localhost:3000/api/convertRequest Parameters
Customize your PDF output by passing these fields in your form data. Only file is required.
| Parameter | Type | Description |
|---|---|---|
fileRequired | File (Binary) | The .ipynb notebook file you want to convert. Max size: 50MB (Pro). |
theme | string | Color theme for the output. Valid options: "light" (default) or "dark". |
autoFormat | boolean | If "true", automatically formats Python code using Ruff before rendering. |
hideCode | boolean | If "true", hides all code cells and only displays markdown and output plots/tables. |
headerText / footerText | string | Custom text to appear on the top right (header) or bottom right (footer) of every page. |
marginTop, marginLeft, etc. | string (mm) | Page margins in millimeters. Example: "15" for 15mm. |
Code Examples
import requests
url = "http://localhost:3000/api/convert"
headers = {"x-api-key": "pp_your_api_key_here"}
# Prepare the file and optional parameters
files = {'file': open('analysis.ipynb', 'rb')}
data = {
'theme': 'light',
'autoFormat': 'true',
'headerText': 'Q3 Financial Report'
}
response = requests.post(url, headers=headers, files=files, data=data)
if response.status_code == 200:
with open('report.pdf', 'wb') as f:
f.write(response.content)
print("PDF successfully saved!")
else:
print(f"Error: {response.json()}")curl -X POST http://localhost:3000/api/convert \ -H "x-api-key: pp_your_api_key_here" \ -F "file=@analysis.ipynb" \ -F "theme=dark" \ -F "hideCode=true" \ --output result.pdf
* On Windows PowerShell, use curl.exe instead of just curl.
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of a request. Errors always return a JSON object with an error key.
Bad Request
Missing the required file, or the file is not a valid Jupyter Notebook (.ipynb).
Unauthorized
Missing or invalid API key in headers, or your Pro subscription has expired.
Payload Too Large
The uploaded file exceeds the 50MB limit for Pro users.
Internal Server Error
Something went wrong on our end during the conversion process.
Ready to automate your reports?
Upgrade to Pro to get your API key instantly and start converting notebooks at scale.
Get API Access ($2/mo)