在需要使用 ScreenshotOne 通过直接的 curl 命令截取网页截图并保存到本地文件,或选择截图选项时使用此技能。
Use this skill to capture website screenshots through ScreenshotOne's HTTP API with curl.
Prefer direct curl --get --data-urlencode requests so the command is visible, easy to tweak, and easy to copy into GitHub examples.
Get your API key first:
access_key.Set your API key first:
bash
export SCREENSHOTONE_ACCESS_KEY="your_access_key"
Take a basic screenshot:
bash
curl --fail --silent --show-error --location --get \
--output "example.png" \
--data-urlencode "url=https://example.com" \
--data-urlencode "access_key=${SCREENSHOTONE_ACCESS_KEY}" \
--data-urlencode "format=png" \
"https://api.screenshotone.com/take"
Take a full-page screenshot with a larger viewport:
bash
curl --fail --silent --show-error --location --get \
--output "example-full-page.png" \
--data-urlencode "url=https://example.com" \
--data-urlencode "access_key=${SCREENSHOTONE_ACCESS_KEY}" \
--data-urlencode "format=png" \
--data-urlencode "full_page=true" \
--data-urlencode "viewport_width=1440" \
--data-urlencode "viewport_height=2200" \
"https://api.screenshotone.com/take"
Wait for content and hide UI noise before capture:
bash
curl --fail --silent --show-error --location --get \
--output "example-clean.png" \
--data-urlencode "url=https://example.com" \
--data-urlencode "access_key=${SCREENSHOTONE_ACCESS_KEY}" \
--data-urlencode "format=png" \
--data-urlencode "wait_until=networkidle" \
--data-urlencode "delay=2" \
--data-urlencode "block_cookie_banners=true" \
--data-urlencode "hide_selectors=.chat-widget,.newsletter-modal" \
"https://api.screenshotone.com/take"
format.SCREENSHOTONE_ACCESS_KEY.curl --get and repeated --data-urlencode "key=value" flags.references/screenshotone-options.md first.Use this pattern for most requests:
bash
curl --fail --silent --show-error --location --get \
--output "<output-file>" \
--data-urlencode "url=<target-url>" \
--data-urlencode "access_key=${SCREENSHOTONE_ACCESS_KEY}" \
--data-urlencode "format=png" \
--data-urlencode "<option>=<value>" \
"https://api.screenshotone.com/take"
Use these groups first:
full_page, viewport_width, viewport_height, selectorwait_until, delay, timeout, wait_for_selectorblock_cookie_banners, block_ads, hide_selectors, stylesformat, image_quality, image_width, image_height, omit_backgroundcookies, headers, authorization, proxy, user_agentIf a request needs less common parameters, look them up in references/screenshotone-options.md, then add them as another --data-urlencode "key=value" flag.
references/screenshotone-options.md: condensed option guide based on the official docs at https://screenshotone.com/docs/options/