Back to Studio

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.

Required HeaderSecure
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.

POSThttp://localhost:3000/api/convert

Request Parameters

Customize your PDF output by passing these fields in your form data. Only file is required.

ParameterTypeDescription
fileRequired
File (Binary)The .ipynb notebook file you want to convert. Max size: 50MB (Pro).
themestringColor theme for the output. Valid options: "light" (default) or "dark".
autoFormatbooleanIf "true", automatically formats Python code using Ruff before rendering.
hideCodebooleanIf "true", hides all code cells and only displays markdown and output plots/tables.
headerText / footerTextstringCustom 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

Python (requests)
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 (Command Line)
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.

400

Bad Request

Missing the required file, or the file is not a valid Jupyter Notebook (.ipynb).

401

Unauthorized

Missing or invalid API key in headers, or your Pro subscription has expired.

413

Payload Too Large

The uploaded file exceeds the 50MB limit for Pro users.

500

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)