Link Search Menu Expand Document

PDF Info Reader

Get detailed information about PDF document, its properties and security permissions.

For one-time check of PDF file information (including pdf form fields information if any) you can also use this page: https://app.pdf.co/pdf-info.

Available methods

[POST] /pdf/info

Extracts basic information about input PDF file, PDF file security permissions, and other information. If you want to extract information about fillable fields (checkboxes, radiboxes, listboxes) from PDF then please use /pdf/info/fields instead.

  • url required. URL to the source file. Supports links from Google Drive, Dropbox and from built-in PDF.co files storage. For uploading files via API please check Files Upload section. If you are randomly getting Too Many Requests or Access Denied error for your input url, please try to add cache: to enable built-in url caching.
  • profiles optional. Must be a String. You can set additional and extra options using this parameter that allows you to set custom configuration. See profiles samples for examples.

Description

  • Method: POST
  • URL: /v1/pdf/info

Query parameters

No query parameters accepted.

Body payload

{
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf"
}

Example responses

POST /pdf/info
{
    "info": {
        "PageCount": 1,
        "Author": "Alice V. Knox",
        "Title": "Kid's News 1",
        "Producer": "Acrobat Distiller 4.0 for Windows",
        "Subject": "Kid's News 1",
        "CreationDate": "8/15/2001 2:50:36 PM",
        "Bookmarks": "",
        "Keywords": "",
        "Creator": "Adobe PageMaker 6.52",
        "Encrypted": false,
        "PageRectangle": {
            "Location": {
                "IsEmpty": true,
                "X": 0,
                "Y": 0
            },
            "Size": "612, 792",
            "X": 0,
            "Y": 0,
            "Width": 612,
            "Height": 792,
            "Left": 0,
            "Top": 0,
            "Right": 612,
            "Bottom": 792,
            "IsEmpty": false
        },
        "ModificationDate": "9/20/2001 6:23:02 PM",
        "EncryptionAlgorithm": 0,
        "PermissionPrinting": true,
        "PermissionModifyDocument": true,
        "PermissionContentExtraction": true,
        "PermissionModifyAnnotations": true,
        "PermissionFillForms": true,
        "PermissionAccessibility": true,
        "PermissionAssemble": true,
        "PermissionHighQualityPrint": true
    },
    "error": false,
    "status": 200,
    "remainingCredits": 77732
}

Code Snippets

CURL
curl --location --request POST 'https://api.pdf.co/v1/pdf/info' \
--header 'x-api-key: ' \
--data-raw '{
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf"
}'
JavaScript
var myHeaders = new Headers();
myHeaders.append("x-api-key", "");

var raw = "{\n    \"url\": \"https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf\"\n}";

var requestOptions = {
	method: 'POST',
	headers: myHeaders,
	body: raw,
	redirect: 'follow'
};

fetch("https://api.pdf.co/v1/pdf/info", requestOptions)
	.then(response => response.text())
	.then(result => console.log(result))
	.catch(error => console.log('error', error));
NodeJs
var request = require('request');
var options = {
	'method': 'POST',
	'url': 'https://api.pdf.co/v1/pdf/info',
	'headers': {
		'x-api-key': ''
	},
	body: '{\n    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf"\n}'

};
request(options, function (error, response) {
	if (error) throw new Error(error);
	console.log(response.body);
});

PHP
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
	CURLOPT_URL => 'https://api.pdf.co/v1/pdf/info',
	CURLOPT_RETURNTRANSFER => true,
	CURLOPT_ENCODING => '',
	CURLOPT_MAXREDIRS => 10,
	CURLOPT_TIMEOUT => 0,
	CURLOPT_FOLLOWLOCATION => true,
	CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
	CURLOPT_CUSTOMREQUEST => 'POST',
	CURLOPT_POSTFIELDS =>'{
    "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf"
}',
	CURLOPT_HTTPHEADER => array(
		'x-api-key: '
	),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Java
import java.io.*;
import okhttp3.*;
public class main {
	public static void main(String []args) throws IOException{
		OkHttpClient client = new OkHttpClient().newBuilder()
			.build();
		MediaType mediaType = MediaType.parse("text/plain");
		RequestBody body = RequestBody.create(mediaType, "{\n    \"url\": \"https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf\"\n}");
		Request request = new Request.Builder()
			.url("https://api.pdf.co/v1/pdf/info")
			.method("POST", body)
			.addHeader("x-api-key", "")
			.build();
		Response response = client.newCall(request).execute();
		System.out.println(response.body().string());
	}
}

C#
using System;
using RestSharp;
namespace HelloWorldApplication {
	class HelloWorld {
		static void Main(string[] args) {
			var client = new RestClient("https://api.pdf.co/v1/pdf/info");
			client.Timeout = -1;
			var request = new RestRequest(Method.POST);
			request.AddHeader("x-api-key", "");
			var body = @"{" + "\n" +
			@"    ""url"": ""https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf""" + "\n" +
			@"}";
			request.AddParameter("text/plain", body,  ParameterType.RequestBody);
			IRestResponse response = client.Execute(request);
			Console.WriteLine(response.Content);
		}
	}
}

Python
import requests

url = "https://api.pdf.co/v1/pdf/info"

payload = "{\n    \"url\": \"https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf\"\n}"
headers = {
	'x-api-key': ''
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Powershell
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("x-api-key", "")

$body = "{`n    `"url`": `"https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-info/sample.pdf`"`n}"

$response = Invoke-RestMethod 'https://api.pdf.co/v1/pdf/info' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json