Scrape with Browser

https://api.usetrove.io/v1/scrape/browser?key=<YOUR_TROVE_KEY>

The scrape endpoint allows you to make requests that will render the final webpage including javascript as well as other resources and then scrape content based on your selectors.


Query Parameters

NameTypeUsage
key requiredstringUsed to validate your access to the api.

Request Body

NameTypeUsage
url requiredstringUsed to visit your target website.
output requiredobject<string, array<ScrapeElement> || ScrapeElement>Add scrape output to your requests. Must be an object type whose values contains either an array of scrape elements or a single scrape element.
headers optionalobject<string, string>Add arbitrary extra headers to your requests.
cookies optionalarray<cookie>Add arbitrary cookies to your requests.

Response Type

application/json

Example of the output field with an array of scrape elements

{
"url": "https://google.com/search?q=social%20media%20marketing",
"output": {
"ads": [
{
"label": "ad_link",
"attribute": "data-pcu",
"selector": "//div/div/div/div/a[contains(., 'ad')][@data-pcu]"
},
{
"label": "ad_company",
"selector": "//div/div/div/div/a[contains(., 'ad')][@data-pcu]/div[@role='heading']/span"
},
{
"label": "ad_text",
"selector": "//div/div/div/div/a[contains(., 'ad')][@data-pcu]/../following-sibling::div[1]"
}
]
}
}

Example of the output field with a single scrape element

{
"url": "https://google.com/search?q=social%20media%20marketing",
"output": {
"next_page": {
"label": "next_page",
"attribute": "href",
"selector": "//a[@id='pnnext']"
}
}
}