Link Search Menu Expand Document

PDF.co API v.1.00

NOTE: This documentation applies to both PDF.co and on-prem version called ByteScout API Server. Remarks in the documentation highlighting a difference if any.

NOT A DEVELOPER and LOOKING FOR FREE APPS? Check 100% free apps at PDFLite.co

Indices

PDF.co Platform Benefits

  • Use from API or via 300+ Integrations: you can use PDF.co from anywhere: programming languages, RPA platforms like UI and Automation Platforms such as Zapier, Integromat, IUPath, RPA apps, SalesForce and many others.
  • Security: PDF.co API runs on top of the secure and certified Amazon AWS infrastructure. All data transfers are encrypted by SSL/TLS encryption. See the security page for more details.
  • Asynchronous mode is supported so you can process large files and documents with hundreds of pages in the cloud.
  • Battle tested by thousands of production users. Our engines are tested in production by thousands of enterprise users.
  • Credits based system. For every page credits are consumed from your account. You can purchase non-expiring credits with one-time payments or subscribe for a monthly credits that are cheaper. For the detailed reports explore your API logs.
  • On-Prem Version and Private Cloud version is available. Enterprise users may easily switch to ByteScout API Server that can run in a private cloud or on premises. Contact support for more information.

Use From No Code Platforms

You can use PDF.co from popular automation and RPA platforms including:

Source Code Samples

We have hundreds of ready to copy-paste source code samples!

Explore Hundreds of Source Code Sample Apps on Github. Samples apps are available for Javascript, Node.js, PHP, Java, C#, Visual Basic, ASP.NET, Powershell, CLI and others!

Tech Support From Engineers

Our team of engineers is happy to help with the integration, coding of proof of concept projects and any other questions. To contact us please:

Technical Notes

How to upload files to API

  1. Request a temporary URL for upload using /file/upload/get-presigned-url. This will return JSON with presignedUrl property that contains a link you should upload into using PUT and url property that contains a link to the uploaded file.
  2. Upload your file using PUT to this presignedUrl link generated on the previous step. Once finished, your file can be accessed using the link from url link from the step 1
  3. Congrats! Now you can access your uploaded file using that link from url param from step 1. Now you can call any API method with your link set as url param.

Security Note: Uploaded files are auto-removed within 60 minutes by default. You can also remove your file earlier using /file/delete endpoint.

On-Prem Version only: Depending on your settings, your files are stored on your server or in the cloud storage of your choice or on your file server. If you use cloud storage (like AWS S3) then you need to set up an auto-removal policy for uploaded files or remove files using /file/delete endpoint.

How to run a background job

We’ve designed a special async mode that is available for almost all endpoints. If your call takes more than 25 seconds then you need to run it as a background job that can work for up to 15-20 minutes and can process large documents and files.

When you set async param to true, your call returns jobId param containing unique ID of your background job. Use /job/check to read a background job status to find when your output file is ready for download.

Step by step:

  1. Add the async parameter and set it to true. 2 Enable async mode by setting async input parameter to true. This will tell API method to create background job and immediately return unique id of this new background job in jobId property in the output along with the final url. Use this url to access the output file (if any) once the job is finished.
  2. Now check the status of that new background job using /job/check with jobId parameter set to the jobId value from the previous step. Repeat and check until it returns status as success. Recommended interval for checking is 1-2 seconds for small documents and 10-15 seconds for large documents.

Too Many Requests Error For Input Url

Sometime if you use Google Drive, Google Docs, Google Sheets, Dropbox or similar free cloud storage services to store your input files, you may get Too Many Requests in or Access Denied errors after previously successful calls. Cloud services are throttling requests to prevent frequent access to their files by using this type of protection. Paid plans like Google Workspace provide better support for frequent access but still throttling all incoming requests too.

To solve this issue, PDF.co can use its built-in secure input url cache. Just add cache: prefix to your input url to enable caching.

For example: cache:https://example.com/file.pdf

This will tell PDF.co to cache file from the url for next 15 minutes. Instead of re-requesting your url every time, it will use its cached version. This will prevent from getting Too Many Requests error.

Status Errors Returned by API

API returns https status but also returns JSON that includes status parameter indicating error.

Status valueDescription
200The request has succeeded
400bad input parameters
401unauthorized
402not enough credits
403forbidden (source file or url is not accessible)
408Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info

! Don’t forget to set x-api-key url param or http header param (preferred) to API key. Get your API key here

Known Issues