This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 15k traffic Daily!!!

Scraping Linkedin Data with Proxycurl, Python Program, and Nodejs


At present, I need to present you how one can scrape information from linkedin utilizing Proxycurl api, Python programming and nodejs.

Let’s scrape information utilizing python programming and the library request.

I’m going to make use of the Proxycurl Firm api to get the Employee Count Endpoint

set up the bundle request

!pip set up requests
Enter fullscreen mode

Exit fullscreen mode

let’s get our Proxycurl api create an account with Proxycurl and generate your api.

Let’s rely the variety of staff working at Apple.inc

Utilizing the library

import requests

api_endpoint="https://nubela.co/proxycurl/api/linkedin/firm/staff/rely/"

api_key = 'YOUR_API_KEY_HERE'

header_dic = {'Authorization': 'Bearer ' + api_key}

params = {
    'linkedin_employee_count': 'embrace',
    'employment_status': 'present',
    'url': 'https://www.linkedin.com/firm/apple/',
}

response = requests.get(api_endpoint,
                        params=params,
                        headers=header_dic)

Enter fullscreen mode

Exit fullscreen mode

The output response is:

{
'total_employee': 94262,
'linkedin_employee_count': 567686,
'linkdb_employee_count': 94262
}

Let’s attempt to rely the variety of staff working at twitter

import requests

api_endpoint="https://nubela.co/proxycurl/api/linkedin/firm/staff/rely/"
api_key = '3HqZGXdoejPB8YYT4KRb3w'
header_dic = {'Authorization': 'Bearer ' + api_key}
params = {
    'linkedin_employee_count': 'embrace',
    'employment_status': 'present',
    'url': 'https://www.linkedin.com/firm/twitter/',
}
response = requests.get(api_endpoint,
                        params=params,
                        headers=header_dic)

Enter fullscreen mode

Exit fullscreen mode

The output is

{'total_employee': 7472,
'linkedin_employee_count': 7992,
'linkdb_employee_count': 7472
}

You may do that with as many firms as doable

Subsequent let’s strive scraping information from linkedin utilizing Proxycurl and Nodejs

  • Create a folder listing
cd c:UseruserFolder identify
Enter fullscreen mode

Exit fullscreen mode

npm set up specific axios dotenv

or with Yarn

yarn add specific axios dotenv
Enter fullscreen mode

Exit fullscreen mode

API_KEY = 'YOUR_API_KEY_HERE'
Enter fullscreen mode

Exit fullscreen mode

import specific from 'specific';
import axios from 'axios';
import dotenv from 'dotenv';

const app = specific();

dotenv.config();

app.hear(8000, () => {
    console.log('App linked efficiently!');
});
Enter fullscreen mode

Exit fullscreen mode

// Getting Firm's job itemizing

const TWITTER_URL = 'https://www.linkedin.com/firm/twitter/';  // Line 1

const COMPANY_PROFILE_ENDPOINT = 'https://nubela.co/proxycurl/api/linkedin/firm';

const JOBS_LISTING_ENDPOINT = 'https://nubela.co/proxycurl/api/v2/linkedin/firm/job';

const JOB_PROFILE_ENDPOINT = 'https://nubela.co/proxycurl/api/linkedin/job';

const companyProfileConfig = {  // Line 2
    url: COMPANY_PROFILE_ENDPOINT,
    technique: 'get',
    headers: {'Authorization': 'Bearer ' + course of.env.API_KEY},
    params: {
    url: TWITTER_URL
  }
};

const getTwitterProfile = async () => {  // Line 3
    return await axios(companyProfileConfig);
}

const profile = await getTwitterProfile();

const twitterID = profile.information.search_id;

console.log('Twitter ID:', twitterID);


const jobListingsConfig = {
    url: JOBS_LISTING_ENDPOINT,
    technique: 'get',
    headers: {'Authorization': 'Bearer ' + course of.env.API_KEY},
    params: {
    search_id: twitterID // Line 4
    }
}

const getTwitterListings = async () => { // Line 5
     return await axios(jobListingsConfig);
}

const jobListings = await getTwitterListings();

const jobs = jobListings.information.job;

console.log(jobs);
Enter fullscreen mode

Exit fullscreen mode

// Particular Job itemizing code snippet

const jobProfileConfig = {
    url: JOB_PROFILE_ENDPOINT,
    technique: 'get',
    headers: { 'Authorization': 'Bearer ' + course of.env.API_KEY },
    params: {
        url: jobs[0].job_url   // Line 1
    }
};

const getJobDetails = async () => {  // Line 2
    return await axios(jobProfileConfig);
};

const jobDetails = await getJobDetails(); 

console.log(jobDetails.information);

Enter fullscreen mode

Exit fullscreen mode

How the bundle.json ought to seem like;

{
  "identify": "nubela",
  "model": "1.0.0",
  "sort": "module",
  "description": "",
  "predominant": "proxycurl.js",
  "scripts": {
    "take a look at": "echo "Error: no take a look at specified" && exit 1"
  },
  "key phrases": [],
  "creator": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^1.1.3",
    "dotenv": "^16.0.3",
    "specific": "^4.18.2"
  }
}
Enter fullscreen mode

Exit fullscreen mode

You may strive scraping any information of your alternative from Linkedin utilizing Proxycurl Api

References
Proxycurl API
Proxycurl Documentation
Node js
Proxycurl Author

The Article was Inspired from tech community site.
Contact us if this is inspired from your article and we will give you credit for it for serving the community.

This Banner is For Sale !!
Get your ad here for a week in 20$ only and get upto 10k Tech related traffic daily !!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to Contribute to us or want to have 15k+ Audience read your Article ? Or Just want to make a strong Backlink?