Skip to main content

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

bash
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

User agent object format

{
  "userAgent": "Mozilla/5.0 ...",
  "platform": "iPhone",
  "userAgentMetadata": {
    "brands": [
      {"brand": "Chrome", "version": "120"}
    ],
    "platform": "iOS",
    "platformVersion": "14_0",
    "architecture": "",
    "model": "iPhone",
    "mobile": true
  }
}

Fields

FieldTypeRequiredDescription
userAgentstringNoFull user agent string
platformstringNoPlatform identifier (e.g., “Win32”, “iPhone”)
userAgentMetadataobjectNoClient Hints user agent data

Common user agents

Use caseUser agent
Chrome WindowsMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
Safari iPhoneMozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X)
GooglebotMozilla/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

ParameterTypeDescription
customUserAgentstringJSON object with user agent details

See also