Skip to main content
POST
/
url2pdf
cURL
curl --request POST \
  --url https://api.geekflare.com/url2pdf \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "url": "https://example.com",
  "device": "desktop",
  "proxyCountry": "us",
  "format": "a4",
  "orientation": "portrait",
  "margin": {
    "top": 25.4,
    "bottom": 25.4,
    "right": 25.4,
    "left": 25.4
  },
  "scale": 1.5,
  "hideCookie": false,
  "skipCaptcha": false,
  "addTimestamp": false
}
'
{
  "timestamp": 1763372588297,
  "apiStatus": "success",
  "apiCode": 200,
  "meta": {
    "url": "https://example.com",
    "device": "desktop",
    "format": "letter",
    "orientation": "landscape",
    "scale": 1.5,
    "test": {
      "id": "mxqx9v9y0742lap6altwdteqd28t23nq"
    },
    "proxyCountry": "<string>",
    "margin": {
      "top": 25.4,
      "bottom": 25.4,
      "right": 25.4,
      "left": 25.4
    }
  },
  "data": "https://api-assets.example.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf"
}

Authorizations

x-api-key
string
header
required

API Key required for all endpoints

Body

application/json
url
string
required

Target URL

Example:

"https://example.com"

device
enum<string>
default:desktop

Device type to emulate. Defaults to desktop.

Available options:
desktop,
mobile
Example:

"desktop"

proxyCountry
string

Proxy country code to route the request

Example:

"us"

format
enum<string>
default:a4

Paper format

Available options:
letter,
legal,
a0,
a1,
a2,
a3,
a4,
a5,
a6
Example:

"a4"

orientation
enum<string>
default:portrait

Orientation

Available options:
portrait,
landscape
Example:

"portrait"

margin
object

Margins in mm

scale
number
default:1

Rendering scale between 0–2

Example:

1.5

Hide cookie popups

Example:

false

skipCaptcha
boolean
default:false

Try to skip captcha

Example:

false

addTimestamp
boolean
default:false

Add timestamp watermark

Example:

false

Response

Successfully captured Url2Pdf

timestamp
number
required

Timestamp of the request in milliseconds

Example:

1763372588297

apiStatus
enum<string>
required

API status message

Available options:
success,
failure
Example:

"success"

apiCode
number
required

API status code

Example:

200

meta
object
required

Metadata about the request

data
string
required

Generated PDF URL

Example:

"https://api-assets.example.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf"