Rotate selected pages by 90, 180, or 270 degrees. MCP tool rotate_pages / HTTP POST /v1/pages/rotate.
Rotate some or all pages clockwise — useful for fixing sideways scans.
At a glance
Section titled “At a glance”| MCP tool | rotate_pages |
| HTTP endpoint | POST /v1/pages/rotate |
| Price | $0.05 |
| Input | One PDF + rotation (+ optional page range) |
| Output | A PDF with the selected pages rotated |
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
file |
file | yes | Source PDF. |
degrees |
90 | 180 | 270 |
yes | Clockwise rotation to apply. |
pages |
page range | no | Pages to rotate. Omit to rotate all pages. |
MCP example
Section titled “MCP example”Rotate pages 1 to 3 of
https://example.com/scan.pdfby 90 degrees.
{ "file": "https://example.com/scan.pdf", "pages": "1-3", "degrees": 90}HTTP example
Section titled “HTTP example”curl -i -X POST https://api.pdfasyougo.com/v1/pages/rotate \ -H "Content-Type: application/json" \ -H "X-PAYMENT: <base64-encoded-payment-payload>" \ -d '{"file":"https://example.com/scan.pdf","pages":"1-3","degrees":90}'import { wrapFetchWithPayment } from 'x402-fetch';import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(process.env.X402_WALLET_PRIVATE_KEY as `0x${string}`);const fetchWithPay = wrapFetchWithPayment(fetch, account);
const res = await fetchWithPay('https://api.pdfasyougo.com/v1/pages/rotate', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ file: 'https://example.com/scan.pdf', pages: '1-3', degrees: 90 }),});console.log((await res.json()).output.url);Response
Section titled “Response”{ "output": { "url": "https://files.pdfasyougo.com/o/2a8f…?token=…", "expires_at": "2026-06-29T12:00:00Z", "pages": 12, "bytes": 98304 }, "operation": "pages.rotate", "cost": "0.05 USDC"}degreesis clockwise and must be90,180, or270. Other values return avalidation_error.- Rotation is relative to a page’s current rotation (e.g.
90on an already-90° page yields 180°). - Omit
pagesto rotate the whole document; otherwise see the page-range syntax.