Blocking Options
Block unwanted content like ads, trackers, cookie banners, and chat widgets for cleaner screenshots.
Full Configuration
{ "block": { "ads": true, "trackers": true, "cookie_banners": true, "chat_widgets": true, "requests": ["*google-analytics*", "*.doubleclick.net"], "resources": ["font", "media"] } }
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
ads |
boolean | false |
Block known ad networks |
trackers |
boolean | false |
Block analytics/tracking scripts |
cookie_banners |
boolean | false |
Auto-dismiss cookie consent notices |
chat_widgets |
boolean | false |
Block Intercom, Drift, Zendesk, etc. |
requests |
array | — | URL patterns to block (glob syntax) |
resources |
array | — | Resource types to block |
Block Ads
Block requests to known advertising networks:
{ "block": { "ads": true } }
Blocks networks including Google Ads, Facebook Ads, Amazon Ads, and hundreds more.
Block Trackers
Block analytics and tracking scripts:
{ "block": { "trackers": true } }
Blocks Google Analytics, Mixpanel, Segment, Hotjar, and similar services.
Block Cookie Banners
Automatically dismiss cookie consent dialogs:
{ "block": { "cookie_banners": true } }
Uses a combination of auto-clicking consent buttons and hiding common cookie banner elements.
Block Chat Widgets
Block live chat and support widgets:
{ "block": { "chat_widgets": true } }
Blocks Intercom, Drift, Zendesk, Crisp, and other chat platforms.
Block by URL Pattern
Block specific URLs using glob patterns:
{ "block": { "requests": [ "*google-analytics*", "*.doubleclick.net", "*facebook.com/tr*", "*/ads/*" ] } }
Glob Pattern Syntax
| Pattern | Matches |
|---|---|
* |
Any characters within a path segment |
** |
Any characters across path segments |
? |
Single character |
Examples:
- *analytics* — URLs containing "analytics"
- *.example.com — Any subdomain of example.com
- */tracking/* — URLs with "/tracking/" in path
Block Resource Types
Block specific types of resources:
{ "block": { "resources": ["font", "media"] } }
Available Resource Types
| Type | Description |
|---|---|
image |
Images (PNG, JPEG, GIF, etc.) |
font |
Web fonts |
media |
Video and audio |
script |
JavaScript files |
stylesheet |
CSS files |
Note: Blocking script or stylesheet may break page rendering.
GET Request Parameters
| Query Param | Maps to |
|---|---|
block_ads |
block.ads |
block_cookies |
block.cookie_banners |
GET /v1/screenshot?url=https://example.com&block_ads=true&block_cookies=true
Common Patterns
Clean Marketing Screenshot
{ "url": "https://example.com", "block": { "ads": true, "trackers": true, "cookie_banners": true, "chat_widgets": true } }
Faster Loading (No Media)
{ "url": "https://example.com", "block": { "resources": ["media", "font"] } }
Block Specific Third-Party Services
{ "url": "https://example.com", "block": { "requests": [ "*hotjar*", "*fullstory*", "*mouseflow*" ] } }
Examples
Clean E-commerce Screenshot
curl -X POST https://api.renderscreenshot.com/v1/screenshot \ -H "Authorization: Bearer rs_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://store.example.com/product", "block": { "ads": true, "cookie_banners": true, "chat_widgets": true } }' \ --output product.png
Documentation Screenshot
curl -X POST https://api.renderscreenshot.com/v1/screenshot \ -H "Authorization: Bearer rs_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://docs.example.com", "block": { "requests": ["*feedback-widget*", "*announcement-banner*"] } }' \ --output docs.png
Combining with Page Modifications
For more control, combine blocking with page modifications:
{ "url": "https://example.com", "block": { "ads": true, "trackers": true }, "page": { "remove": [".custom-popup", ".newsletter-modal"] } }
See Also
- Page Modifications - Hide/remove elements
- Network Options - Custom headers and cookies
- Wait Options - Timing after blocking