Skip to content
Login Sign up

JavaScript instructions

Pass a URL-encoded JSON array of browser actions to js_instructions. The API runs them in order before returning the final HTML. Useful for paginated lists, infinite scroll, and form-driven flows.

GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>&render_js=1&js_instructions=<URL_ENCODED_JSON>
ParameterTypeRequiredDescription
api_keystringyesYour Web Scraping API key
urlstringyesTarget URL to fetch
js_instructionsstringyesURL-encoded JSON array of action objects.
render_jsintegeryesMust be 1.
FieldTypeDescription
actionstringOne of click, scrollTo, focus, value, or submit (forms only).
selectorstringCSS selector for the target element.
timeoutintegerMilliseconds to wait after this action completes.
[{"action":"scrollTo","selector":"div.navFooterBackToTop","timeout":5000,"block":"start"}]
Terminal window
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&render_js=1&js_instructions=%5B%7B%22action%22%3A%22scrollTo%22%2C%22selector%22%3A%22div.navFooterBackToTop%22%2C%22timeout%22%3A%205000%2C%20%22block%22%3A%20%22start%22%7D%5D"
<!doctype html>
<html>
<head>
<title>Example Domain</title>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in illustrative examples in documents.</p>
</div>
</body>
</html>