.Maui Blog

Capture a screenshot of a site easily with .Maui APIs

The .Maui APIs offer a Free URL to Screenshot API Service.

The service is damn simple, here’s an example in Python:

import urllib.parse
import urllib.request

page_url = "https://api.dotmaui.com/"
image_name = "apidotmauicom.png"

params = urllib.parse.urlencode({'apikey': 'YOUR_API_KEY', 'url': page_url}).encode("utf-8")
urllib.request.urlretrieve("https://api.dotmaui.com/client/1.0/capture/", image_name, data = params)

Or by using PHP

<?php

$data = array('apikey' => 'YOUR_API_KEY', 
              'url' => "https://dotmaui.com/");

$curl = curl_init("https://api.dotmaui.com/client/1.0/capture/");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 

$output = curl_exec($curl);  

curl_close($curl);
header('Content-Type: image/png');
echo $output;

Or, if you are a premium user with an url:

https://api.dotmaui.com/client/1.0/capture/?apikey=YOUR_API_KEY&url=https%3A%2F%2Fdotmaui.com%2F&viewport=480x580&delay=0

Full documentation is available here: https://api.dotmaui.com/capture/

Exit mobile version