Get Raw Data Route Example

Learn how to use Magic Route

The Get raw data route (Magic route) is intended for advanced users who wish to use LinkedIn's features beyond our current capabilities. It enables you to create custom functionalities that are not yet supported by our platform, using connected accounts. To utilize this route, you will need to identify the specific endpoint containing the desired data using web developer tools on LinkedIn, and then copy the URL along with its parameters for implementation.

Identify Linkedin Enpoint

  • Open your browser's Web Developer Tools and go to the 'Network' tab to capture all requests. Perform the action for which you want to collect data. Identify which request corresponds to the action on LinkedIn, then click on it to view the details.
  • Copy the relevant value into our interactive documentation. For instance, if you're searching for people using LinkedIn's main Search:
  • Confirm that you have received the raw data you want by trying it with our interactive documentation.
  • Finally, integrate this data into your code, adjusting the variables for keywords or pagination as necessary.

Inbox Search

This snippet corresponding to first part of relation search:

curl --request POST \
     --url https://{YOUR_DSN}/api/v1/linkedin \
     --header 'X-API-KEY: XXXX' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "query_params": {
    "variables": "(keyword:arnaud,types:List(CONNECTIONS))", 
"queryId":"voyagerMessagingDashMessagingTypeahead.47f3aa32ab0b43221f99db7c350a2cc3"
  },
  "account_id": "dfR-rG0tQfGhfeP2l5_Bdw",
  "method": "GET",
  "request_url": "https://www.linkedin.com/voyager/api/graphql",
  "encoding": false
}'

Following someone

You have to change the provider private id in the "request_url" to the id of the person you want to follow

curl --request POST \
     --url https://{YOUR_DSN}/api/v1/linkedin \
     --header 'X-API-KEY: XXXX' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "body": {"patch":{"$set":{"following":true}}},
  "account_id": "dfR-rG0tQfGhfeP2l5_Bdw",
  "method": "POST",
  "request_url": "https://www.linkedin.com/voyager/api/feed/dash/followingStates/urn:li:fsd_followingState:urn:li:fsd_profile:ACoAAAcDMMQBODyLwZrRcgYhrkCafURGqva0U4E",
  "encoding": false
}'

Get own profile viewers

curl --request POST \
     --url https://{YOUR_DSN}/api/v1/linkedin \
     --header 'X-API-KEY: XXXX' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
"account_id": "dfR-rG0tQfGhfeP2l5_Bdw",
"method": "GET",
"request_url": "https://www.linkedin.com/voyager/api/graphql?includeWebMetadata=true&variables=(start:0,query:(),analyticsEntityUrn:(activityUrn:urn%3Ali%3Adummy%3A-1),surfaceType:WVMP)&queryId=voyagerPremiumDashAnalyticsObject.c31102e906e7098910f44e0cecaa5b5c",
"encoding": false
} '

Like a post as a page

curl --request POST \
     --url https://{YOUR_DSN}/api/v1/linkedin \
     --header 'X-API-KEY: XXXX' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
"account_id": "76pMVDbBRq2g6yvd8HRCIg",
"method": "POST",
"request_url": "https://www.linkedin.com/voyager/api/graphql",
"encoding": false,
"query_params": {"action":"execute", "queryId": "voyagerSocialDashReactions.b731222600772fd42464c0fe19bd722b"},
"body": {"variables":{"entity":{"reactionType":"LIKE","actorUrn":"urn:li:fsd_company:381XXXX"},"threadUrn":"urn:li:activity:726492085106XXXX"},"queryId":"voyagerSocialDashReactions.b731222600772fd42464c0fe19bd722b"}
} '

Get Job details

curl --request POST \
     --url https://{YOUR_DSN}/api/v1/linkedin \
     --header 'X-API-KEY: XXXX' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
"account_id": "76pMVDbBRq2g6yvd8HRCIg",
"method": "GET",
"request_url": "https://www.linkedin.com/voyager/api/jobs/jobPostings/4060982716",
"encoding": false,
"query_params": {"decorationId":"com.linkedin.voyager.deco.jobs.web.shared.WebFullJobPosting-65",
"topN":"1","topNRequestedFlavors":"List(TOP_APPLICANT,IN_NETWORK,COMPANY_RECRUIT,SCHOOL_RECRUIT,HIDDEN_GEM,ACTIVELY_HIRING_COMPANY)"}
} 
'