This workflow automation will automatically find you decision-makers (first Name, last Name, and LinkedIn profile URL) from a list of companies.
For this automation to work, you must have a Google sheet with company domains and names and one column containing the job title you’re looking for (i.e., CEO, marketing manager, head of sales, etc.).
So, let’s see it in practice.
/**
* Find a LinkedIn profile from company name and job title
*
* @param {string} companyName company where your prospect is working
* @param {string} [jobTitle] job you are targeting, default value is "CEO"
* @return if found the LinkedIn URL and name of the prospect
* @customfunction
*/
function getPerson(companyName, jobTitle = "CEO") {
// Get a Custom Search API Key
// Follow this link to get it https://developers.google.com/custom-search/v1/overview
var key = "YOUR API";
// Create a Programmable Search Engine
// Follow this link to create it -> https://programmablesearchengine.google.com/
let searchEngineId = "YOUR KEY";
// Save your project and it's ready to use
let search = "site:linkedin.com/in intitle:" + jobTitle + " " + companyName;
// Call Google Custom Search API
var options = {
method: "get",
contentType: "application/json",
};
var response = UrlFetchApp.fetch(
"https://www.googleapis.com/customsearch/v1?key=" +
key +
"&q=" +
search +
"&cx=" +
searchEngineId,
options
);
// Parse LinkedIn URL and name
var url = JSON.parse(response).items[0].formattedUrl;
var title = JSON.parse(response).items[0].title.split("-")[0];
// Return the results in a 2D array
return [[title, url]];
}
When entered, your App Scrip dashboard should look like this:
Now it’s time to find your API and KEY so we can run this script.
Leave this tab open. Now, let's find your key:
As a result, you’ll get decision-makers for the majority of the companies, as well as their LinkedIn profiles:
And that’s it! In 5 minutes you have a list of hundreds of LinkedIn profiles and decision makers.
If you do your outreach on LinkedIn, you have everything you need. But if you need emails, you can always quickly upload this sheet to Apollo or Snov.io, and you’re ready to go.
Let’s go hustling.
P.S.
If you didn’t already, subscribe to our exclusive newsletter where we share real-life and expert insights on how to grow your Lead Gen Agency to over $240k/yr in less than 60 days.