Playground Sign in Start free

Screenshot

Capture high-quality screenshots of any web page. Support for full-page captures, viewport screenshots, and element-specific captures.

Overview

Capture screenshots of any web page by setting response_type=screenshot. The API renders the page using a headless Chrome browser and captures a PNG image.

TIP — Options Available

  • Full page: Capture the entire scrollable page
  • Viewport: Capture only the visible viewport
  • Element: Capture a specific element using CSS selector or coordinates

Basic Request

Set response_type=screenshot to capture a screenshot.

GET https://api.ujeebu.com/scrape?response_type=screenshot

curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&js=true' \
  -H "ApiKey: YOUR_API_KEY" \
  -o screenshot.png
const fs = require('fs');

const response = await fetch(
  'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&js=true',
  {
    headers: { 'ApiKey': 'YOUR_API_KEY' }
  }
);

const buffer = await response.arrayBuffer();
fs.writeFileSync('screenshot.png', Buffer.from(buffer));
import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
import fs from 'fs';

const client = new UjeebuClient(process.env.UJEEBU_API_KEY);

const screenshot = await client.getScreenshot('https://example.com', {
  js: true
});

fs.writeFileSync('screenshot.png', screenshot);
import requests

response = requests.get(
    'https://api.ujeebu.com/scrape',
    params={
        'url': 'https://example.com',
        'response_type': 'screenshot',
        'js': 'true'
    },
    headers={'ApiKey': 'YOUR_API_KEY'}
)

with open('screenshot.png', 'wb') as f:
    f.write(response.content)
from ujeebu_python import UjeebuClient

ujeebu = UjeebuClient(api_key="YOUR_API_KEY")

screenshot = ujeebu.get_screenshot(
    url='https://example.com',
    params={'js': True}
)

with open('screenshot.png', 'wb') as f:
    f.write(screenshot)
import okhttp3.*;
import java.io.*;

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&js=true")
    .addHeader("ApiKey", "YOUR_API_KEY")
    .build();

Response response = client.newCall(request).execute();

try (FileOutputStream fos = new FileOutputStream("screenshot.png")) {
    fos.write(response.body().bytes());
}
<?php

$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
    'url' => 'https://example.com',
    'response_type' => 'screenshot',
    'js' => 'true'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'ApiKey: YOUR_API_KEY'
]);

$screenshot = curl_exec($ch);
curl_close($ch);

file_put_contents('screenshot.png', $screenshot);
package main

import (
	"io"
	"net/http"
	"os"
)

func main() {
	url := "https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&js=true"
	
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("ApiKey", "YOUR_API_KEY")
	
	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	
	file, _ := os.Create("screenshot.png")
	defer file.Close()
	
	io.Copy(file, resp.Body)
}
package main

import (
	"os"
	"github.com/ujeebu/ujeebu-go"
)

func main() {
	client, _ := ujeebu.NewClient("YOUR-API-KEY")
	
	screenshot, credits, err := client.Screenshot(ujeebu.ScrapeParams{
		URL: "https://example.com",
		JS:  true,
	}, false, "")
	if err != nil {
		panic(err)
	}
	
	os.WriteFile("screenshot.png", screenshot, 0644)
}

Parameters

Parameter Type Required Default Description
url string Yes - The URL to screenshot.
response_type string Yes html Set to 'screenshot' to capture a screenshot.
screenshot_fullpage boolean No false Capture the full scrollable page instead of just the viewport.
screenshot_partial string No null CSS selector or JSON coordinates {x, y, width, height} for partial screenshot.
js boolean No false Enable JavaScript rendering before taking screenshot.
wait_for `string number` No null
device string No desktop Device to emulate: 'desktop', 'mobile', or specific device name.
window_width number No 1920 Browser viewport width in pixels.
window_height number No 1080 Browser viewport height in pixels.
block_ads boolean No false Block advertisements in the screenshot.
json boolean No false Return screenshot as base64-encoded JSON instead of binary.
proxy_type string No rotating Proxy type: 'rotating', 'premium', 'residential', 'custom'.

Full Page Screenshot

Capture the entire scrollable page by setting screenshot_fullpage=true:

curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&screenshot_fullpage=true&js=true' \
  -H "ApiKey: YOUR_API_KEY" \
  -o fullpage.png
const fs = require('fs');

const response = await fetch(
  'https://api.ujeebu.com/scrape?' + new URLSearchParams({
    url: 'https://example.com',
    response_type: 'screenshot',
    screenshot_fullpage: 'true',
    js: 'true'
  }),
  { headers: { 'ApiKey': 'YOUR_API_KEY' } }
);

