Documentation

Everything you need to get started with the Screenshot API

Quick Start

Get started in 3 simple steps:

  1. Create an account
  2. Generate an API key
  3. Make your first API call

Authentication

All API requests require an API key. Include it in the X-API-Key header:

curl -H "X-API-Key: your_api_key" https://api.dasm.asia/health

Take a Screenshot

POST /screenshot

Request Body

{
  "url": "https://example.com",
  "id": "optional-custom-id"
}

Response (202 Accepted)

{
  "task_id": "abc123",
  "status": "pending"
}

Example Request

curl -X POST https://api.dasm.asia/screenshot \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Check Task Status

GET /screenshot/task/{"{task_id}"}

Response

{
  "task_id": "abc123",
  "status": "completed",
  "result": {
    "screenshot_stored": true
  }
}

Status can be: pending, processing, completed, or failed

Get Screenshot Result

GET /screenshot/task/{"{task_id}"}/result

Returns the screenshot image as PNG binary data.

Example

# Download screenshot
curl -H "X-API-Key: your_api_key" \
  https://api.dasm.asia/screenshot/task/abc123/result \
  -o screenshot.png

Python Example

import requests
import time

API_KEY = "your_api_key"
BASE_URL = "https://api.dasm.asia"

headers = {"X-API-Key": API_KEY}

# Create screenshot task
response = requests.post(
    f"{BASE_URL}/screenshot",
    headers=headers,
    json={"url": "https://example.com"}
)
task_id = response.json()["task_id"]

# Poll for completion
while True:
    status = requests.get(
        f"{BASE_URL}/screenshot/task/{task_id}",
        headers=headers
    ).json()

    if status["status"] == "completed":
        break
    elif status["status"] == "failed":
        raise Exception("Screenshot failed")

    time.sleep(1)

# Download screenshot
result = requests.get(
    f"{BASE_URL}/screenshot/task/{task_id}/result",
    headers=headers
)

with open("screenshot.png", "wb") as f:
    f.write(result.content)

print("Screenshot saved!")

Rate Limits

Endpoint Limit
POST /screenshot 10 requests/minute per key
GET /screenshot/task/* 60 requests/minute per key
Other endpoints 100 requests/minute per IP

Need Help?

Have questions or need assistance? Contact us:

support@dasm.asia