This repository hosts an Express.js server designed to interact with LinkedIn's API. It provides endpoints for fetching LinkedIn profiles, sending messages, and retrieving connections. The server uses custom headers and cookies for authentication, making it a robust solution for LinkedIn automation and data extraction.
- Fetch LinkedIn Profiles: Retrieve detailed information of any LinkedIn profile by ID.
- Send Messages: Send personalized messages to LinkedIn users.
- Get Connections: Access a user's LinkedIn connections with pagination support.
- URL:
/getProfile/:id
- Method: POST
- Description: Fetches a LinkedIn profile using the provided
id
. - Parameters:
id
(string, required): LinkedIn profile ID.- Request Body:
headers
(object, optional): Custom headers.cookie
(string, optional): Cookie string.
- URL:
/send/:receiverId
- Method: POST
- Description: Sends a message to a LinkedIn user.
- Parameters:
receiverId
(string, required): LinkedIn receiver profile ID.- Request Body:
text
(string, optional): Message text.senderId
(string, optional): Sender profile ID.
- URL:
/getConnections/:start/:count
- Method: POST
- Description: Retrieves LinkedIn connections.
- Parameters:
start
(number, required): Starting index.count
(number, required): Number of connections to retrieve.- Request Body:
headers
(object, optional): Custom headers.cookie
(string, optional): Cookie string.
curl -X POST "http://3.109.158.37/api/v1/getProfile/12345" \
-H "Content-Type: application/json" \
-d '{
"headers": {
{
full copied headers from the previous step
} }
}'
curl -X POST "http://3.109.158.37/api/v1/send/67890" \
-H "Content-Type: application/json" \
-d '{
"text": "Hello, this is a test message.",
"senderId": "ACoAADFPm0wBD8_2w8dpux66aLduR0lOhqN2zKk"
}'
curl -X POST "http://3.109.158.37/api/v1/getConnections/0/10" \
-H "Content-Type: application/json" \
-d '{
"headers": {
{
full copied headers from the previous step
} }
}'
To obtain the necessary headers for making requests:
- Open Developer Tools (F12 or Inspect).
- Go to the "Network" tab.
- Perform an action on LinkedIn that interacts with the API.
- Look for requests including "voyager" in their path.
- Copy the required headers (
csrf-token
,cookie
).
Clone the repository and install dependencies:
git clone http://3.109.158.37/api/v1/
cd api-server
npm install
Start the Express server:
node index.js
Contributions are welcome! Please fork this repository and submit pull requests.
This project is licensed under the GNU GENERAL PUBLIC LICENSE.