REST API

it's so easy to use API to invoke screenshoting website, there are two functions of API

For avoiding abuse of the screenshot, urlprint needs API TOKEN to verify the API request. each user could invoke no more than 3 screenshot jobs simultaneously.

Create a job to screenshot the web

POST https://www.urlprint.com/api/v1/cap_jobs?api_token=API_TOKEN

params:

params name type required default desc info
api_token string true api token found API_TOKEN in USER PROFILE
url string true the screenshot webpage url http:// or https:// started
full_page boolean false false whether screenshot whole page or just a size of viewport(simple screen size) will take more time if screen whole page
speed boolean false true urlprint mock pressing page down key 5 times almost when speed is enabled, otherwise urlprint mock pressing page down key until reach the bottom of website will take more time when speed equals false
watermark boolean false false when watermark enabled, urlprint will add url, time and location info to the northeast of the screenshot image
is_mobile boolean false false urlprint screenshot the webpage using the mobile browser mode the window size is 375x812 and ua equals "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"
ua string false Custom user agent
webhook_url string false if webhook_url provided, when screenshot finished, urlprint will POST the a message to webhook_url, including url, status, page_title and screenshot_url

return:

return a json including

  • uuid, unique identifier to the job
  • status, the status of the job
  • screenshot_info_url, the url that return the info of the job, including the screenshot image url if job finished

Example

curl --location --request POST 'https://www.urlprint.com/api/v1/cap_jobs?api_token=f93e8b7c-2664-4ff7-866c-059385ce9eb1&url=https://www.google.com'

return:

            
          {
            "uuid":"2cf14cb4-9fcd-4981-a20b-c7634affd3e6",
            "status":"pending",
            "fetch_info_url":"https://www.urlprint.com/api/v1/cap_jobs/2cf14cb4-9fcd-4981-a20b-c7634affd3e6?api_token=f93e8b7c-2664-4ff7-866c-059385ce9eb1"
          }
          
          

Fetch the screenshot job info, including the screenshot image url if job finished

GET https://www.urlprint.com/api/v1/cap_jobs/UUID?api_token=API_TOKEN

params:

params name type required desc
api_token string true API_TOKEN
uuid string true the identifier of the screenshot job

return:

return a json including

  • status, the status of the screenshot job
  • uuid, the identifier of the screenshot job
  • image_url, the screenshot image url of the job

Example

curl --location --request GET 'https://www.urlprint.com/api/v1/cap_jobs/1b2d7d80-dea6-4cac-8a42-92c2e95f8e49?api_token=f93e8b7c-2664-4ff7-866c-059385ce9eb1' \

return:

            
            {
                "status": "success",
                "uuid": "1b2d7d80-dea6-4cac-8a42-92c2e95f8e49",
                "image_url": "https://www.urlprint.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBWlk9IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--7975a78f7840d30062a0903154b54e744776ff81/41.jpg"
            }