Pagefreezer

Pagefreezer API

Programming Instructions, Standards, and Secure Communications for Seamless Integration

See How it Works

Welcome Developers,

Welcome to the Pagefreezer Website Archiving API, where you will find programming instructions, standards, and secure communications for seamlessly integrating your products and services with Pagefreezer’s website archiving capabilities for compliance or legal purposes.

The Pagefreezer API allows developers to send a webpage URL and receive an accurate, SHA-256 digitally signed and full-text searchable PDF of that webpage in return.

pdf example

The Pagefreezer API can add specific value to provide a more extensive compliance or legal coverage by capturing URLs mentioned in social media posts, email messages or digital documents.

Download an example webpage snapshot as PDF here


api steps

The PageFreezer API platform has been especially developed for use by our partners. To use the platform, we require authentication through an access token.

Register as a partner to get an API access token. You can do this by:


Signing up for a partner account

API Lifecycle

Once you have received your access token you can make API calls to our service.

The API lifecycle looks like this:

  1. Send an API request to capture a URL. The API supports either request for a single URL or a bulk request with up to 100,000 URLs at a time. Response: a Task ID (for a single URL) or a Request ID (for a list of URLs)
  2. Check the status of the task/request Response: queued, running, canceled or complete
  3. When complete: download the PDF with task/request ID
  4. Clean up (optional) The PageFreezer API server will keep all PDFs for 30 days if not deleted by request.

api lifecycle

API Endpoints

  • https://pdf.pagefreezer.com/utils/v1/pdf/request/status
  • https://pdf.pagefreezer.com/utils/v1/pdf/task/status
  • https://pdf.pagefreezer.com/utils/v1/pdf/request/download
  • https://pdf.pagefreezer.com/utils/v1/pdf/task/download

Security

  • The API endpoints must be accessed through only TLSv1.2.
  • All APIs are required to have account_name and access_token to be authorized to use those APIs

APIs

Method Resource Description
POST /utils/v1/pdf/convert Make a conversion request
GET /utils/v1/pdf/status/request/:request_id Return the current status of a conversion request (per request).
DELETE /utils/v1/pdf/status/request/:request_id Delete tasks linked to the request_id.
GET /utils/v1/pdf/status/task/:task_id Return the current status of a conversion task (per URL).
DELETE /utils/v1/pdf/status/task/:task_id Delete a task linked to the task_id.
GET /utils/v1/pdf/download/task/:task_id.EXT Download PDF binary file. EXT = pdf or png.
DELETE /utils/v1/pdf/download/task/:task_id Delete rendered PDFs linked to the request_id.
DELETE /utils/v1/pdf/download/request/:request_id Delete a rendered PDF linked to the task_id.
  • Notice
  • Request vs Task
  • For any individual conversion through /utils/v1/pdf/convert, request and task are the same, but for a bulk upload, it gives one request ID as a representative ID for the job and each individual conversion of the bulk job has its own task ID.

 

POST /utils/v1/pdf/convert

Batch Job

  • Prepare a text file (urls.txt) containing multiple URLs. (please make sure the URLs in the file must be validated beforehand.)
$ curl -i -X POST -H “Content-Type: multipart/form-data” \ -F “file_0=@urls.txt” \ -F “url=_file_upload_” \ -F “account_name=demo” \ -F “access_token=0000baa08755a1cd1ad750442e68de7” \ http://pdf.pagefreezer.com/utils/v1/pdf/convert
  • Response (It returned just one request_id because it is a batch job.)
{ “status”: “ok”, “tasks”: [], “access_token”: “0000baa08755a1cd1ad750442e68de7”, “type”: “group”, “request_id”: “23fa6654ec9c6c99fb8d2c5632478f5b_1452641921”, “task_size”: 3 }
  • Get the status on all tasks in the request
