Try it live: PDF Forms Info Reader → API Tester — send a real request from your browser.
POST /v1/pdf/info/fields
For one-time check of PDF file information and find form fields please use PDF Edit Add Helper.
Attributes
Attributes are case-sensitive and should be inside JSON for POST request. for example:
{ "url": "https://example.com/file1.pdf" }| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
url | string | Yes | - | URL to the source file url attribute |
callback | string | No | - | The callback URL (or Webhook) used to receive the POST data. see Webhooks & Callbacks. This is only applicable when async is set to true. |
httpusername | string | No | - | HTTP auth user name if required to access source URL. |
httppassword | string | No | - | HTTP auth password if required to access source URL. |
password | string | No | - | Password for the PDF file. |
async | boolean | No | false | Set async to true for long processes to run in the background, API will then return a jobId which you can use with the Background Job Check endpoint. Also see Webhooks & Callbacks |
profiles | object | No | - | See Profiles for more information. |
DataEncryptionAlgorithm | string | No | - | Controls the encryption algorithm used for data encryption. See User-Controlled Encryption for more information. The available algorithms are: AES128, AES192, AES256. |
DataEncryptionKey | string | No | - | Controls the encryption key used for data encryption. See User-Controlled Encryption for more information. |
DataEncryptionIV | string | No | - | Controls the encryption IV used for data encryption. See User-Controlled Encryption for more information. |
DataDecryptionAlgorithm | string | No | - | Controls the decryption algorithm used for data decryption. See User-Controlled Encryption for more information. The available algorithms are: AES128, AES192, AES256. |
DataDecryptionKey | string | No | - | Controls the decryption key used for data decryption. See User-Controlled Encryption for more information. |
DataDecryptionIV | string | No | - | Controls the decryption IV used for data decryption. See User-Controlled Encryption for more information. |
Query parameters
No query parameters accepted.Responses
| Parameter | Type | Description |
|---|---|---|
info | object | Info details. |
Example Payload
To see the request size limits, please refer to the Request Size Limits.
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf",
"async": false
}
Example Response
To see the main response codes, please refer to the Response Codes page.
{
"info": {
"PageCount": 3,
"Author": "SE:W:CAR:MP",
"Title": "2019 Form 1040",
"Producer": "macOS Version 10.15.1 (Build 19B88) Quartz PDFContext",
"Subject": "U.S. Individual Income Tax Return",
"CreationDate": "8/7/2020 11:17:29 AM",
"Bookmarks": "",
"Keywords": "Fillable",
"Creator": "Adobe LiveCycle Designer ES 9.0",
"Encrypted": false,
"PasswordProtected": 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": "8/7/2020 11:17:29 AM",
"EncryptionAlgorithm": "None",
"PermissionPrinting": true,
"PermissionModifyDocument": true,
"PermissionContentExtraction": true,
"PermissionModifyAnnotations": true,
"PermissionFillForms": true,
"PermissionAccessibility": true,
"PermissionAssemble": true,
"PermissionHighQualityPrint": true,
"FieldsInfo": {
"Fields": [
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[3]",
"Value": "False",
"Left": 340.39898681640625,
"Top": 67.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "CheckBox",
"FieldName": "topmostSubform[0].Page1[0].FilingStatus[0].c1_01[4]",
"Value": "False",
"Left": 441.1990051269531,
"Top": 67.99798583984375,
"Width": 8,
"Height": 8
},
{
"PageIndex": 1,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page1[0].f1_03[0]",
"Value": "",
"Left": 238.60000610351562,
"Top": 111.9990234375,
"Width": 228.39999389648438,
"Height": 14.0009765625
},
{
"PageIndex": 2,
"Type": "EditBox",
"FieldName": "topmostSubform[0].Page2[0].PaidPreparer[0].Preparer[0].f2_37[0]",
"Value": "",
"Left": 509.7449951171875,
"Top": 474.0010070800781,
"Width": 66.2550048828125,
"Height": 11.998992919921875
}
]
}
},
"error": false,
"status": 200,
"remainingCredits": 59987
}
Inconsistent URL Encoding in cURL Output: When using cURL to make API requests, the output JSON may show URL characters encoded as Unicode escape sequences. For example, the ampersand character (
&) may appear as \u0026 in the cURL output. This is normal JSON encoding behavior and does not affect the validity of the URL. The URL will function correctly when used, as JSON parsers automatically decode these escape sequences. If you’re parsing the response programmatically, your JSON parser will handle this conversion automatically.Code Samples
- CURL
- JavaScript/Node.js
- Python
- C#
- Java
- PHP
curl --location --request POST 'https://api.pdf.co/v1/pdf/info/fields' \
--header 'x-api-key: *******************' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf",
"async": false
}'
var request = require('request');
// You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/pdfdotco/pdf-co-api-samples/tree/master/File%20Upload/
var options = {
'method': 'POST',
'url': 'https://api.pdf.co/v1/pdf/info/fields',
'headers': {
'x-api-key': '{{x-api-key}}'
},
formData: {
'url': 'https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import os
import requests # pip install requests
# The authentication key (API Key).
# Get your own by registering at https://app.pdf.co
API_KEY = "***************************"
# Base URL for PDF.co Web API requests
BASE_URL = "https://api.pdf.co/v1"
# Source PDF file url. You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/pdfdotco/pdf-co-api-samples/tree/master/File%20Upload/
SourceFileURL = "https://pdf-temp-files.s3.amazonaws.com/R2FBM39LFX1BFC860O06XU0TL613JTZ9/f1040-form-filled.pdf "
Async = "False"
# Destination PDF file name
DestinationFile = ".\\result.pdf"
parameters = {}
parameters["async"] = Async
parameters["name"] = os.path.basename(DestinationFile)
parameters["url"] = SourceFileURL
# Prepare URL for 'Info Fields' API request
url = "{}/pdf/info/fields".format(BASE_URL)
response = requests.post(url, data=parameters, headers={ "x-api-key": API_KEY })
if (response.status_code == 200):
json = response.json()
for field in json["info"]["FieldsInfo"]["Fields"]:print(field["FieldName"] + "=>" + field["Value"])
using System;
using RestSharp;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
var client = new RestClient("https://api.pdf.co/v1/pdf/info/fields");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "{{x-api-key}}");
request.AlwaysMultipartFormData = true;
// You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/pdfdotco/pdf-co-api-samples/tree/master/File%20Upload/
request.AddParameter("url", "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
}
}
}
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");
// You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/pdfdotco/pdf-co-api-samples/tree/master/File%20Upload/
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("url", "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf")
.build();
Request request = new Request.Builder()
.url("https://api.pdf.co/v1/pdf/info/fields")
.method("POST", body)
.addHeader("x-api-key", "{{x-api-key}}")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
todo
<?php
$curl = curl_init();
// You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/pdfdotco/pdf-co-api-samples/tree/master/File%20Upload/
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.pdf.co/v1/pdf/info/fields",
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 => array('url' => 'https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf'),
CURLOPT_HTTPHEADER => array(
"x-api-key: {{x-api-key}}"
),
));
$response = json_decode(curl_exec($curl));
curl_close($curl);
echo "<h2>Output:</h2><pre>", var_export($response, true), "</pre>";
var request = require('request');
// You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/pdfdotco/pdf-co-api-samples/tree/master/File%20Upload/
var options = {
'method': 'POST',
'url': 'https://api.pdf.co/v1/pdf/info/fields',
'headers': {
'x-api-key': '{{x-api-key}}'
},
formData: {
'url': 'https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-form/f1040.pdf'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});