Capture a full-height screenshot of a webpage
Prerequisites
1
Execute the Request
curl https://api.gaffa.dev/v1/browser/requests \
--request POST \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{
"url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
"async": false,
"max_cache_age": 0,
"settings": {
"actions": [
{
"type": "wait",
"selector": "#cookie-policy-notice",
"timeout": 10000,
"continue_on_fail": true
},
{
"type": "click",
"selector": "#cookie-policy-notice",
"continue_on_fail": true
},
{
"type": "wait",
"selector": "#firstHeading",
"timeout": 10000
},
{
"type": "scroll",
"percentage": 100
},
{
"type": "capture_screenshot",
"size": "fullscreen"
}
]
}
}'2
Retrieve Your Screenshot
{
"data": {
"id": "brq_VJX3mbESLiyCFYvZQEUih9RdDYovog",
"url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
"proxy_location": null,
"state": "completed",
"credit_usage": 2,
"http_status_code": 200,
"from_cache": false,
"started_at": "2025-06-09T15:55:46.4235903Z",
"completed_at": "2025-06-09T15:56:27.9381332Z",
"running_time": "00:00:40.7348244",
"page_load_time": "00:00:02.2087117",
"actions": [
{
"id": "act_VJX3memaue6YUgFcn44uNscZbVUpYg",
"type": "wait",
"query": "wait?selector=%23cookie-policy-notice%2C%20.mw-cookie-consent-container&timeout=10000&continue_on_fail=true",
"timestamp": "2025-06-09T15:55:48.6323091Z",
"error": "action_timed_out"
},
{
"id": "act_VJX3mkwfwNPdGiMUpqKr34Tm5xzyUU",
"type": "click",
"query": "click?selector=%23cookie-policy-notice%20button%2C%20.mw-cookie-consent-container%20button&continue_on_fail=true&timeout=5000",
"timestamp": "2025-06-09T15:55:58.7949275Z",
"error": "action_timed_out"
},
{
"id": "act_VJX3mkSJ3sevWRXUCjFy6zwfD172fV",
"type": "wait",
"query": "wait?selector=%23firstHeading&timeout=10000&continue_on_fail=false",
"timestamp": "2025-06-09T15:56:03.9581113Z"
},
{
"id": "act_VJX3mbq9Jgj8EwADszW2AqdeJJXJiY",
"type": "scroll",
"query": "scroll?percentage=100&max_scroll_time=20000&scroll_speed=medium&continue_on_fail=false",
"timestamp": "2025-06-09T15:56:03.9691994Z"
},
{
"id": "act_VJX3mjBQYv8zTsXv1SkgUnBkzNFmJU",
"type": "capture_screenshot",
"query": "capture_screenshot?size=fullscreen&continue_on_fail=false",
"timestamp": "2025-06-09T15:56:20.0727905Z",
"output": "https://storage.gaffa.dev/brq/image/brq_VJX3mbESLiyCFYvZQEUih9RdDYovog/act_VJX3mjBQYv8zTsXv1SkgUnBkzNFmJU_full.png"
}
]
},
"error": null
}Use Cases
All this is powered by Gaffa’s hosted headless browsers with no local setup required. Experiment with more actions and build complex browser workflows easily. Refer to the full Browser Requests API documentation for additional capabilities.
PreviousConvert any webpage into LLM-ready Markdown using GaffaNextHow to scrape all images from a website using Gaffa
Last updated