const buffer = await response.arrayBuffer();
fs.writeFileSync('fullpage.png', Buffer.from(buffer));
import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
import fs from 'fs';

const client = new UjeebuClient(process.env.UJEEBU_API_KEY);

const screenshot = await client.getScreenshot('https://example.com', {
  js: true,
  screenshot_fullpage: true
});

fs.writeFileSync('fullpage.png', screenshot);
import requests

response = requests.get(
    'https://api.ujeebu.com/scrape',
    params={
        'url': 'https://example.com',
        'response_type': 'screenshot',
        'screenshot_fullpage': 'true',
        'js': 'true'
    },
    headers={'ApiKey': 'YOUR_API_KEY'}
)

with open('fullpage.png', 'wb') as f:
    f.write(response.content)
from ujeebu_python import UjeebuClient

ujeebu = UjeebuClient(api_key="YOUR_API_KEY")

screenshot = ujeebu.get_screenshot(
    url='https://example.com',
    params={'js': True, 'screenshot_fullpage': True}
)

with open('fullpage.png', 'wb') as f:
    f.write(screenshot)
import okhttp3.*;
import java.io.*;

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&screenshot_fullpage=true&js=true")
    .addHeader("ApiKey", "YOUR_API_KEY")
    .build();

Response response = client.newCall(request).execute();

try (FileOutputStream fos = new FileOutputStream("fullpage.png")) {
    fos.write(response.body().bytes());
}
<?php

$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
    'url' => 'https://example.com',
    'response_type' => 'screenshot',
    'screenshot_fullpage' => 'true',
    'js' => 'true'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['ApiKey: YOUR_API_KEY']);

$screenshot = curl_exec($ch);
curl_close($ch);

file_put_contents('fullpage.png', $screenshot);
package main

import (
	"io"
	"net/http"
	"os"
)

func main() {
	url := "https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&screenshot_fullpage=true&js=true"
	
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("ApiKey", "YOUR_API_KEY")
	
	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	
	file, _ := os.Create("fullpage.png")
	defer file.Close()
	
	io.Copy(file, resp.Body)
}
package main

import (
	"os"
	"github.com/ujeebu/ujeebu-go"
)

func main() {
	client, _ := ujeebu.NewClient("YOUR-API-KEY")
	
	screenshot, _, _ := client.Screenshot(ujeebu.ScrapeParams{
		URL: "https://example.com",
		JS:  true,
	}, true, "")
	
	os.WriteFile("fullpage.png", screenshot, 0644)
}

Partial Screenshot

Capture a specific element or region using screenshot_partial:

By CSS Selector

Capture a specific element by providing a CSS selector:

curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&screenshot_partial=.main-content&js=true' \
  -H "ApiKey: YOUR_API_KEY" \
  -o element.png

By Coordinates

Capture a specific region using JSON coordinates:

curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&screenshot_partial={"x":0,"y":0,"width":800,"height":600}&js=true' \
  -H "ApiKey: YOUR_API_KEY" \
  -o region.png

Response Formats

Binary Response (Default)

By default, the API returns the screenshot as binary PNG data with Content-Type: image/png.

JSON Response

When json=true, the screenshot is returned as a base64-encoded string:

{
  "success": true,
  "screenshot": "iVBORw0KGgoAAAANSUhEUgAAA2oAACyOCA...",
  "html_source": null,
  "pdf": null,
  "html": null
}
curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&json=true' \
  -H "ApiKey: YOUR_API_KEY"
const fs = require('fs');

const response = await fetch(
  'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&json=true',
  { headers: { 'ApiKey': 'YOUR_API_KEY' } }
);

const data = await response.json();
const imageBuffer = Buffer.from(data.screenshot, 'base64');
fs.writeFileSync('screenshot.png', imageBuffer);
import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
import fs from 'fs';

const client = new UjeebuClient(process.env.UJEEBU_API_KEY);

// SDK returns binary by default
const screenshot = await client.getScreenshot('https://example.com');
fs.writeFileSync('screenshot.png', screenshot);
import requests
import base64

response = requests.get(
    'https://api.ujeebu.com/scrape',
    params={'url': 'https://example.com', 'response_type': 'screenshot', 'json': 'true'},
    headers={'ApiKey': 'YOUR_API_KEY'}
)

data = response.json()
image_bytes = base64.b64decode(data['screenshot'])