curl -X GET -H “Content-Type: application/json” \ -d ‘{“account_name”:”demo”, “access_token”:”0000baa08755a1cd1ad750442e68de7″}’ \ http://pdf.pagefreezer.com/utils/v1/pdf/status/request/23fa6654ec9c6c99fb8d2c5632478f5b_1452641921
  • Response
{ “status”: “ok”, “tasks”: [ { “status”: “complete”, “timestamp”: 1452641923.444158, “elapsed_running”: 10.93894100189209, “elapsed_requested”: 0.1510789394378662, “elapsed_total”: 11.139012813568115, “timestamp_”: “2016/01/12 15:38:43”, “output”: { “status”: “ok”, “signing_pdf”: { “signing_pdf”: “signed”, “signer_output”: “”, “exitcode”: 0 }, “http_header”: { “content-length”: “20891”, “ctexclusions”: “0”, “content-encoding”: “gzip”, “expires”: “Thu, 19 Nov 1981 08:52:00 GMT”, “vary”: “Accept-Encoding”, “server”: “Apache/2.2.22 (Debian)”, “pragma”: “no-cache”, “cache-control”: “max-age=1, private, must-revalidate”, “date”: “Tue, 12 Jan 2016 23:38:44 GMT”, “access-control-allow-origin”: “https://pagefreezer.com”, “x-powered-by”: “PHP/5.4.36-0+deb7u3”, “content-type”: “text/html; charset=UTF-8”, “x-pingback”: “https://pagefreezer.com/xmlrpc.php” }, “task_id”: “bb4df41da6526d0d95be65540f6a5423_071452641923”, “elapsed_conv”: 9.178914070129395, “url”: “http://pagefreezer.com”, “finished_at”: 1452641932.825946, “enabled”: { “pdf”: true, “png”: false }, “pdf_size”: 989057, “pdf_filename”: “bb4df41da6526d0d95be65540f6a5423_071452641923.pdf”, “http_return_code”: [ [ “http://pagefreezer.com/”, 301 ], [ “https://pagefreezer.com/”, 301 ], [ “https://pagefreezer.com/”, 200 ] ], “exitcode”: 0 }, “elapsed_queued”: 0.04899096488952637, “task_id”: “bb4df41da6526d0d95be65540f6a5423_071452641923”, “expiration”: 1453246723.444158, “request_id”: “23fa6654ec9c6c99fb8d2c5632478f5b_1452641921”, “input”: { “text”: null, “wait_time_before_rendering”: 3, “text_size”: 15, “account_name”: “demo”, “priority”: 0, “text_position”: “bottom”, “text_font”: “Arial”, “access_method”: “http”, “screen_width”: 1440, “digital_signature”: 1, “passwd”: null, “output_format”: “pdf”, “text_url”: 1, “text_timestamp”: 1, “access_expiration_days”: 7, “png”: false, “access_token”: “0000baa08755a1cd1ad750442e68de7”, “one_page”: 1, “url”: “http://pagefreezer.com”, “pdf”: true } }, { “status”: “complete”, “timestamp”: 1452641921.295305, “elapsed_running”: 7.386477947235107, “elapsed_requested”: 1.003598928451538, “elapsed_total”: 8.438687086105347, “timestamp_”: “2016/01/12 15:38:41”, “output”: { “status”: “ok”, “signing_pdf”: { “signing_pdf”: “signed”, “signer_output”: “”, “exitcode”: 0 }, “http_header”: { “content-length”: “4807”, “content-encoding”: “gzip”, “accept-ranges”: “bytes”, “expires”: “Tue, 12 Jan 2016 23:42:15 GMT”, “vary”: “Accept-Encoding”, “server”: “Apache”, “connection”: “keep-alive”, “cache-control”: “max-age=213”, “date”: “Tue, 12 Jan 2016 23:38:42 GMT”, “content-type”: “text/html; charset=UTF-8” }, “task_id”: “0f82f8155826020d153245b61160ed4e_071452641921”, “elapsed_conv”: 5.098731994628906, “url”: “http://apple.com”, “finished_at”: 1452641927.449783, “enabled”: { “pdf”: true, “png”: false }, “pdf_size”: 541773, “pdf_filename”: “/opt/pagefreezer/data/pdf/complete/62/0f82f8155826020d153245b61160ed4e_071452641921.pdf”, “http_return_code”: [ [ “http://apple.com/”, 301 ], [ “http://www.apple.com/”, 200 ] ], “exitcode”: 0 }, “elapsed_queued”: 0.04860711097717285, “task_id”: “0f82f8155826020d153245b61160ed4e_071452641921”, “expiration”: 1453246721.295305, “request_id”: “23fa6654ec9c6c99fb8d2c5632478f5b_1452641921”, “input”: { “text”: null, “wait_time_before_rendering”: 3, “text_size”: 15, “account_name”: “demo”, “priority”: 0, “text_position”: “bottom”, “text_font”: “Arial”, “access_method”: “http”, “screen_width”: 1440, “digital_signature”: 1, “passwd”: null, “output_format”: “pdf”, “text_url”: 1, “text_timestamp”: 1, “access_expiration_days”: 7, “png”: false, “access_token”: “0000baa08755a1cd1ad750442e68de7”, “one_page”: 1, “url”: “http://apple.com”, “pdf”: true } } ], “task_size”: 2 }

 

  • Required Parameters
Parameter Description
output_format (optional) default: “pdf” (one of “pdf”,”png”,”both”) (Fixed. This parameter for future use)
screen_width (optional) default: 1440 (unit in pixel)
one_page (optional) default: 1 (true) (0=multi page or 1=one page) / NOW IT ONLY SUPPORTS ONE PAGE.
wait_time_before_rendering (optional) default: 3 (seconds). Wating time to load the web page to be renderred.
text_timestamp (optional) Add timestamp text. default: 1(true). 0(false). (This parameter for future use)
text_url (optional) Add URL text. default: 1(true). 0(false) (This parameter for future use)
text (optional) Add message. (This parameter for future use)
text_position (optional) One of ‘top’ or ‘bottom’. (This parameter for future use)
text_font (optional) Set a font name for text. default: ‘Arial’. (This parameter for future use)
text_size (optional) Set a font size for text. default: 12. (This parameter for future use)
access_expiration_days (optional) Default: 7 (days). Days to keep the resulted PDF in the server.
access_method (optional) Default: http. (This parameter for future use. email or ftp could be supported later.)
digital_signature (optional) Default: 0 (false). (This parameter for future use.)
priority (optional) Default: 0. (0: normal priority, 1: express (put a request into a queue directly)
  • Make a conversion request.
  • Return HTTP Code: 200 (OK), 400 (Bad Request), 401 (Unauthorized), 404 (Not found)
  • request_id, task_id are randomized long string. (hashing with timestamp and url).
  • JSON Format :
  • Single
{ “status”: “ok”, “tasks”: { “url”: “http://apple.com”, “task_id”: “0f82f8155826020d153245b61160ed4e_071452639963” }, “access_token”: “0000baa08755a1cd1ad750442e68de7”, “type”: “single”, “request_id”: “0f82f8155826020d153245b61160ed4e_071452639963”, “task_size” }

 

Group

{ “status”: “ok”, “tasks”: [], “access_token”: “0000baa08755a1cd1ad750442e68de7”, “type”: “group”, “request_id”: “23fa6654ec9c6c99fb8d2c5632478f5b_1452641921”, “task_size”: 3 }

 

GET /utils/v1/pdf/status/task/:task_id

  • Return a full details of a task.
  • Return HTTP Code: 200 (OK), 400 (Bad Request), 401 (Unauthorized), 404 (Not found)
  • Task status = waiting, running, stopped, done.
  • JSON Format :
{ “status”: “ok”, “task” { “status”: “complete”, “request_id”: “41bc20453fe3f81ead4688da445be931_1400626360”, “task_id”: “df6809ead782d62a2a76b892eb1842d9_1400626360”, “timestamp”: 1400626360.387102, “timestamp_”: “2014/05/20 15:52:40”, “elapsed_queued”: 0.06342697143554688, “elapsed_requested”: 0.6066880226135254, “elapsed_running”: 10.47885513305664, “elapsed_total”: 11.148975133895874, “input”: { “access_expiration_days”: 7, “access_method”: “http”, “digital_signature”: 1, “one_page”: 1, “output_format”: “pdf”, “pdf”: true, “png”: false, “priority”: 0, “screen_width”: 1440, “text”: null, “text_font”: “Arial”, “text_position”: “bottom”, “text_size”: 15, “text_timestamp”: 1, “text_url”: 1, “url”: “http://www.npr.org/”, “wait_time_before_rendering”: 3 }, “output”: { “elapsed_conv”: 6.093822002410889, “enabled”: { “pdf”: true, “png”: false }, “exitcode”: 0, “pdf_filename”: “df6809ead782d62a2a76b892eb1842d9_1400626360.pdf”, “pdf_size”: 821426, “signing_pdf”: { “exitcode”: 0, “signer_output”: “”, “signing_pdf”: “signed” }, “status”: “ok”, “task_id”: “df6809ead782d62a2a76b892eb1842d9_1400626360”, “url”: “http://www.npr.org/” } } }

 

GET /utils/v1/pdf/status/request/:request_id

  • The same as /utils/v1/pdf/status/task except this API returns collected results.
{ “status”: “ok”, “task_size”: 4, “tasks” [{…}, {…}, {…}, {…}] }

 

DELETE /utils/v1/pdf/status/request/:request_id

  • Delete all tasks linked to the request_id

 

DELETE /utils/v1/pdf/status/task/:task_id

  • Delete a task linked to the request_id

 

GET /utils/v1/pdf/download/task/:task_id

  • Streaming a PDF binary file or return HTTP REDIRECT (301).
  • If you want to download it directly, please add “?direct=1” at the end of the request URL.
  • If there is an error, it just returns JSON.
  • Return HTTP Code: 200 (OK), 400 (Bad Request), 401 (Unauthorized), 404 (Not found)
  • Error JSON Format :
{ “status”: “error”, “desc”: “not found” }

 

DELETE /utils/v1/pdf/download/request/:request_id

  • Delete all rendered PDFs linked to the request_id
  • Return HTTP Code: 200 (OK), 400 (Bad Request), 401 (Unauthorized), 404 (Not found)
  • JSON Format :
{ “status”: “ok”, }

 

DELETE /utils/v1/pdf/download/task/:task_id

  • Delete a PDF linked to the task_id
  • Return HTTP Code: 200 (OK), 400 (Bad Request), 401 (Unauthorized), 404 (Not found)
  • JSON Format :
{ “status”: “ok”, }

 

Revision

  • Last Updated on Jan 12, 2016
  • Request a conversion with http://apple.com.
$ curl -X POST \ -H “Content-Type: application/json” \ -d ‘{“url”:”http://apple.com”, “account_name”:”demo”, “access_token”:”0000baa08755a1cd1ad750442e68de7″ }’ \ http://pdf.pagefreezer.com/utils/v1/pdf/convert
  • Response
{ “status”: “ok”, “tasks”: { “url”: “http://apple.com”, “task_id”: “0f82f8155826020d153245b61160ed4e_071452639963” }, “access_token”: “0000baa08755a1cd1ad750442e68de7”, “type”: “single”, “request_id”: “0f82f8155826020d153245b61160ed4e_071452639963”, “task_size”: 1 }
  • Check the progress of the request (needs task_id from the response of its first request)
$ curl -X GET -H “Content-Type: application/json” -d ‘{“account_name”:”demo”, “access_token”:”0000baa08755a1cd1ad750442e68de7″}’ http://pdf.pagefreezer.com/utils/v1/pdf/status/request/0f82f8155826020d153245b61160ed4e_071452639963
  • Response
{ “status”: “ok”, “tasks”: [ { “status”: “complete”, “timestamp”: 1452639963.787417, “elapsed_running”: 8.412076950073242, “elapsed_requested”: 0.4369630813598633, “elapsed_total”: 8.89844012260437, “timestamp_”: “2016/01/12 15:06:03”, “output”: { “status”: “ok”, “signing_pdf”: { “signing_pdf”: “signed”, “signer_output”: “”, “exitcode”: 0 }, “http_header”: { “content-length”: “4807”, “content-encoding”: “gzip”, “accept-ranges”: “bytes”, “expires”: “Tue, 12 Jan 2016 23:15:16 GMT”, “vary”: “Accept-Encoding”, “server”: “Apache”, “connection”: “keep-alive”, “cache-control”: “max-age=552”, “date”: “Tue, 12 Jan 2016 23:06:04 GMT”, “content-type”: “text/html; charset=UTF-8” }, “task_id”: “0f82f8155826020d153245b61160ed4e_071452639963”, “elapsed_conv”: 5.55590295791626, “url”: “http://apple.com”, “finished_at”: 1452639969.833543, “enabled”: { “pdf”: true, “png”: false }, “pdf_size”: 541648, “pdf_filename”: “0f82f8155826020d153245b61160ed4e_071452639963.pdf”, “http_return_code”: [ [ “http://apple.com/”, 301 ], [ “http://www.apple.com/”, 200 ] ], “exitcode”: 0 }, “elapsed_queued”: 0.04939699172973633, “task_id”: “0f82f8155826020d153245b61160ed4e_071452639963”, “expiration”: 1453244763.787417, “request_id”: “0f82f8155826020d153245b61160ed4e_071452639963”, “input”: { “text”: null, “wait_time_before_rendering”: 3, “text_size”: 15, “account_name”: “demo”, “priority”: 0, “text_position”: “bottom”, “text_font”: “Arial”, “access_method”: “http”, “screen_width”: 1440, “digital_signature”: 1, “passwd”: null, “output_format”: “pdf”, “text_url”: 1, “text_timestamp”: 1, “access_expiration_days”: 7, “png”: false, “access_token”: “0000baa08755a1cd1ad750442e68de7”, “one_page”: 1, “url”: “http://apple.com”, “pdf”: true } } ], “task_size”: 1 }
  • The status of the task is “complete”, it is ready for downloading it.
  • Downloading the completed PDF
$ curl -X GET \ -H “Content-Type: application/json” \ -d ‘{“account_name”:”demo”, “access_token”:”0000baa08755a1cd1ad750442e68de7″}’ \ http://pdf.pagefreezer.com/utils/v1/pdf/download/task/0f82f8155826020d153245b61160ed4e_071452639963.pdf
  • Response: it will return HTTP 301 to the PDF file.
  • If you want to download it directly, please add “?direct=1” at the end of the request URL.

 

Revision

  • Last Updated on Jan 12, 2016

Start Leveraging the Pagefreezer API

Get in touch with us to learn more and see Pagefreezer’s solutions in action. 

Speak to an Expert
Schedule a Demo
Schedule a Demo

Have more questions?

Contact us at +1-888-916-3999 or sales@pagefreezer.com

1-888-916-3999
support@pagefreezer.com

Head Office:
#500-311 Water Street
Vancouver, BC V6B 1B8
Canada

Europe Office:
Van Leeuwenhoekpark 1 - Office 5
2611 DW, Delft
The Netherlands

UK Office:
+44 20 3744 7173

Australia Office:
+61 (07) 3186 2199

Subscribe to our Blog

Get targeted Industry news, great tips and valuable insights

©2024 Pagefreezer Software Inc. All Rights Reserved. Privacy Policy and Acceptable Use Policy. Commercial use and distribution of the contents of this website is not allowed without express and prior written consent of Pagefreezer Software Inc. subject to existing copyright exceptions and limitations.