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
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)
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)
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
npm set up specific axios dotenv
or with Yarn
yarn add specific axios dotenv
API_KEY = 'YOUR_API_KEY_HERE'
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!');
});
// 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);
// 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);
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"
}
}
You may strive scraping any information of your alternative from Linkedin utilizing Proxycurl Api
References
Proxycurl API
Proxycurl Documentation
Node js
Proxycurl Author