cURL
curl --request POST \ --url https://www.fetchserp.com/api/v1/scrape_js \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://fetchserp.com", "js_script": "return { h1: document.querySelector('\''h1'\'')?.innerText, content: document.body.innerText }" }'
{ "data": { "web_page": { "h1": "<string>", "content": "<string>" } } }
A bearer token that will be supplied within an Authorization header as bearer <token>.
Authorization
bearer <token>
The url to scrap
The javascript code to execute on the page
The payload to send
The body is of type object.
object
success
The response is of type object.