Website Screenshot API
This API uses our proprietary browser engine to capture high-quality screenshots of websites. It supports device emulation (desktop, tablet, mobile) and returns an image url.
Endpoint
Section titled “Endpoint” POST
/api/v1/screenshot Request Parameters
Section titled “Request Parameters”The following parameters are accepted in the request body:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL to capture. |
type | string | Optional | desktop (default), tablet, or phone. |
Request Examples
Section titled “Request Examples”curl -X POST https://heavstal.com.ng/api/v1/screenshot \-H "Content-Type: application/json" \-H "x-api-key: <YOUR_API_KEY>" \-d '{"url": "https://example.com", "type": "phone"}'const response = await fetch('https://heavstal.com.ng/api/v1/screenshot', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify({ url: 'https://example.com', type: 'phone' })});
const res = await response.json();console.log(res.data.link);import { tools } from '@heavstal/api';
// Device options: 'desktop', 'tablet', 'phone'const imgBuffer = await tools.ssweb("https://google.com", "desktop");
// SDK returns the buffer directlyconst fs = require('fs');fs.writeFileSync('screenshot.png', imgBuffer);import requests
url = "https://heavstal.com.ng/api/v1/screenshot"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}payload = { "url": "https://example.com", "type": "phone"}
response = requests.post(url, headers=headers, json=payload)print(response.json()["data"]["link"])Response Examples
Section titled “Response Examples”{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "title": "Website Screenshot", "url": "https://example.com", "device": "phone", "provider": "Heavstal API", "link": "https://files.catbox.moe/example.jpg" }}{ "status": "error", "error": "Failed to capture screenshot."}