The Screenshot endpoint captures a pixel-perfect screenshot of any URL. It renders JavaScript, blocks ads and cookie banners, handles CAPTCHAs, and can emulate any device or viewport size. Costs 5 credits per request.
Endpoint: POST https://api.geekflare.com/screenshot
Install the official SDK: npm install @geekflare/api-node or pip install geekflare-api
Basic Screenshot
Capture a screenshot and get back a CDN URL to the image.
Node.js SDK
Python SDK
cURL
import { GeekflareClient } from '@geekflare/api-node' ;
const client = new GeekflareClient ({ apiKey: 'YOUR_API_KEY' });
const result = await client . screenshot ({ url: 'https://example.com' });
console . log ( result );
from geekflare_api.client import GeekflareClient
from geekflare_api.models import ScreenshotDto
with GeekflareClient( api_key = 'YOUR_API_KEY' ) as client:
result = client.screenshot(ScreenshotDto( url = 'https://example.com' ))
print (result)
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
{
"timestamp" : 1778737930991 ,
"apiStatus" : "success" ,
"apiCode" : 200 ,
"meta" : {
"url" : "https://example.com" ,
"type" : "png" ,
"device" : "desktop" ,
"fullPage" : false ,
"blockAds" : true ,
"hideCookie" : true ,
"skipCaptcha" : true ,
"addTimestamp" : false ,
"test" : { "id" : "abc123" }
},
"data" : "https://cdn.geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png"
}
Full-Page Screenshot
Capture the entire scrollable page, not just the viewport.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
fullPage: true
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , full_page = True ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "fullPage": true}'
Capture a Specific Element (CSS Selector)
Capture only the element matching a CSS selector instead of the full viewport or page. Combine with fallbackToFullPage to gracefully fall back to a full-page capture if the selector isn’t found, instead of failing the request.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
selector: '.hero-section' ,
fallbackToFullPage: true
});
result = client.screenshot(ScreenshotDto(
url = 'https://example.com' ,
selector = '.hero-section' ,
fallback_to_full_page = True
))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "selector": ".hero-section", "fallbackToFullPage": true}'
If selector is omitted, the endpoint captures the full viewport (or full
page, if fullPage is true). If selector is set and no matching element
is found, the request fails unless fallbackToFullPage is true.
Choose between PNG, JPEG, or WebP output and control quality for JPEG/WebP.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
type: 'webp' ,
quality: 85
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , type = 'webp' , quality = 85 ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "type": "webp", "quality": 85}'
Device Emulation
Emulate a mobile device to capture mobile-specific layouts.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
device: 'mobile'
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , device = 'mobile' ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "device": "mobile"}'
Custom Viewport
Set a custom viewport width, height, or page height for partial screenshots. Use captureBeyondViewport to allow the capture to include content that extends beyond the configured viewport dimensions.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
viewportWidth: 1440 ,
viewportHeight: 900 ,
pageHeight: 1200 ,
captureBeyondViewport: true
});
result = client.screenshot(ScreenshotDto(
url = 'https://example.com' ,
viewport_width = 1440 ,
viewport_height = 900 ,
page_height = 1200 ,
capture_beyond_viewport = True
))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "viewportWidth": 1440, "viewportHeight": 900, "pageHeight": 1200, "captureBeyondViewport": true}'
Retina / High-DPI
Capture Retina-quality screenshots using a higher device scale factor.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
scaleFactor: 2
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , scale_factor = 2 ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "scaleFactor": 2}'
Dark Mode
Render the page in dark mode before capturing.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
theme: 'dark'
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , theme = 'dark' ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "theme": "dark"}'
Highlight Links (AI Vision)
Draw visible borders around all clickable links, buttons, and inputs. Useful for AI vision models and LLM web browsing agents.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
highlightLinks: true
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , highlight_links = True ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "highlightLinks": true}'
Remove Background
Remove the page background for transparent PNG output. Useful for design tools.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
removeBackground: true ,
type: 'png'
});
result = client.screenshot(ScreenshotDto(
url = 'https://example.com' ,
remove_background = True ,
type = 'png'
))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "removeBackground": true, "type": "png"}'
Add Timestamp
Add a timestamp watermark to the screenshot for audit trails or monitoring.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
addTimestamp: true
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , add_timestamp = True ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "addTimestamp": true}'
Proxy Routing
Route the browser through a specific country’s IP to capture geo-specific or localized content.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
proxyCountry: 'de'
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , proxy_country = 'de' ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "proxyCountry": "de"}'
Delayed Screenshot
Wait a set number of seconds after page load before capturing. Useful for pages with animations or slow-loading widgets.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
delay: 3
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , delay = 3 ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "delay": 3}'
Disable Animations
Freeze CSS animations and transitions before capturing. Produces cleaner, more consistent screenshots.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
disableAnimations: true
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , disable_animations = True ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "disableAnimations": true}'
Inline Response
By default, the endpoint returns a CDN URL pointing to the generated image (see data in the response above). Set inline: true to receive the image data directly in the response instead, which can save a round trip if you don’t need the image hosted.
Node.js SDK
Python SDK
cURL
const result = await client . screenshot ({
url: 'https://example.com' ,
inline: true
});
result = client.screenshot(ScreenshotDto( url = 'https://example.com' , inline = True ))
curl -X POST https://api.geekflare.com/screenshot \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "inline": true}'
All Parameters
Parameter Type Default Description urlstring required Target URL devicedesktop | mobiledesktopDevice to emulate typepng | jpeg | webppngImage format fullPageboolean falseCapture full scrollable page selectorstring — CSS selector for the element to capture fallbackToFullPageboolean falseFall back to a full-page capture if selector isn’t found blockAdsboolean trueBlock ads before capturing hideCookieboolean trueRemove cookie consent banners skipCaptchaboolean trueAttempt to bypass CAPTCHAs proxyCountrystring — Route browser through country ISO code viewportWidthnumber — Viewport width in pixels (320–3840) viewportHeightnumber — Viewport height in pixels (240–2160) pageHeightnumber — Page height for partial screenshot (100–5000) captureBeyondViewportboolean — Capture content beyond viewport scaleFactornumber — Device pixel ratio (0.1–5). Use 2–3 for Retina themelight | dark | autoautoColor scheme qualitynumber — Image quality 10–100 (JPEG/WebP only) delaynumber — Seconds to wait after page load (0–10) highlightLinksboolean falseDraw borders around links/buttons (AI vision) removeBackgroundboolean falseRemove page background (PNG only) disableAnimationsboolean falseFreeze CSS animations before capture addTimestampboolean falseAdd timestamp watermark inlineboolean falseReturn image data inline instead of a CDN URL
Credits
Node.js SDK npm install @geekflare/api-node
Python SDK pip install geekflare-api