Scrape Canva.com to crawl thousands of templates. Specify any keywords and extract data on all available templates on that keyword. You can scrape templates from search, list or users detail pages. Get colors, fonts, images, users and many more!
- Modified
- Users13
- Runs83
To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running actors via the API in Apify Docs.
const { ApifyClient } = require('apify-client');
// Initialize the ApifyClient with API token
const client = new ApifyClient({
token: '<YOUR_API_TOKEN>',
});
// Prepare actor input
const input = {
"search": "baby instagram",
"maxItems": 20,
"endPage": 1,
"startUrls": [
"https://www.canva.com/posters/templates/",
"https://www.canva.com/templates/?query=baby&continuation=50",
"https://www.canva.com/p/templates/EAFCgIJdXTw-brown-aesthetic-new-dad-fist-bumps-father-s-day-instagram-post/",
"https://www.canva.com/p/donnamoritz/"
],
"extendOutputFunction": ($) => { return {} },
"customMapFunction": (object) => { return {...object} },
"proxy": {
"useApifyProxy": true
}
};
(async () => {
// Run the actor and wait for it to finish
const run = await client.actor("epcsht/canva-scraper").call(input);
// Fetch and print actor results from the run's dataset (if any)
console.log('Results from dataset');
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
console.dir(item);
});
})();