# Lead Search at Scale Source: https://fdocs.info/api-reference/endpoint/big-employee-search POST /lead-search-at-scale ## Having a big employee search? No problem, we now can scrape searches that are up to 50k results. ### 🛠 How the Process Works #### **Step 1️⃣: Initiate Search** * Launch your search with specific criteria via this endpoint. * This endpoint returns a **`request_id`**, allowing you to track progress through the [**Check Search Status**](https://fdocs.info/api-reference/endpoint/check-search-status) endpoint. * The search initiation alone costs **50 credits**, even if the search returns **0 results**. * **Then each result costs 1 credits, and will be charged in advanced before you actually fetch the results.** #### **Step 2️⃣: Monitor Search Progress** * Use the [**Check Search Status**](https://fdocs.info/api-reference/endpoint/check-search-status) endpoint to track your search. * This action is **free of charge**. #### **Step 3️⃣: Retrieve Results** * Once the search is complete, access the results via the [**Get Search Results**](https://fdocs.info/api-reference/endpoint/get-search-results) endpoint. * Fetching results is free of charge. ### This endpoint is for custom-plan users only. Please [contact us](mailto:support@fdocs.info) for more details. 💡 *For better understanding and demo code, please follow [this tutorial](https://fdocs.info/tutorial/howto-perform-big-lead-searches)* # Check Company Search Status Source: https://fdocs.info/api-reference/endpoint/check-search-companies-status GET /check-search-companies-status * Get the status of your search using the **`request_id`** given from [**Search Companies**](https://fdocs.info/api-reference/endpoint/search-companies) endpoint. * This endpoint is **FREE** of charge. # Check Search Status Source: https://fdocs.info/api-reference/endpoint/check-search-status GET /check-search-status * Get the status of your search using the **`request_id`** given from the [**Search Employees**](https://fdocs.info/api-reference/endpoint/search-employees) endpoint. * This endpoint is **FREE** of charge. # Find Custom Headcount Source: https://fdocs.info/api-reference/endpoint/find-custom-headcount POST /find-custom-headcount - Discover the count of employees within a specific company who meet designated criteria. - 1 credit per call. # Get Account IQ (Sales Nav) Source: https://fdocs.info/api-reference/endpoint/get-account-iq GET /get-account-iq - Get company account IQ from Linkedin sales navigator. - 5 credits per call. # Get Company by Domain Source: https://fdocs.info/api-reference/endpoint/get-company-by-domain GET /get-company-by-domain - Find a company on LinkedIn using its web domain. - 1 credit per call. # Get Company by ID Source: https://fdocs.info/api-reference/endpoint/get-company-by-id GET /get-company-by-id - Retrieve valuable data points using a company’s LinkedIn internal ID. - 1 credit per call. # Get Company by Linkedin URL Source: https://fdocs.info/api-reference/endpoint/get-company-by-linkedinurl GET /get-company-by-linkedinurl - Retrieve valuable data points using a company’s LinkedIn URL. - 1 credit per call. # Get Company Insights (Sales Nav) Source: https://fdocs.info/api-reference/endpoint/get-company-insights GET /get-company-insights - Get company insights from Linkedin sales navigator. - 5 credits per call. # Get Company Jobs Count Source: https://fdocs.info/api-reference/endpoint/get-company-jobs-count GET /get-company-jobs-count - Get the number of job openings a company has posted on LinkedIn. - 1 credit per call. # Get Company Posts Source: https://fdocs.info/api-reference/endpoint/get-company-posts GET /get-company-posts - Get posts from a LinkedIn company page. Pagination is supported to fetch all posts. - 2 credits per call. # Get Extra Profile Data Source: https://fdocs.info/api-reference/endpoint/get-extra-profile-data GET /get-extra-profile-data - Get extra profile data sections by LinkedIn Sales Navigator URN (vmid). - Credit cost: 1 credit per section included. **Examples:** - `include_certifications` only → **1 credit** - `include_certifications` + `include_organizations` → **2 credits** - `include_certifications` + `include_organizations` + `include_patents` → **3 credits** - `include_certifications` + `include_organizations` + `include_patents` + `include_projects` → **4 credits** - `include_certifications` + `include_organizations` + `include_patents` + `include_projects` + `include_volunteers` → **5 credits** # Get Job Details Source: https://fdocs.info/api-reference/endpoint/get-job-details GET /get-job-details - Scrape the full job details, including the company basic information. - 1 credit per call. # Get Personal Profile Source: https://fdocs.info/api-reference/endpoint/get-linkedin-profile GET /get-personal-profile - Get comprehensive profile data, including experience, education history, and current company details. - 2 credits per call. - Using each extra option will cost another 1 credit. # Get Post's Comments Source: https://fdocs.info/api-reference/endpoint/get-post-comments GET /get-post-comments - Get comments of a post. - 1 credit per call. # Get Post's Reaction Source: https://fdocs.info/api-reference/endpoint/get-post-reactions GET /get-post-reactions - Get reactions of a post. - 1 credit per call. # Get Profile Posts Source: https://fdocs.info/api-reference/endpoint/get-profile-posts GET /get-profile-posts - Retrieve posts from a person's profile. Pagination is supported for accessing all posts. - 2 credits per call # Detect Activity Time Source: https://fdocs.info/api-reference/endpoint/get-profile-recent-activity-time GET /get-profile-recent-activity-time - Get the time of the latest profile activity. - 2 credits per call. # Get Companies Source: https://fdocs.info/api-reference/endpoint/get-search-companies-results GET /get-search-companies-results * Get search results. Please make sure the search is **done** before calling this endpoint. * Pricing: **1 credits** per result. # Get Search Results Source: https://fdocs.info/api-reference/endpoint/get-search-results GET /get-search-results * Get search results. Please make sure the search is **done** before calling this endpoint. * Pricing: **1 credits** per result. # Google Full Profiles Source: https://fdocs.info/api-reference/endpoint/google-full-profiles POST /google-full-profiles - Discover LinkedIn profiles via Google using details like job title, company, location, or keywords, and perform a comprehensive analysis to generate match scores. This endpoint is optimized to pinpoint LinkedIn contacts with precision based on the basic information provided. - Credit Cost: Base cost: 2 credits. Additional cost: 2 credits per selected profile. - For example: Selecting 1 profile = 4 credits, Selecting 2 profiles = 6 credits. # Search Companies Source: https://fdocs.info/api-reference/endpoint/search-companies POST /search-companies ## Automate LinkedIn Sales Navigator account searches without connecting your own account or cookies. ### 🛠 How the Process Works #### **Step 1️⃣: Initiate Search** * Use this endpoint to make a search using your criteria. * This endpoint returns a **`request_id`**, allowing you to track progress through the [**Check Company Search Status**](https://fdocs.info/api-reference/endpoint/check-search-companies-status) endpoint. * This step alone costs **10 credits**, even if the search returns **0 results**. #### **Step 2️⃣: Monitor Search Progress** * Use the [**Check Company Search Status**](https://fdocs.info/api-reference/endpoint/check-search-companies-status) endpoint to track your search. * This action is **free of charge**. #### **Step 3️⃣: Retrieve Results** * Once the search is complete, access the results via the [**Get Companies**](https://fdocs.info/api-reference/endpoint/get-search-companies-results) endpoint. * Retrieving each profile incurs **1 credits**. For example, fetching **1000 results** will consume **1000 credits** (*not include 10 credits at the **step 1***). 💡 *For better understanding and demo code, please follow [this tutorial](https://fdocs.info/tutorial/howto-search-companies)* # Search Companies by Sales URL Source: https://fdocs.info/api-reference/endpoint/search-companies-by-sales-nav-url POST /search-companies-by-sales-nav-url * Works exactly the same endpoint [**Search Companies**](https://fdocs.info/api-reference/endpoint/search-companies) except that it takes a search url as the input. It's helpful when you already have sales navigator search url(s). # Search Jobs Source: https://fdocs.info/api-reference/endpoint/search-jobs POST /search-jobs - Search jobs posted on LinkedIn. This endpoint is useful for scraping job openings of a specific company on LinkedIn. - To scrape all results from each search, change the parameter **start** from 0 to 25, 50, etc. until you see less than 25 results returned. - 2 credits per call. # Search Leads Source: https://fdocs.info/api-reference/endpoint/search-leads POST /search-leads Accepts either filters or a Sales Navigator search URL. ## Streamline your Sales Navigator lead searches effortlessly without connecting your own account or cookies. ### 🛠 How the Process Works #### **Step 1️⃣: Initiate Search** * Launch your search with specific criteria via this endpoint. * This endpoint returns a **`request_id`**, allowing you to track progress through the [**Check Search Status**](https://fdocs.info/api-reference/endpoint/check-search-status) endpoint. * This step costs minimum **10 credits**, even if the search returns **0 results** (Excluding cases where the filters you provided are invalid). #### **Step 2️⃣: Monitor Search Progress** * Use the [**Check Search Status**](https://fdocs.info/api-reference/endpoint/check-search-status) endpoint to track your search. * This action is **free of charge**. #### **Step 3️⃣: Retrieve Results** * Once the search is complete, access the results via the [**Get Search Results**](https://fdocs.info/api-reference/endpoint/get-search-results) endpoint. * Retrieving each result incurs **1 credits**. For example, fetching **1000 results** will consume **1000 credits** (*not include 10 credits at **step 1***). 💡 *For better understanding and demo code, please follow [this tutorial](https://fdocs.info/tutorial/howto-search-leads)* # Search Posts Source: https://fdocs.info/api-reference/endpoint/search-posts POST /search-posts - Simulates LinkedIn's Post Search Function with most important filters. - 1 credit per 20 posts retrieved. # Quickstart Source: https://fdocs.info/api-reference/quickstart Our API is operated through the Rapid API Marketplace⮭, where payments and API calls are seamlessly managed by the platform. Signing up takes less than a minute. Get started here⮭. After signing in to Rapid, select the plan⮭ that meets your needs. For advanced LinkedIn search capabilities (via Sales Navigator), consider upgrading to at least the PRO plan. Once subscribed to a plan, head over to the playground⮭ to test the endpoints. The playground includes sample code snippets in popular programming languages, making it easy to integrate into your projects. # Credit Usage by Endpoint Source: https://fdocs.info/api-reference/understanding-credit-usage ## **Personal Data Endpoints** ### 🔹 **Get Personal Profile** * **Basic call**: `2 credits` for retrieving essential profile details. * **Additional options** (e.g., skills, certifications, etc.): `+1 credit` per option. **Examples:** * Fetching just the main details → `2 credits` * Fetching main details + certifications + skills → `4 credits` * Fetching main details + skills → `3 credits` ### 🔹 **Other Personal Data Endpoints** * **Get Profile’s Posts**: `2 credits per call` * **Detect Activity Time**: `2 credits per call` * **Search Posts**: `1 credit per 20 posts retrieved` *** ## **Company Data Endpoints** ### 🔹 **Company Lookup** * **Get Company By URL**: `1 credit per call` * **Get Company By Domain**: `1 credit per call` * **Get Company By ID**: `1 credit per call` ### 🔹 **Company Insights** * **Get Company's Posts**: `2 credits per call` * **Get Company Insights (Sales Navigator)**: `5 credits per call` * **Find Custom Headcount**: `1 credit per call` * **Count Job Openings**: `1 credit per call` *** ## **Search Employees (Sales Navigator)** **Step 1️⃣**: `10 credits per search request` **Step 2️⃣**: `Free status checks` **Step 3️⃣**: `1 credits per retrieved profile` *** ## **Search Companies (Sales Navigator)** **Step 1️⃣**: `10 credits per request` **Step 2️⃣**: `Free status checks` **Step 3️⃣**: `1 credits per retrieved company` *** ## **Job Search Endpoints** * **Search Jobs**: `2 credits per call` * **Get Job Details**: `1 credit per call` *** ## **Other Endpoints** * **Search LinkedIn Profiles Via Google**: `2 credits per call` * **Get Recommendation Given**: `1 credit per call` * **Get Recommendation Received**: `1 credit per call` * **Get Years of Experience**: `1 credit per call` * **Get Open To Work Status**: `1 credit per call` * **Get Open Profile Status**: `1 credit per call` * **Get Profile PDF CV**: `1 credit per call` * **Get Extra Profile Data**: `1 credit per call` * **Google Full Profile**: `2 + (profiles × 2) credits per call` *(e.g., 1 profile = 4 credits, 2 profiles = 6 credits)* * **Search LinkedIn Company Pages Via Google**: `2 credits per call` * **Search LinkedIn School Pages Via Google**: `2 credits per call` *** ### ✅ **Key Takeaways** * **Each API call consumes a specific amount of credits** (detailed above). * **Some actions (like retrieving additional details) require extra credits**. * **For Sales Navigator searches, credits are used in multiple steps**. 📌 *Always ensure you have enough credits before making a request.* # Scale LinkedIn Searches Without Limits Source: https://fdocs.info/introduction Automate LinkedIn searches at scale—no accounts, no cookies, no extensions. Fresh Data API delivers fast, accurate, and seamless access to LinkedIn data through a reliable, production-ready API. Designed for businesses, recruiters, marketers, and developers who need scalable lead generation and real-time insights without login barriers. ## Why Choose Fresh Data API? ✅ **Comprehensive Data Access**: Access profiles, posts, companies, jobs, and more in real-time. ✅ **Automated Sales Navigator Scraping**: Scrape LinkedIn Sales Navigator automatically at scale. No need for cookies, accounts, or browser extensions. This unique feature empowers seamless access to LinkedIn data with unmatched efficiency and convenience. ✅ **High Scalability**: Scrape hundreds of thousands of leads daily with exceptional accuracy and speed. ✅ **Trusted by Industry Leaders**: Powering top AI startups and enterprises, enabling enhanced marketing, recruitment, and intelligence strategies. 💰 **100% Refund Guarantee:** If you **use up to 10% of your credits** and aren’t satisfied, we’ll give you a full refund—no questions asked. ## What Makes Our API Unique? For the first time, you have access to an API that allows programmatically scraping data from LinkedIn Sales Navigator searches (leads or companies) at scale, and even **without using your own cookies or accounts**. It's incredibly helpful for businesses that require advanced LinkedIn searches on the fly. ## Get Started with Fresh Data API Today Our API is designed to be your go-to tool for LinkedIn data extraction, empowering your business with reliable, scalable, and advanced scraping solutions. [Start scraping LinkedIn data now](/quickstart). ## Need Help? For fast support or inquiries, contact us at [support@fdocs.info](mailto:support@fdocs.info). Let’s redefine how you access and use LinkedIn data! # Quickstart Source: https://fdocs.info/quickstart Our API is operated through the Rapid API Marketplace⮭, where payments and API calls are seamlessly managed by the platform. Signing up takes less than a minute. Get started here⮭. After signing in to Rapid, select the plan⮭ that meets your needs. The BASIC plan is free forever and requires no credit card. For advanced LinkedIn search capabilities (via Sales Navigator), consider upgrading to at least the PRO plan. Once subscribed to a plan, head over to the playground⮭ to test the endpoints. The playground includes sample code snippets in popular programming languages, making it easy to integrate into your projects. # All available values for search endpoints Source: https://fdocs.info/tutorial/filters-values-references ## Endpoint: Search Employees ### company\_headcounts Self-employed, 1-10, 11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001-10000, 10001+ ### profile\_languages Arabic, English, Spanish, Portuguese, Chinese, French, Italian, Russian, German, Dutch, Turkish, Tagalog, Polish, Korean, Japanese, Malay, Norwegian, Danish, Romanian, Swedish, Bahasa Indonesia, Czech ### year\_in\_current\_company, year\_in\_current\_position, years\_of\_experience Less than 1 year, 1 to 2 years, 3 to 5 years, 6 to 10 years, More than 10 years ### functions Accounting, Administrative, Arts and Design, Business Development, Community and Social Services, Consulting, Education, Engineering, Entrepreneurship, Finance, Healthcare Services, Human Resources, Information Technology, Legal, Marketing, Media and Communication, Military and Protective Services, Operations, Product Management, Program and Project Management, Purchasing, Quality Assurance, Real Estate, Research, Sales, Customer Success and Support ### seniority\_levels Owner/Partner, CXO, Vice President, Director, Experienced Manager, Entry Level Manager, Strategic, Senior, Entry Level, In Training ### company\_type Public Company, Privately Held, Non Profit, Educational Institution, Partnership, Self Employed, Self Owned, Government Agency ## Endpoint: Search Companies ### company\_headcounts 1-10, 11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001-10000, 10001+ ### currency USD, AED, AUD, BRL, CAD, CNY, DKK, EUR, GBP, HKD, IDR, ILS, INR, JPY, NOK, NZD, RUB, SEK, SGD, THB, TRY, TWD ### department Accounting, Administrative, Arts and Design, Business Development, Community and Social Services, Consulting, Education, Engineering, Entrepreneurship, Finance, Healthcare Services, Human Resources, Information Technology, Legal, Marketing, Media and Communication, Military and Protective Services, Operations, Product Management, Program and Project Management, Purchasing, Quality Assurance, Real Estate, Research, Sales, Support ### recent\_activities Senior leadership changes in last 3 months, Funding events in past 12 months ### number\_of\_followers 1-50, 51-100, 101-1000, 1001-5000, 5001+ ### fortune Fortune 50, Fortune 51-100, Fortune 101-250, Fortune 251-500 ## Endpoint: Search Posts ### sort\_by Top match, Latest ### date\_posted Past 24 hours, Past week, Past month, past-year, past-2y, past-3y ### content\_type Videos, Images, Job posts, Live videos, Documents, Collaborative articles ## Endpoint: Search Jobs ### sort\_by Most recent, Most relevant ### date\_posted Any time, Past month, Past week, Past 24 hours ### experience\_levels Internship, Associate, Director, Entry level, Mid-Senior level, Executive ### functions Marketing, Sales, Business Development, Other, Strategy/Planning, Writing/Editing, Public Relations, Information Technology, Art/Creative, Administrative, Advertising ### job\_types Full-time, Part-time, Contract, Temporary, Internship, Other ### onsite\_remotes On-site, Remote, Hybrid # How to locate inputs for the endpoint "Find Custom Headcount"? Source: https://fdocs.info/tutorial/howto-custom-headcount-inputs ## Where they live Example: Washington, United States ⇒ 103977389 ## Where they studied Example: StandFord University ⇒ 1972 ## What they do Example: Sales ⇒ 25 ## What they are skilled at Example: Java ⇒ 147 ## What they studied Example: Computer Engineering ⇒ 100347 # How to find a company_id? Source: https://fdocs.info/tutorial/howto-find-company-id ## What is a company\_id? In LinkedIn, each company is associated with a global unique id that's called a **company\_id** in our API. For example, the company\_id of "Apple" is **162479**. It's used some endpoints like "Search Employees", "Search Jobs", or "Search Posts" to filter the records by company. ## How to find it? Simply go this free people search page, put in your target company name (i.e Apple) and you'll see the company\_id in the address bar. # How to find a geo_code? Source: https://fdocs.info/tutorial/howto-geocode ## What is a geo\_code? In LinkedIn, each location, region or country is associated with a global unique id that's called a **geo\_code** in our API. For example, the geo\_code of United States is **103644278**. It's used a lot in different endpoints like "Search Employees", "Search Companies", or "Search Jobs" to filter the records by location. ## How to find it? Simply go to LinkedIn website, put in your target location (i.e United States) and you'll see the geo\_code in the address bar. # How to search employees without 2500 limit? Source: https://fdocs.info/tutorial/howto-perform-big-lead-searches Having a big employee search? No problem, we now can scrape searches that are up to 50k results without using your own LinkedIn account, without providing any cookies, and without requiring a browser extension. All you need to do is provide the search criteria. ## Code demonstration For instance, let’s say you need a lead list with the following criteria: * **Job title includes**: owner, founder, or director * **Location**: United States * **Industry**: Software Development * **Company headcount range**: 11-50 * **For more filters**: Please check out this [page](/tutorial/understanding-employee-search-filters) Below is how you can do it easily in the Python language, step by step. ```python theme={null} import requests import time # Replace this with your actual API key api_key = "YOUR_API_KEY" # API base URL api_host = "web-scraping-api2.p.rapidapi.com" def initiate_search(): url = f"https://{api_host}/lead-search-at-scale" payload = { "geo_codes": [103644278], # United States "title_keywords": ["Owner", "Founder", "Director"], "industry_codes": [4], # Software Development "company_headcounts": ["11-50", "51-200"] } 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") ``` ```python theme={null} def check_search_status(request_id): url = f"https://{api_host}/check-search-status" querystring = {"request_id": request_id} headers = { "x-rapidapi-key": api_key } response = requests.get(url, headers=headers, params=querystring) response_data = response.json() print("Check Search Status Response:", response_data) return response_data.get("status") #pending, processing, or done ``` ```python theme={null} def get_search_results(request_id): url = f"https://{api_host}/get-search-results" headers = { "x-rapidapi-key": api_key } all_results = [] page = 1 while True: querystring = {"request_id": request_id, "page": page} response = requests.get(url, headers=headers, params=querystring) response_data = response.json() if response_data.get("data"): all_results.extend(response_data.get("data")) page += 1 else: #no more results break return all_results ``` ```python theme={null} 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 # wait for some minutes time.sleep(300) # ready to fetch results results = get_search_results(request_id) print(f"Total Results Fetched: {len(results)}") print("Results:", results) if __name__ == "__main__": main() ``` ## Prerequisites Before running the script, ensure you have: 1. Permission to use the search feature. Please reach out us at: [support@fdocs.info](mailto:support@fdocs.info) to obtain it. 2. Python installed on your system. 3. The requests library installed. You can install it using: ```bash theme={null} pip install requests ``` ## How much does it cost? Each stage of the search process costs a different number of credits: 1. **Search initiation: 50 credits. Even if the search returns no results you’ll be charged 50 credits. Then each result costs 1 credits, and will be charged in advanced before you actually fetch the results.** 2. **Status monitoring**: free of charge. You can check it as frequently as needed until the job is complete. 3. **Result fetching**: free of charge. For example, if your search yields 10,000 results, the total credit cost would be: 50 credits + (1\*10000 credits) = **10050** credits. # How to fully automate LinkedIn company searches, at any scale? Source: https://fdocs.info/tutorial/howto-search-companies Are you looking to integrate LinkedIn company search results into your workflow without manual effort? In this guide, I’ll show you how to leverage our API to automate company searches from LinkedIn Sales Navigator—without requiring a LinkedIn account, cookies, or browser extensions. Simply define your search criteria and let the API do the rest. ## Code Demonstration Let’s say you want to build a list of companies that meet the following criteria: * **Company Size**: Between 1,001–10,000 employees. * **Headquarters**: United States. * **Hiring on LinkedIn**: No. * **For more filters**: Please check out this [page](/tutorial/understanding-company-search-filters) Here’s how you can achieve this step-by-step using Python. ```python theme={null} import requests API_KEY = 'your_api_key_here' SEARCH_URL = "https://web-scraping-api2.p.rapidapi.com/search-companies" def search_companies(): payload = { "company_headcounts": ["1001-5000", "5001-10000"], "headquarters_location": [103644278], # United States "hiring_on_linkedin": "false", "limit": 100 } headers = { "x-rapidapi-key": API_KEY, "Content-Type": "application/json" } response = requests.post(SEARCH_URL, json=payload, headers=headers) return response.json().get('request_id') ``` ```python theme={null} STATUS_URL = "https://web-scraping-api2.p.rapidapi.com/check-search-companies-status" def check_search_status(request_id): querystring = {"request_id": request_id} headers = { "x-rapidapi-key": API_KEY } response = requests.get(STATUS_URL, headers=headers, params=querystring) return response.json()['status'] # pending ==> processing ==> done ``` ```python theme={null} RESULTS_URL = "https://web-scraping-api2.p.rapidapi.com/get-search-companies-results" def get_search_results(request_id): headers = { "x-rapidapi-key": API_KEY } all_results = [] page = 1 while True: querystring = {"request_id": request_id, "page": page} response = requests.get(RESULTS_URL, headers=headers, params=querystring) data = response.json() if data.get("data"): all_results.extend(data["data"]) page += 1 else: break return all_results ``` ```python theme={null} import time def main(): request_id = search_companies() if not request_id: print("Error initiating search.") return while True: status = check_search_status(request_id) print("Search Status:", status) if status == "done": results = get_search_results(request_id) print(f"Total Results Fetched: {len(results)}") print("Search Results:", results) break time.sleep(60) # wait for 1 minute before checking again if __name__ == "__main__": main() ``` ## Prerequisites Before running the code, ensure you have the following: 1. A **PRO** plan to access the search endpoint. 2. Python installed on your machine. 3. Install the required Python library using: ```bash theme={null} pip install requests ``` ## Pricing The API usage cost is broken into three stages: 1. **Search initiation**: 25 credits per request. 2. **Search status checks**: Free of charge. 3. **Result fetching**: 1 credits per company. For example, if your search returns 100 companies, the total credit cost would be: 25 credits + (1 × 100) = **125 credits**. This guide demonstrates how you can use the API to automate LinkedIn company searches efficiently and integrate them seamlessly into your workflow. Start leveraging this solution to scale your business insights effortlessly. # How to fully automate LinkedIn lead search, at any scale? Source: https://fdocs.info/tutorial/howto-search-leads 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. ## Code demonstration For instance, let’s say you need a lead list with the following criteria: * **Job title includes**: owner, founder, or director * **Location**: United States * **Industry**: Software Development * **Company headcount range**: 11-200 * **For more filters**: Please check out this [page](/tutorial/understanding-employee-search-filters) Below is how you can do it easily in the Python language, step by step. ```python theme={null} import requests import time # Replace this with your actual API key api_key = "YOUR_API_KEY" # API base URL api_host = "web-scraping-api2.p.rapidapi.com" def initiate_search(): url = f"https://{api_host}/search-leads" 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") ``` ```python theme={null} def check_search_status(request_id): url = f"https://{api_host}/check-search-status" querystring = {"request_id": request_id} headers = { "x-rapidapi-key": api_key } response = requests.get(url, headers=headers, params=querystring) response_data = response.json() print("Check Search Status Response:", response_data) return response_data.get("status") #pending, processing, or done ``` ```python theme={null} def get_search_results(request_id): url = f"https://{api_host}/get-search-results" headers = { "x-rapidapi-key": api_key } all_results = [] page = 1 while True: querystring = {"request_id": request_id, "page": page} response = requests.get(url, headers=headers, params=querystring) response_data = response.json() if response_data.get("data"): all_results.extend(response_data.get("data")) page += 1 else: #no more results break return all_results ``` ```python theme={null} 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() ``` ## Prerequisites Before running the script, ensure you have: 1. At least a **PRO** plan to use the search feature. 2. Python installed on your system. 3. The requests library installed. You can install it using: ```bash theme={null} pip install requests ``` ## How much does it cost? Each stage of the search process costs a different number of credits: 1. **Search initiation**: 50 credits. Even if the search returns no results you’ll be charged 50 credits. 2. **Status monitoring**: free of charge. You can check it as frequently as needed until the job is complete. 3. **Result fetching**: each result costs 1 credits. For example, if your search yields 1,000 results, the total credit cost would be: 50 credits + (1\*1000 credits) = **1050** credits. # RapidAPI Best Practices Source: https://fdocs.info/tutorial/rapid-best-practices ## Managing Your Remaining Credits To check the number of credits used or remaining, after completing any request to our API endpoints, please refer to the response header. The key `x-rapidapi-credits-remaining` will provide you with this information. ## Apply Cache to Your Requests Working with APIs is straightforward, but to maximize efficiency and avoid unnecessary costs, we recommend implementing a caching mechanism that allows the following: * The code enables making requests. * Save the results of successful requests (with status codes 200 or 404) into a directory (cache), with the filename hashed based on the URL and parameters. * Before executing a request, search for the result in the cache directory. If not found, proceed with the request. ## Can I Cancel the Subscription Before the Billing Cycle Ends? It is **not recommended** to cancel a subscription if you still have remaining credits/requests or before the billing cycle ends. Canceling a subscription on RapidAPI means you will **immediately lose access** to that API, unlike many other platforms where you can cancel at any time and continue using the service until the end of the billing cycle, this is not possible on RapidAPI. ## Should I Upgrade or Downgrade to Another Plan While I Still Have Credits on My Current Plan? Once again, unlike many other platforms where you can upgrade or downgrade at any time and have your remaining credits carried over, this is **not** possible on RapidAPI—your remaining credits will **disappear** when you switch plans. This is a known issue with RapidAPI, and we believe they will address it soon. However, until they do, we strongly **advise against** upgrading or downgrading while you still have unused credits on your current plan. # Understand the filters for company search Source: https://fdocs.info/tutorial/understanding-company-search-filters The endpoint Search Companies comes with a rich set of filters. Here is the visual map between each parameter and its original filter in LinkedIn Sales Navigator. For demo code snippet, take a look at [this post](/tutorial/howto-search-companies). # Understand the filters for employee search Source: https://fdocs.info/tutorial/understanding-employee-search-filters The endpoint Search Employees comes with a rich set of filters. Here is the visual map between each parameter and its original filter in LinkedIn Sales Navigator. For demo code snippet, take a look at [this post](/tutorial/howto-search-leads). * **How to find:** [geo\_codes](https://fdocs.info/tutorial/howto-geocode), [company\_headquarter\_location\_ids](https://fdocs.info/tutorial/howto-geocode), [current\_company\_ids](https://fdocs.info/tutorial/howto-find-company-id), [past\_company\_ids](https://fdocs.info/tutorial/howto-find-company-id), [school\_ids](https://fdocs.info/tutorial/howto-find-company-id) * **Possible functions:** "Accounting", "Administrative", "Arts and Design", "Business Development", "Community and Social Services", "Consulting", "Education", "Engineering", "Entrepreneurship", "Finance", "Healthcare Services", "Human Resources", "Information Technology", "Legal", "Marketing", "Media and Communication", "Military and Protective Services", "Operations", "Product Management", "Program and Project Management", "Purchasing", "Quality Assurance", "Real Estate", "Research", "Sales", "Customer Success and Support" * **Possible company headcounts:** "Self-employed", "1-10", "11-50", "51-200", "201-500", "501-1000", "1001-5000", "5001-10000", "10001+" * **Possible seniority levels:** "Owner/Partner", "CXO", "Vice President", "Director", "Experienced Manager", "Entry Level Manager", "Strategic", "Senior", "Entry Level", "In Training" * **Possible profile languages:** "Arabic", "English", "Spanish", "Portuguese", "Chinese", "French", "Italian", "Russian", "German", "Dutch", "Turkish", "Tagalog", "Polish", "Korean", "Japanese", "Malay", "Norwegian", "Danish", "Romanian", "Swedish", "Bahasa Indonesia", "Czech" * **Possible industry\_code:** were listed [here](https://learn.microsoft.com/en-us/linkedin/shared/references/reference-tables/industry-codes-v2) * **Possible year (year\_of\_experience, year\_in\_current\_company, year\_in\_current\_possition):** "Less than 1 year", "1 to 2 years", "3 to 5 years", "6 to 10 years", "More than 10 years" * **limit:** Default value: 25. Maximum value: 2500 * **To apply excluded values** to some filters above, use the \_exclude version as below: current\_company\_ids\_exclude, past\_company\_ids\_exclude, company\_headquarter\_location\_ids\_exclude, functions\_exclude, title\_keywords\_exclude, seniority\_levels\_exclude, past\_job\_titles\_exclude, geo\_codes\_exclude, industry\_codes\_exclude, school\_ids\_exclude