Rotate PDF Pages API
Send a PDF URL and the turns you need, get back the same PDF with every page the right way up. Made for sideways scans, phone uploads and landscape tables.
- Free plan
- No credit card
Request
curl -X POST https://apdf.io/api/pdf/page/rotate \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d rotations[0][angle]="-90" \
-d rotations[0][pages]="1-3" \
-d rotations[1][angle]="+180" \
-d rotations[1][pages]="z"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('rotations[0][angle]', '-90');
data.append('rotations[0][pages]', '1-3');
data.append('rotations[1][angle]', '+180');
data.append('rotations[1][pages]', 'z');
fetch('https://apdf.io/api/pdf/page/rotate', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/rotate', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'rotations[0][angle]' => '-90',
'rotations[0][pages]' => '1-3',
'rotations[1][angle]' => '+180',
'rotations[1][pages]' => 'z'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/rotate',
{
'file' => 'FILE_URL',
'rotations[0][angle]' => '-90',
'rotations[0][pages]' => '1-3',
'rotations[1][angle]' => '+180',
'rotations[1][pages]' => 'z'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/rotate',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'rotations[0][angle]': '-90',
'rotations[0][pages]': '1-3',
'rotations[1][angle]': '+180',
'rotations[1][pages]': 'z'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"rotations[0][angle]": "-90",
"rotations[0][pages]": "1-3",
"rotations[1][angle]": "+180",
"rotations[1][pages]": "z"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/rotate")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("rotations[0][angle]", "-90")
.add("rotations[0][pages]", "1-3")
.add("rotations[1][angle]", "+180")
.add("rotations[1][pages]", "z")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/rotate")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Every page
the right way up.
Each rotation pairs an angle with a set of pages.
Send several to fix a whole scan in one call.
- +90
- A quarter turn clockwise
- -90
- A quarter turn counterclockwise
- +180
- Half a turn, for pages upside down
- 90
- No sign: set the page to 90°, whatever it was
- (no pages)
- The angle applies to every page
No more tilted heads.
Sideways pages slow every reader down. Fix them once, in your pipeline, before anyone opens the file.
Scanner output
Pages fed into the scanner the wrong way come out sideways or upside down. Turn them upright before archiving.
Phone uploads
Documents photographed on a phone often end up sideways in the PDF. Fix the orientation before the review starts.
Wide tables
Landscape tables in a portrait report are hard to read on screen. Turn just those pages so they read naturally.
Field paperwork
Signed delivery notes come back scanned in every direction. Turn them upright before they reach your records.
Rotate from anywhere.
Turn pages right where your files already arrive.
One account and one monthly allowance behind every route.
One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.
POST /api/pdf/page/rotate
Pick the action in any Zap and map files from earlier steps. No code and no servers to run.
Rotate PDF Pages
Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.
Rotate PDF pages
Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.
rotate-pdf-pages
1,000 rotated PDFs
a month. Free.
Start on the free plan and move up only when your volume does — up to 1,000,000 operations a month on Business.
- One call is one operation, however many pages.
- Only calls that do the work are counted.
- Hard limits, so no surprise overage charges.
Rotating pages, answered
Rotate pages tutorials
Fix Sideways PDF Scans: Auto-Rotate Pages with Python
Learn how to automatically fix sideways or upside-down PDF pages from mobile uploads. Using Python and the Apdf Rotate API, you can detect and correct orientation issues in scanned documents, making them ready for review workflows.
Turn Scanned Invoices into Structured Data with an Agent
OCR reads tabular scans in scrambled order — the wall every regex parser dies against, and exactly where the agent shines: it reassembles vendor, number, date and line items from the mess, cross-checks the sums against each stated total, and flags mismatches for human eyes instead of your books.
OCR Scanned PDFs by Asking Claude
That folder of scans — old leases, signed contracts, photographed paperwork — becomes searchable conversationally: Claude checks the text layer, runs the OCR job through the Apdf MCP tools, and answers questions from the recovered text with page-level receipts.
Your code made the PDF.
Then it went dark.
Opened, read, signed or ignored — you never see any of it. Send the PDFs you generate as personal links, and every open, page read, comment and signature comes back to your software as a webhook. Need it signed? Same link. Same account, same API key, one more call.
API · Webhook · MCP