How to fully automate LinkedIn lead search, at any scale?
Are you looking for a solution to integrate LinkedIn leads into your sales process automatically? In this article, I’ll show you how to leverage our API to scrape leads from LinkedIn Sales Navigator searches programmatically—without using your own LinkedIn account, without providing any cookies, and without requiring a browser extension. All you need to provide are the search criteria.
Below is how you can do it easily in the Python language, step by step.
1
Initiate a Search
Copy
import requestsimport time# Replace this with your actual API keyapi_key = "YOUR_API_KEY"# API base URLapi_host = "fresh-linkedin-profile-data.p.rapidapi.com"def initiate_search(): url = f"https://{api_host}/search-employees" payload = { "geo_codes": [103644278], # United States "title_keywords": ["Owner", "Founder", "Director"], "industry_codes": [4], # Software Development "company_headcounts": ["11-50", "51-200"], "limit": 50 #set max number of results to be scraped } headers = { "x-rapidapi-key": api_key, "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) response_data = response.json() print("Initiate Search Response:", response_data) return response_data.get("request_id")
def main(): # initiate search request_id = initiate_search() if not request_id: print("Failed to initiate search") return # monitor search progress while True: status = check_search_status(request_id) if status == "done": #search completed break #sleep for a while time.sleep(30) # ready to fetch results results = get_search_results(request_id) print(f"Total Results Fetched: {len(results)}") print("Results:", results)if __name__ == "__main__": main()