Skip to content

Screenshots API

2 operationsscreenshots:writescreenshots:read

Render a page or raw HTML to PNG, JPEG, WebP or PDF, with full-page capture, browser actions, ad blocking and caching.

POST/screenshotsCapture a web page or HTML as PNG, JPEG, WebP or PDF, as JSON or the image bytes.
GET/screenshots/{screenshotId}Get a screenshot and its image URL.

Capture a web page or HTML as PNG, JPEG, WebP or PDF, as JSON or the image bytes.

POST/v1/screenshots
scope screenshots:write

Bills 10 units per successful capture, recorded by the screenshot service when the capture succeeds. Cache hits are free.

Parameters

responseType
string
jsonbinary
default json

Request body

async
boolean
cacheTtl
integer (int32)
idempotencyKey
string
options
Options | null
required
actions
Action[]
authorization
BasicAuth | null
blockAds
boolean | null
blockChats
boolean | null
blockCookieBanners
boolean | null
blockResources
string[]
click
string
clipHeight
integer (int32)
clipWidth
integer (int32)
clipX
integer (int32)
clipY
integer (int32)
cookies
Cookie[]
cssUrls
string[]
darkMode
boolean
delayMs
integer (int32)
deviceScaleFactor
number (double)
disableJavascript
boolean
failOnHttpError
boolean
format
string
fullPage
boolean
fullPageMaxHeight
integer (int32)
fullPageScroll
boolean | null
fullPageScrollBy
integer (int32)
fullPageScrollDelayMs
integer (int32) | null
geolocationAccuracy
number (double) | null
geolocationLatitude
number (double) | null
geolocationLongitude
number (double) | null
headers
map
hideSelectors
string[]
html
string
imageQuality
integer (int32)
imageWidth
integer (int32)
initScript
string
locale
string
mediaType
string
omitBackground
boolean
pdfLandscape
boolean
pdfMargin
string
pdfPaperFormat
string
pdfPrintBackground
boolean | null
proxy
string
reducedMotion
boolean
scripts
string
scrollToElement
string
selector
string
styles
string
timeZone
string
timeoutSeconds
integer (int32)
tunnel
string
url
string
userAgent
string
viewportDevice
string
viewportHasTouch
boolean | null
viewportHeight
integer (int32)
viewportLandscape
boolean
viewportMobile
boolean | null
viewportWidth
integer (int32)
waitForSelector
string
waitUntil
string

Response

29 fields
asyncboolean
attemptinteger (int32)
cachedboolean
clientRefstring
contentTypestring
createdAtinteger (int64)
durationMsinteger (int32)
errorCodestring
errorMessagestring
evaluateResultsany[]
finalUrlstring
finishedAtinteger (int64) | null
heightinteger (int32)
httpStatusinteger (int32)
idempotencyKeystring | null
maxAttemptsinteger (int32)
nextAttemptAtinteger (int64)
ogDescriptionstring
ogImagestring
ogTitlestring
screenshotIdstring
sizeBytesinteger (int64)
statusstring
titlestring
tokenIdstring
truncatedboolean
ttlinteger (int64)
urlstring
widthinteger (int32)
curl -X POST "https://api.hoshime.com/v1/screenshots" \
  -H "Authorization: Bearer $HOSHIME_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "async": false,
    "cacheTtl": 0,
    "idempotencyKey": "…",
    "options": {
      "actions": [
        {
          "height": 0,
          "key": "…",
          "maxLoops": 0,
          "ms": 0,
          "optional": null,
          "script": "…",
          "selector": "…",
          "text": "…",
          "type": "…",
          "url": "https://…",
          "urlPattern": "…",
          "values": [],
          "width": 0
        }
      ],
      "authorization": {
        "password": "…",
        "username": "…"
      },
      "blockAds": false,
      "blockChats": false,
      "blockCookieBanners": false,
      "blockResources": [
        "…"
      ],
      "click": "…",
      "clipHeight": 0,
      "clipWidth": 0,
      "clipX": 0,
      "clipY": 0,
      "cookies": [
        {
          "domain": "…",
          "name": "…",
          "path": "…",
          "value": "…"
        }
      ],
      "cssUrls": [
        "…"
      ],
      "darkMode": false,
      "delayMs": 0,
      "deviceScaleFactor": 0,
      "disableJavascript": false,
      "failOnHttpError": false,
      "format": "…",
      "fullPage": false,
      "fullPageMaxHeight": 0,
      "fullPageScroll": false,
      "fullPageScrollBy": 0,
      "fullPageScrollDelayMs": 0,
      "geolocationAccuracy": 0,
      "geolocationLatitude": 0,
      "geolocationLongitude": 0,
      "headers": {},
      "hideSelectors": [
        "…"
      ],
      "html": "…",
      "imageQuality": 0,
      "imageWidth": 0,
      "initScript": "…",
      "locale": "…",
      "mediaType": "…",
      "omitBackground": false,
      "pdfLandscape": false,
      "pdfMargin": "…",
      "pdfPaperFormat": "…",
      "pdfPrintBackground": false,
      "proxy": "…",
      "reducedMotion": false,
      "scripts": "…",
      "scrollToElement": "…",
      "selector": "…",
      "styles": "…",
      "timeZone": "…",
      "timeoutSeconds": 0,
      "tunnel": "…",
      "url": "https://…",
      "userAgent": "…",
      "viewportDevice": "…",
      "viewportHasTouch": false,
      "viewportHeight": 0,
      "viewportLandscape": false,
      "viewportMobile": false,
      "viewportWidth": 0,
      "waitForSelector": "…",
      "waitUntil": "…"
    }
  }'
200 Response shape
{
  "async": false,
  "attempt": 0,
  "cached": false,
  "clientRef": "…",
  "contentType": "…",
  "createdAt": 0,
  "durationMs": 0,
  "errorCode": "…",
  "errorMessage": "…",
  "evaluateResults": [
    null
  ],
  "finalUrl": "https://…",
  "finishedAt": 0,
  "height": 0,
  "httpStatus": 0,
  "idempotencyKey": "…",
  "maxAttempts": 0,
  "nextAttemptAt": 0,
  "ogDescription": "…",
  "ogImage": "…",
  "ogTitle": "…",
  "screenshotId": "abc123",
  "sizeBytes": 0,
  "status": "…",
  "title": "…",
  "tokenId": "abc123",
  "truncated": false,
  "ttl": 0,
  "url": "https://…",
  "width": 0
}

Get a screenshot and its image URL.

GET/v1/screenshots/{screenshotId}
scope screenshots:read

Parameters

screenshotId
string · path
required

Response

29 fields
asyncboolean
attemptinteger (int32)
cachedboolean
clientRefstring
contentTypestring
createdAtinteger (int64)
durationMsinteger (int32)
errorCodestring
errorMessagestring
evaluateResultsany[]
finalUrlstring
finishedAtinteger (int64) | null
heightinteger (int32)
httpStatusinteger (int32)
idempotencyKeystring | null
maxAttemptsinteger (int32)
nextAttemptAtinteger (int64)
ogDescriptionstring
ogImagestring
ogTitlestring
screenshotIdstring
sizeBytesinteger (int64)
statusstring
titlestring
tokenIdstring
truncatedboolean
ttlinteger (int64)
urlstring
widthinteger (int32)
curl "https://api.hoshime.com/v1/screenshots/{screenshotId}" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"
200 Response shape
{
  "async": false,
  "attempt": 0,
  "cached": false,
  "clientRef": "…",
  "contentType": "…",
  "createdAt": 0,
  "durationMs": 0,
  "errorCode": "…",
  "errorMessage": "…",
  "evaluateResults": [
    null
  ],
  "finalUrl": "https://…",
  "finishedAt": 0,
  "height": 0,
  "httpStatus": 0,
  "idempotencyKey": "…",
  "maxAttempts": 0,
  "nextAttemptAt": 0,
  "ogDescription": "…",
  "ogImage": "…",
  "ogTitle": "…",
  "screenshotId": "abc123",
  "sizeBytes": 0,
  "status": "…",
  "title": "…",
  "tokenId": "abc123",
  "truncated": false,
  "ttl": 0,
  "url": "https://…",
  "width": 0
}
esc
↑↓ move↵ open