Actor picture

Email ✉️ & Phone ☎️ extractor

anchor/email-phone-extractor

Extract emails, phone numbers, and many other contact information from a list of website you provide. The difference with "Contact Details Scraper" is that it adds the ability to specify url patterns that your robot is going to follow. Useful for big website with useless section.

No credit card required

Author's avatarguillim
  • Modified
  • Users72
  • Runs185
Actor picture

Email ✉️ & Phone ☎️ extractor

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 = {
    "startUrls": [
        {
            "url": "https://apify.com"
        }
    ],
    "maxDepth": 2,
    "maxRequests": 100,
    "pseudoUrls": [
        ".*"
    ]
};

(async () => {
    // Run the actor and wait for it to finish
    const run = await client.actor("anchor/email-phone-extractor").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);
    });
})();