Custom User Agent
Set a custom user agent to test how pages render for different browsers and devices.
DomShot’s default user agent is already optimized to bypass most bot detection systems, including Cloudflare. Only use a custom user agent when you need specific browser or device emulation.
Basic usage
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&customUserAgent=%7B%22userAgent%22%3A%22Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%2014_0%20like%20Mac%20OS%20X)%22%7D" \
--output screenshot.png
{
"userAgent": "Mozilla/5.0 ...",
"platform": "iPhone",
"userAgentMetadata": {
"brands": [
{"brand": "Chrome", "version": "120"}
],
"platform": "iOS",
"platformVersion": "14_0",
"architecture": "",
"model": "iPhone",
"mobile": true
}
}
Fields
| Field | Type | Required | Description |
|---|
userAgent | string | No | Full user agent string |
platform | string | No | Platform identifier (e.g., “Win32”, “iPhone”) |
userAgentMetadata | object | No | Client Hints user agent data |
Common user agents
| Use case | User agent |
|---|
| Chrome Windows | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 |
| Safari iPhone | Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) |
| Googlebot | Mozilla/5.0 (compatible; Googlebot/2.1) |
Custom user agents may trigger bot detection systems. The default DomShot user agent is optimized to bypass most protections including Cloudflare.
Parameters
| Parameter | Type | Description |
|---|
customUserAgent | string | JSON object with user agent details |
See also