# Linkedin AI agent (`anchor/linkedin-gpt-prompt`) Actor

Extract LinkedIn profiles, and uses ChatGPT magic automatically on each profile ! Your prompt, the answer you need, the way you want. The ideal LinkedIn AI Agent

- **URL**: https://apify.com/anchor/linkedin-gpt-prompt.md
- **Developed by:** [Anchor](https://apify.com/anchor) (community)
- **Categories:** AI
- **Stats:** 141 total users, 0 monthly users, 100.0% runs succeeded, 14 bookmarks
- **User rating**: 4.10 out of 5 stars

## Pricing

$9.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### 🌐 Linkedin x GPT prompt 💬

The ✨ LinkedIn tool you've dreamed about for so long ✨. Professionals, recruiters, CEOs or marketers... ⏳🌐 Save time by delegating your research on linkedin to this tool ! Prompt what you are looking for on a profile page, and GPT will do the rest 🎯.

### 🔍 Why do I need this ?

If you don't have time to search and scroll every LinkedIn profile, this Actor is for you. Simply delegate your filtering criteria to ChatGPT by passing your prompt to this LinkedIn scrapper.

### 📊 Results (output data)

| 🔗 LinkedIn URL | 👨 Screenshot | 📝 ChatGPT answer |
| --- | --- | --- |
| https://www.linkedin.com/in/williamhgates/ | ![bill gates](https://i.postimg.cc/s2JTzCHT/billgates.png) | Bill Gates is a good candidates for the job of CEO of an IT company. According to you description, I would rate him 10/10 |

### 👨🏻‍🎓 How to scrape get started

[![Watch the video](https://i.postimg.cc/s2JTzCHT/billgates.png)](https://youtu.be/5pZWqpMaP6Q)

1. Profile URLs

- Paste your list of linkedin profile into `URLs` input field\
  It is recommended to provide only 80 URLs per day to avoid LinkedIn detection. That would force you to re-login, and re-copy your cookies.\
  If you don't have a listing of Profile URLs, check out [this Actor](https://apify.com/anchor/linkedin-company-url-finder)

2. OpenAI API Key

- Get your OpenAI API key from [OpenAI API keys page](https://platform.openai.com/api-keys)
- Paste the API key into this actor's `OpenAI API Key` input field

3. Prompt Instructions
   Instructions for ChatGPT. For example:

- `Is this person a good candidate for the following job description : Sales Manager of a car company? Why? Also, Add a rating from 0 to 10 to summarize.`
- or `Rate this profile from 0 to 10, with 10 being a good fit for a fullstack NodeJS dev @google in Paris, France`

4. Cookies

- In chrome, install [🍪 EditThisCookie](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg) chrome extension, and login to your LinkedIn account
- Click on the 🍪 extension, and click on the export icon ➡️ (the second one)
- In Apify, paste the cookies into this actor's `Cookies` input field

🚀 Then run the actor and wait for the results 📊

### ⚙️ How it works under the hood

This actor works on a logged in linkedin account, but doesn't require password details since it uses linkedin session cookies. You need to pass linkedin cookies to this actor to use the existing session to access profiles page and perform scraping. A screenshot is taken on each profile page to ensure that the actor is working properly.

Once the Profile page is scraped, the actor will clean the data from the page and send it to OpenAI along with your prompt. The ChatGPT result is then returned to you.

### 🥢 Which LinkedIn Actor should I use ?

There are a couple of LinkedIn Actors on Apify. Make sure you only use [guillim's actors](https://apify.com/anchor) for better safety and quality results. Also, you may be wondering which Actors you need, so read below :

##### Scraping small amount

When you need to gather data of less than 50 records per day, you can rely on Actors who require your LinkedIn cookies. These actors will "act as you", so you be careful. You will need the following actors :

- You have a few LinkedIn **people url**, now looking for their **information** like job, description, skills... : [LinkedIn x GPT](https://apify.com/anchor/linkedin-gpt-prompt) (This one, you are on it)
- You have a few LinkedIn **people url**, that you want to filter out using a ChatGPT prompt: [LinkedIn x GPT](https://apify.com/anchor/linkedin-gpt-prompt) (This one, you are on it)

##### Scraping big amount

When you need to gather data, like more 50 records per day, it's recommended to avoid using your Linkedin cookies. You will need the following actors :

- Looking for many LinkedIn **company url**: [Mass company finder](https://apify.com/anchor/linkedin-company-url-finder)
- Looking for many LinkedIn **people url**: [Mass people finder](https://apify.com/anchor/linkedin-people-finder)
- You have many LinkedIn **people url**, now looking for their **information** like job, description, skills... : [Mass profile scrapper](https://apify.com/anchor/linkedin-profile-enrichment)

# Actor input Schema

## `startUrls` (type: `array`):

People URLs you want your prompt to work on. Only Linkedin urls

## `gpt_api_key` (type: `string`):

API key from OpenAI GPT

## `instructions` (type: `string`):

Instructions for the prompt, to let GPT know what to do. For example: 'Is this person a good candidate for the following job description : Sales Manager of a car company? Why? Also, Add a rating from 0 to 10 to summarize.'

## `cookies` (type: `array`):

Cookies from your linkedin account. See https://apify.com/anchor/linkedin-gpt-prompt#getting-started

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/in/elon-musk-elonmusk-6648688b"
    }
  ],
  "gpt_api_key": "your_api_key",
  "instructions": "Is this person a good candidate for the following job description : Sales Manager of a car company? Why?  Also, Add a rating from 0 to 10 to summarize.",
  "cookies": [
    {
      "domain": ".linkedin.com",
      "expirationDate": 1721120692,
      "hostOnly": false,
      "httpOnly": false,
      "name": "xxxx_14215E3D5995C57C0A495C55%xxxx",
      "path": "/",
      "sameSite": "unspecified",
      "secure": false,
      "session": false,
      "storeId": "0",
      "value": "-637568504%7CMCIDTS%7C19xxxxxxxxxxxxx",
      "id": 1
    }
  ]
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.linkedin.com/in/elon-musk-elonmusk-6648688b"
        }
    ],
    "gpt_api_key": "your_api_key",
    "instructions": "Is this person a good candidate for the following job description : Sales Manager of a car company? Why?  Also, Add a rating from 0 to 10 to summarize.",
    "cookies": [
        {
            "domain": ".linkedin.com",
            "expirationDate": 1721120692,
            "hostOnly": false,
            "httpOnly": false,
            "name": "xxxx_14215E3D5995C57C0A495C55%xxxx",
            "path": "/",
            "sameSite": "unspecified",
            "secure": false,
            "session": false,
            "storeId": "0",
            "value": "-637568504%7CMCIDTS%7C19xxxxxxxxxxxxx",
            "id": 1
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("anchor/linkedin-gpt-prompt").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [{ "url": "https://www.linkedin.com/in/elon-musk-elonmusk-6648688b" }],
    "gpt_api_key": "your_api_key",
    "instructions": "Is this person a good candidate for the following job description : Sales Manager of a car company? Why?  Also, Add a rating from 0 to 10 to summarize.",
    "cookies": [{
            "domain": ".linkedin.com",
            "expirationDate": 1721120692,
            "hostOnly": False,
            "httpOnly": False,
            "name": "xxxx_14215E3D5995C57C0A495C55%xxxx",
            "path": "/",
            "sameSite": "unspecified",
            "secure": False,
            "session": False,
            "storeId": "0",
            "value": "-637568504%7CMCIDTS%7C19xxxxxxxxxxxxx",
            "id": 1,
        }],
}

# Run the Actor and wait for it to finish
run = client.actor("anchor/linkedin-gpt-prompt").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.linkedin.com/in/elon-musk-elonmusk-6648688b"
    }
  ],
  "gpt_api_key": "your_api_key",
  "instructions": "Is this person a good candidate for the following job description : Sales Manager of a car company? Why?  Also, Add a rating from 0 to 10 to summarize.",
  "cookies": [
    {
      "domain": ".linkedin.com",
      "expirationDate": 1721120692,
      "hostOnly": false,
      "httpOnly": false,
      "name": "xxxx_14215E3D5995C57C0A495C55%xxxx",
      "path": "/",
      "sameSite": "unspecified",
      "secure": false,
      "session": false,
      "storeId": "0",
      "value": "-637568504%7CMCIDTS%7C19xxxxxxxxxxxxx",
      "id": 1
    }
  ]
}' |
apify call anchor/linkedin-gpt-prompt --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,anchor/linkedin-gpt-prompt"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/d7RnhBVvyZRL8MvP0/builds/cOeB0O2nUlS1eEL1o/openapi.json