with open('screenshot.png', 'wb') as f:
    f.write(image_bytes)
from ujeebu_python import UjeebuClient

ujeebu = UjeebuClient(api_key="YOUR_API_KEY")

# SDK returns binary by default
screenshot = ujeebu.get_screenshot(url='https://example.com')

with open('screenshot.png', 'wb') as f:
    f.write(screenshot)
import okhttp3.*;
import org.json.*;
import java.util.Base64;
import java.io.*;

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&json=true")
    .addHeader("ApiKey", "YOUR_API_KEY")
    .build();

Response response = client.newCall(request).execute();
JSONObject data = new JSONObject(response.body().string());

// Decode base64 screenshot
byte[] imageBytes = Base64.getDecoder().decode(data.getString("screenshot"));

try (FileOutputStream fos = new FileOutputStream("screenshot.png")) {
    fos.write(imageBytes);
}
<?php

$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
    'url' => 'https://example.com',
    'response_type' => 'screenshot',
    'json' => 'true'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['ApiKey: YOUR_API_KEY']);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
$imageBytes = base64_decode($data['screenshot']);

file_put_contents('screenshot.png', $imageBytes);
package main

import (
	"encoding/base64"
	"encoding/json"
	"io"
	"net/http"
	"os"
)

func main() {
	url := "https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&json=true"
	
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("ApiKey", "YOUR_API_KEY")
	
	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	
	body, _ := io.ReadAll(resp.Body)
	
	var result map[string]interface{}
	json.Unmarshal(body, &result)
	
	// Decode base64 screenshot
	imageBytes, _ := base64.StdEncoding.DecodeString(result["screenshot"].(string))
	
	os.WriteFile("screenshot.png", imageBytes, 0644)
}
package main

import (
	"os"
	"github.com/ujeebu/ujeebu-go"
)

func main() {
	client, _ := ujeebu.NewClient("YOUR-API-KEY")
	
	// SDK returns binary by default
	screenshot, _, _ := client.Screenshot(ujeebu.ScrapeParams{
		URL: "https://example.com",
	}, false, "")
	
	os.WriteFile("screenshot.png", screenshot, 0644)
}

Mobile Screenshots

Capture screenshots as they would appear on mobile devices:

curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=iPhone%20X&js=true' \
  -H "ApiKey: YOUR_API_KEY" \
  -o mobile.png
const fs = require('fs');

const response = await fetch(
  'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=iPhone%20X&js=true',
  { headers: { 'ApiKey': 'YOUR_API_KEY' } }
);

const buffer = await response.arrayBuffer();
fs.writeFileSync('mobile.png', Buffer.from(buffer));
import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
import fs from 'fs';

const client = new UjeebuClient(process.env.UJEEBU_API_KEY);

const screenshot = await client.getScreenshot('https://example.com', {
  js: true,
  device: 'iPhone X'
});

fs.writeFileSync('mobile.png', screenshot);
import requests

response = requests.get(
    'https://api.ujeebu.com/scrape',
    params={
        'url': 'https://example.com',
        'response_type': 'screenshot',
        'device': 'iPhone X',
        'js': 'true'
    },
    headers={'ApiKey': 'YOUR_API_KEY'}
)

with open('mobile.png', 'wb') as f:
    f.write(response.content)
from ujeebu_python import UjeebuClient

ujeebu = UjeebuClient(api_key="YOUR_API_KEY")

screenshot = ujeebu.get_screenshot(
    url='https://example.com',
    params={'js': True, 'device': 'iPhone X'}
)

with open('mobile.png', 'wb') as f:
    f.write(screenshot)
import okhttp3.*;
import java.io.*;
import java.net.URLEncoder;

OkHttpClient client = new OkHttpClient();

String url = "https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=" +
    URLEncoder.encode("iPhone X", "UTF-8") + "&js=true";

Request request = new Request.Builder()
    .url(url)
    .addHeader("ApiKey", "YOUR_API_KEY")
    .build();

Response response = client.newCall(request).execute();

try (FileOutputStream fos = new FileOutputStream("mobile.png")) {
    fos.write(response.body().bytes());
}
<?php

$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
    'url' => 'https://example.com',
    'response_type' => 'screenshot',
    'device' => 'iPhone X',
    'js' => 'true'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['ApiKey: YOUR_API_KEY']);

$screenshot = curl_exec($ch);
curl_close($ch);

file_put_contents('mobile.png', $screenshot);
package main

import (
	"io"
	"net/http"
	"net/url"
	"os"
)

