Skip to content

Get started

Getting started

Create your account, copy your API token and take your first screenshot in a few minutes.

On this page

This walk through covers what you need in place and the few steps to your first screenshot. It takes about five minutes.

Account and tokenLink to this section

Every request belongs to an account. Each account gets its own API token, which proves the request is yours, keeps track of your usage and pays for the capture from your credits.

  1. 1

    Create your account

    Sign in with your Google account. New accounts start with 2 free credits, enough for 2 hosted screenshots.
  2. 2

    Copy your token

    Open the Account page. Your token is already there, ready to copy.
  3. 3

    Keep it on your server

    Store it as an environment variable such as URL2IMAGE_TOKEN, and read it from there in your code.

Your first requestLink to this section

Send the address of a page and your token to the screenshot endpoint. The request stays open until the image is ready, which usually takes a few seconds.

Terminal
curl -X POST https://url2image.modulify.website/api/screenshots/create \
  -H "Content-Type: application/json" \
  -d '{
    "url": "example.com",
    "token": "YOUR_API_TOKEN",
    "options": { "width": 1440, "height": 900, "fullPage": true }
  }'

The answer carries scrUrl, the permanent link to the hosted PNG, and scrBase64, the same image as base64:

200 OK
{
  "success": true,
  "code": 200,
  "message": "Screenshot was generated.",
  "data": {
    "scrUrl": "https://.../screenshots/.../8f3c2a91d4e5b6c7.png",
    "scrBase64": "iVBORw0KGgoAAAANSUhEUgAA..."
  }
}

The capture now shows up on your dashboard, and one credit is gone from your balance.

SDK or APILink to this section

Url2Image works in two ways. The JavaScript SDK wraps the API and is the recommended choice for Node.js projects. For any other language, call the REST API directly: it is the same request and the same answer.

Server environmentLink to this section

Url2Image is meant to be called from a server, a serverless function or a script, never from code that runs in a visitor's browser. Your token travels with every request, and anything shipped to a browser can be read by anyone who opens the page.

Next stepsLink to this section

Something unclear or missing on this page?

Tell us
Made with Modulify