Code Samples

1. Minimal example with default options

The default options render a 1360x768 viewport as JPG format. This results in a high quality screenshot that's optimized for the web at only 55kb.

GET /v1/capture

Result:

https://api.url2thumb.com/v1/capture/key=YOUR_API_KEY/url=https%3A%2F%2Fwww.apple.com?signature=82616b7d181f0fedc7dde87be2e92369685ae8565fb53578b6dfc56d8ca50ca8

apple.com with default options

apple.com with default options


2. How to take a fullpage screenshot?

You can take a rich screenshot of the entire webpage using the fullpage option. By default, the fullpage_scroll option is also enabled to trigger lazy-loaded elements.

GET /v1/capture

Result:

https://api.url2thumb.com/v1/capture/key=YOUR_API_KEY/url=https%3A%2F%2Fwww.apple.com/fullpage=1?signature=19cb56f019a7ccf10d9616dd95533341d105170a9fa8d42eaaac7f966416055c

apple.com with fullpage option

apple.com fullpage WITHOUT fullpage_scroll enabled

apple.com with fullpage option

apple.com fullpage WITH fullpage_scroll enabled


3. Take a screenshot of a specific part of the page

To take a screenshot of a specific part of a website, use the selector option to target a specific element ID or CSS classname.

GET /v1/capture

Result:

https://api.url2thumb.com/v1/capture/key=YOUR_API_KEY/url=https%3A%2F%2Fwww.apple.com/selector=%23tv-plus-gallery/delay=1?signature=5966b5de0b7473d1659dd6ac308976cf78a42160409121e51510002fce816182

apple.com specific element

apple.com specific element


Copyright © 2024 QED Byte LLC.

Terms of Service · Privacy Policy · Contact Us · Blog · Twitter