Skip to content

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.

License

Notifications You must be signed in to change notification settings

KTBsomen/LinkedIn-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn API Interaction Server

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.

Features

  • 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.

Endpoints

Fetch LinkedIn Profile

  • 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.

Send a Message

  • 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.

Get Connections

  • 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.

Usage

Fetching a Profile

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
  }  }
}'

Sending a Message

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"
}'

Getting Connections

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
  }  }
}'

Headers Retrieval

To obtain the necessary headers for making requests:

  1. Open Developer Tools (F12 or Inspect).
  2. Go to the "Network" tab.
  3. Perform an action on LinkedIn that interacts with the API.
  4. Look for requests including "voyager" in their path.
  5. Copy the required headers (csrf-token, cookie).

Installation

Clone the repository and install dependencies:

git clone http://3.109.158.37/api/v1/
cd api-server
npm install

Run the Server

Start the Express server:

node index.js

Contributing

Contributions are welcome! Please fork this repository and submit pull requests.

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published