func main() {
	apiURL := "https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=" +
		url.QueryEscape("iPhone X") + "&js=true"
	
	req, _ := http.NewRequest("GET", apiURL, nil)
	req.Header.Set("ApiKey", "YOUR_API_KEY")
	
	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	
	file, _ := os.Create("mobile.png")
	defer file.Close()
	
	io.Copy(file, resp.Body)
}
package main

import (
	"os"
	"github.com/ujeebu/ujeebu-go"
)

func main() {
	client, _ := ujeebu.NewClient("YOUR-API-KEY")
	
	screenshot, _, _ := client.Screenshot(ujeebu.ScrapeParams{
		URL:    "https://example.com",
		JS:     true,
		Device: "iPhone X",
	}, false, "")
	
	os.WriteFile("mobile.png", screenshot, 0644)
}

Or specify custom viewport dimensions:

curl -X GET 'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=mobile&window_width=375&window_height=812&js=true' \
  -H "ApiKey: YOUR_API_KEY" \
  -o custom-mobile.png
const fs = require('fs');

const response = await fetch(
  'https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=mobile&window_width=375&window_height=812&js=true',
  { headers: { 'ApiKey': 'YOUR_API_KEY' } }
);

const buffer = await response.arrayBuffer();
fs.writeFileSync('custom-mobile.png', Buffer.from(buffer));
import { UjeebuClient } from '@ujeebu-org/ujeebu-sdk';
import fs from 'fs';

const client = new UjeebuClient(process.env.UJEEBU_API_KEY);

const screenshot = await client.getScreenshot('https://example.com', {
  js: true,
  device: 'mobile',
  window_width: 375,
  window_height: 812
});

fs.writeFileSync('custom-mobile.png', screenshot);
import requests

response = requests.get(
    'https://api.ujeebu.com/scrape',
    params={
        'url': 'https://example.com',
        'response_type': 'screenshot',
        'device': 'mobile',
        'window_width': 375,
        'window_height': 812,
        'js': 'true'
    },
    headers={'ApiKey': 'YOUR_API_KEY'}
)

with open('custom-mobile.png', 'wb') as f:
    f.write(response.content)
from ujeebu_python import UjeebuClient

ujeebu = UjeebuClient(api_key="YOUR_API_KEY")

screenshot = ujeebu.get_screenshot(
    url='https://example.com',
    params={
        'js': True,
        'device': 'mobile',
        'window_width': 375,
        'window_height': 812
    }
)

with open('custom-mobile.png', 'wb') as f:
    f.write(screenshot)
import okhttp3.*;
import java.io.*;

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
    .url("https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=mobile&window_width=375&window_height=812&js=true")
    .addHeader("ApiKey", "YOUR_API_KEY")
    .build();

Response response = client.newCall(request).execute();

try (FileOutputStream fos = new FileOutputStream("custom-mobile.png")) {
    fos.write(response.body().bytes());
}
<?php

$url = 'https://api.ujeebu.com/scrape?' . http_build_query([
    'url' => 'https://example.com',
    'response_type' => 'screenshot',
    'device' => 'mobile',
    'window_width' => 375,
    'window_height' => 812,
    'js' => 'true'
]);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['ApiKey: YOUR_API_KEY']);

$screenshot = curl_exec($ch);
curl_close($ch);

file_put_contents('custom-mobile.png', $screenshot);
package main

import (
	"io"
	"net/http"
	"os"
)

func main() {
	url := "https://api.ujeebu.com/scrape?url=https://example.com&response_type=screenshot&device=mobile&window_width=375&window_height=812&js=true"
	
	req, _ := http.NewRequest("GET", url, nil)
	req.Header.Set("ApiKey", "YOUR_API_KEY")
	
	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	
	file, _ := os.Create("custom-mobile.png")
	defer file.Close()
	
	io.Copy(file, resp.Body)
}
package main

import (
	"os"
	"github.com/ujeebu/ujeebu-go"
)

func main() {
	client, _ := ujeebu.NewClient("YOUR-API-KEY")
	
	screenshot, _, _ := client.Screenshot(ujeebu.ScrapeParams{
		URL:          "https://example.com",
		JS:           true,
		Device:       "mobile",
		WindowWidth:  375,
		WindowHeight: 812,
	}, false, "")
	
	os.WriteFile("custom-mobile.png", screenshot, 0644)
}
Ready to build?

Spin up an API key in 60 seconds

Free tier: 5,000 credits, no card, full access to every endpoint on this page.