Page
Library
Module
Module type
Parameter
Class
Class type
Source
PxshotSourcePxshot - Official OCaml SDK for the Pxshot screenshot API
Image format for screenshots
Wait condition for page loading
type screenshot_options = {url : string;format : format option;quality : int option;width : int option;height : int option;full_page : bool option;wait_until : wait_until option;wait_for_selector : string option;wait_for_timeout : int option;device_scale_factor : float option;store : bool option;block_ads : bool option;}Screenshot options
Result when store=true
Screenshot response - either raw bytes or stored URL
type usage = {screenshots_taken : int;screenshots_limit : int;bytes_used : int;bytes_limit : int;period_start : string;period_end : string;}Usage statistics
Error types
The Pxshot client
Create a new Pxshot client with the given API key.
val screenshot :
t ->
url:string ->
?format:format ->
?quality:int ->
?width:int ->
?height:int ->
?full_page:bool ->
?wait_until:wait_until ->
?wait_for_selector:string ->
?wait_for_timeout:int ->
?device_scale_factor:float ->
?store:bool ->
?block_ads:bool ->
unit ->
(screenshot_response, error) result Lwt.tCapture a screenshot of the given URL.
Convert wait_until to string