Output Types
Plain HTML
By default, the scraper API returns plain HTML without requiring any additional parameters. This does not require javascript rendering to be enabled! Here are some examples:
- Axios
- Curl
const axios = require('axios').default;
const options = {
method: 'GET',
url: 'https://api.scrapeautomate.com/scraper',
params: {
apiKey: '<exampleToken>',
render: 'false',
url: 'https://example.com/',
},
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
curl --request GET \
--url 'https://api.scrapeautomate.com/scraper?apiKey=<exampleToken>&render=false&url=https%3A%2F%2Fexample.com%2F' \
Screenshot
Full Page Screenshot
To capture a full-page screenshot, set the screenshot_full_page
parameter to true. This captures the entire length of the web page. This requires for render to be enabled!
- Axios
- Curl
const axios = require('axios').default;
const options = {
method: 'GET',
url: 'https://api.scrapeautomate.com/scraper',
params: {
apiKey: '<exampleToken>',
render: 'true',
url: 'https://example.com/',
screenshot_full_page: 'true',
},
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
curl --request GET \
--url 'https://api.scrapeautomate.com/scraper?apiKey=<exampleToken>&render=true&url=https%3A%2F%2Fexample.com%2F&screenshot_full_page=true' \
Viewport Screenshot
To capture a screenshot of the current viewport or how much the current user can see, set the screenshot
parameter to true. This captures only the visible part of the web page within the viewport. This requires for render to be enabled!
- Axios
- Curl
const axios = require('axios').default;
const options = {
method: 'GET',
url: 'https://api.scrapeautomate.com/scraper',
params: {
apiKey: '<exampleToken>',
render: 'true',
url: 'https://example.com/',
screenshot: 'true',
},
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
curl --request GET \
--url 'https://api.scrapeautomate.com/scraper?apiKey=<exampleToken>&render=true&url=https%3A%2F%2Fexample.com%2F&screenshot=true' \