# LinkedIn Groups Scraper (`khadinakbar/linkedin-groups-scraper`) Actor

Search public LinkedIn groups by keyword or fetch a group URL: name, member count, description, admins, and optional group posts. HarvestAPI-backed, cookieless, no LinkedIn login. MCP-ready.

- **URL**: https://apify.com/khadinakbar/linkedin-groups-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Lead generation, Social media, MCP servers
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 linkedin group founds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## 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 Groups Scraper

Search public LinkedIn groups by keyword or open a known group URL and save one dataset row per group: name, canonical URL, member count, description, rules, and administrator names with profile URLs. Optionally add public group posts (text, author, likes, comments). Cookieless HarvestAPI runtime, no LinkedIn login. Built for B2B marketers and recruiters who need niche communities and admin/poster leads they can route into outreach.

### What you get

| Output | What it answers |
|---|---|
| `groupName` + `groupUrl` + `groupId` | **Which community** matched the keyword or URL |
| `memberCount` + `memberCountText` | **How large** the public group is |
| `summary` + `description` + `rules` | **What the group is about** from the public profile |
| `admins` + `adminCount` | **Who organizes** the group (public admin profiles HarvestAPI exposes) |
| `recordType=post` rows | **What people are posting** when `includePosts` is on |
| `OUTPUT` / `RUN_SUMMARY` outcomes | **Provenance** — complete, empty, invalid input, or upstream outage |

### Who it is for (and why it matters)

- **B2B marketers** — map the LinkedIn communities where a niche already gathers, then use admin and poster profile URLs as high-intent leads.
- **Recruiters** — find role-specific groups (sales ops, product, RevOps) and the people who organize or post in them.
- **Community and partnership teams** — research adjacent groups before sponsoring, posting, or partnering.
- **AI agents** — one tool call with `searchKeywords` or `groupUrls` returns structured group rows plus a named `outcome`, so the agent can continue, skip, or route.

### When to use this Actor

- You have a niche keyword such as `Sales Operations` and want matching public LinkedIn groups.
- You already have group URLs or numeric IDs and want the public profile, member count, and admins in one row.
- You want optional public posts from those groups for content or lead research.
- When the starting point is a person name or job title, start with [LinkedIn Profile Search Scraper](https://apify.com/khadinakbar/linkedin-profile-search-scraper), then continue here only after you have a community to inspect.
- When the starting point is a company page, use [LinkedIn Company Search Scraper](https://apify.com/khadinakbar/linkedin-company-search-scraper). After this Actor returns admin profile URLs, pass them to [LinkedIn Profile Details Scraper](https://apify.com/khadinakbar/linkedin-profile-details-scraper) for the public about and experience view.

### Best fit for this Actor

- Strongest starting condition: a specific industry or role phrase, or a LinkedIn `/groups/{id}` URL.
- Useful output: one `recordType=group` row per community, billed as `group-found`. Optional `recordType=post` rows billed as `group-post`.
- Designed for public group discovery. The full login-gated member roster sits outside this contract; rows include **admins** and, when requested, **public posts**.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searchKeywords` | string | Sales Operations | Niche used to search public LinkedIn groups. Leave empty when you already have URLs. |
| `groupUrls` | array | 1 example URL | LinkedIn group URLs or numeric IDs, up to 50 unique IDs |
| `maxGroups` | integer | 10 | Cap on group rows saved and billed (1–100) |
| `enrichGroups` | boolean | true | Follow each search hit with a full group fetch (description, rules, admins) |
| `includePosts` | boolean | false | Also save public posts from each group |
| `maxPostsPerGroup` | integer | 10 | Cap on posts per group when `includePosts` is on (1–50) |

#### Quick start input

```json
{
    "groupUrls": ["https://www.linkedin.com/groups/1898033/"],
    "maxGroups": 1,
    "enrichGroups": true,
    "includePosts": false
}
```

That input selects a single known group so the quality sample stays inside five minutes and still returns a real group row.

#### Example input — keyword discovery with posts

```json
{
    "searchKeywords": "Sales Operations",
    "maxGroups": 10,
    "enrichGroups": true,
    "includePosts": true,
    "maxPostsPerGroup": 10
}
```

Duplicate group IDs are deduplicated. Search hits that already appear in `groupUrls` are skipped.

### What data you receive

One dataset item is either a group, a public group post, or a CLEAR lookup for a URL that HarvestAPI reports as gone.

```json
{
    "recordType": "group",
    "groupId": "1898033",
    "groupUrl": "https://www.linkedin.com/groups/1898033/",
    "groupName": "Sales Operations Professionals",
    "memberCount": 12450,
    "memberCountText": "10,000+ members",
    "summary": "A community for sales ops.",
    "description": "Share process, tooling, and forecasts.",
    "adminCount": 2,
    "admins": [
        {
            "adminName": "Jane Ops",
            "adminProfileUrl": "https://www.linkedin.com/in/janeops",
            "adminHeadline": "RevOps"
        }
    ],
    "enriched": true,
    "provider": "harvestapi",
    "scrapedAt": "runtime"
}
```

Every terminal run also writes `OUTPUT` and `RUN_SUMMARY` with a named `outcome`, per-item results, provider diagnostics, and billing counters.

### Workflow story: from a niche keyword to admin outreach URLs

A RevOps lead wants communities where sales-ops managers already gather. She starts this Actor with `searchKeywords: "Sales Operations"`, `maxGroups: 10`, and `enrichGroups: true`. The Actor searches public LinkedIn groups, fetches each matching profile, and saves name, member count, description, and admin profile URLs. She exports the `admins` array, then passes those profile URLs to [LinkedIn Profile Details Scraper](https://apify.com/khadinakbar/linkedin-profile-details-scraper) before outreach. Event cost for ten enriched groups is 10 × $0.01 plus Actor start.

### Use through the API

```bash
curl -X POST "https://api.apify.com/v2/acts/khadinakbar~linkedin-groups-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "groupUrls": ["https://www.linkedin.com/groups/1898033/"],
    "maxGroups": 1,
    "enrichGroups": true,
    "includePosts": false
  }'
```

Results land in the run's default dataset: `https://api.apify.com/v2/datasets/{datasetId}/items?clean=true`. Paginate large batches with `offset`/`limit`. The same Actor is exposed through Apify MCP as `apify--linkedin-groups-scraper`.

### Use with AI agents through Apify MCP

> Search public LinkedIn groups for this niche keyword, return group name, URL, member count, description, and admin profile URLs. Inspect the terminal outcome, read the dataset, and keep groupUrl as the source identifier. Cap the run at 10 groups.

Connect through [Apify MCP](https://mcp.apify.com).

```json
{
    "searchKeywords": "Sales Operations",
    "maxGroups": 10,
    "enrichGroups": true,
    "includePosts": false
}
```

Then read results with `get-actor-output`, keep `recordType=group` rows for community research, and pass `admins[].adminProfileUrl` into a profile-details or email-finder step.

### Pricing

This Actor uses Pay per event plus Apify platform usage. Open the live Pricing tab for current event details, and use Apify's run cost controls to keep the workflow aligned with your budget.

| Event | Price | Charged when |
|---|---|---|
| Actor start | $0.00005 | Once per run (scaled by memory) |
| `group-found` | $0.01 | One LinkedIn group row saved |
| `group-post` | $0.005 | One public group post saved |

CLEAR rows and invalid input are outside `group-found` billing.

| Run | Groups | Posts | Event cost (approx.) |
|---|---|---|---|
| 1 group URL | 1 | off | ~$0.01 |
| 10 keyword groups | 10 | off | ~$0.10 |
| 10 groups + 10 posts each | 10 | 100 | ~$0.60 |

When you want current event prices, use the live [Pricing tab](https://apify.com/khadinakbar/linkedin-groups-scraper/pricing) as the source of truth. Platform usage is billed on top at Apify's rates.

### Best results

- Start with a specific niche (`Sales Operations`, `B2B SaaS founders`) rather than a single generic word.
- Keep `maxGroups` at 10 for the first run so you can confirm member counts and admins before a bulk discovery job.
- Leave `enrichGroups` on when you need description, rules, and admin profile URLs; turn it off only for cheap name/URL cards.
- Turn on `includePosts` when you want recent public discussion as extra lead or content signal.
- After you have admin profile URLs, continue with [LinkedIn Profile Details Scraper](https://apify.com/khadinakbar/linkedin-profile-details-scraper) for the public about view.

### Builder's note

I built this after live probes showed the usual social-data path is closed for LinkedIn Groups: ScrapeCreators and SociaVault have no group endpoints, `linkedin.com/groups/{id}` is a login wall, and Google no longer indexes `/groups/{id}` pages. HarvestAPI is the public cookieless route that actually returns group search, full profiles, admins, and posts. My goal was an honest MCP-ready Actor that bills real group rows, writes CLEAR when a known ID is gone, and says admins instead of promising a login-gated roster.

### Responsible use

Use this Actor on public LinkedIn groups you are authorized to research for legitimate sales, recruiting, or community work. It reads **public group pages through HarvestAPI** only. It stays cookieless and off LinkedIn login. Follow GDPR, CCPA, LinkedIn's terms, and any local law that applies to your outreach. Honor opt-out and do-not-contact requests.

This tool is provided for lawful public-data collection. You are responsible for how you use the output.

# Actor input Schema

## `searchKeywords` (type: `string`):

Industry, role, or niche used to search public LinkedIn groups (e.g., Sales Operations). Specific phrases beat broad ones. Leave empty when you already have group URLs. NOT a LinkedIn profile or company URL — put those in sibling LinkedIn actors.

## `groupUrls` (type: `array`):

LinkedIn group URLs or numeric IDs to fetch in full. Accepts https://www.linkedin.com/groups/1898033/ and 1898033. Up to 50 unique IDs per run. NOT profile, company, or job URLs.

## `maxGroups` (type: `integer`):

Maximum number of group rows to save and bill. The saved quality sample uses 1; raise this for bulk discovery. The cap applies to search results and URL fetches combined.

## `enrichGroups` (type: `boolean`):

When enabled, each search hit is followed by a full group fetch so the row includes description, rules, memberCount, and admin names/profile URLs. Disable for cheaper discovery cards (name, URL, snippet member text only). URL mode always fetches the full profile. Full rows still charge group-found once.

## `includePosts` (type: `boolean`):

When enabled, public posts from each saved group are written as extra dataset rows (recordType=post) and billed as group-post. Leave off when you only need group metadata and admins. This is not the login-gated full member roster.

## `maxPostsPerGroup` (type: `integer`):

Maximum public posts to save per group when includePosts is on. Default 10. HarvestAPI returns one page of public posts, not every historical discussion.

## Actor input object example

```json
{
  "searchKeywords": "Sales Operations",
  "groupUrls": [
    "https://www.linkedin.com/groups/1898033/"
  ],
  "maxGroups": 1,
  "enrichGroups": true,
  "includePosts": false,
  "maxPostsPerGroup": 10
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items containing group metadata, admins, and optional public group posts.

## `summary` (type: `string`):

Run summary including outcome, groupsFound, postsFound, provider status codes, and billing counters.

## `runSummary` (type: `string`):

Machine-readable RUN\_SUMMARY record mirroring OUTPUT for integrations that read RUN\_SUMMARY directly.

# 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 = {
    "groupUrls": [
        "https://www.linkedin.com/groups/1898033/"
    ],
    "maxGroups": 1,
    "enrichGroups": true,
    "includePosts": false,
    "maxPostsPerGroup": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/linkedin-groups-scraper").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 = {
    "groupUrls": ["https://www.linkedin.com/groups/1898033/"],
    "maxGroups": 1,
    "enrichGroups": True,
    "includePosts": False,
    "maxPostsPerGroup": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/linkedin-groups-scraper").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 '{
  "groupUrls": [
    "https://www.linkedin.com/groups/1898033/"
  ],
  "maxGroups": 1,
  "enrichGroups": true,
  "includePosts": false,
  "maxPostsPerGroup": 10
}' |
apify call khadinakbar/linkedin-groups-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/qoKALto3r6cMQNAAj/builds/oabKcwNpFE4Sp79kM/openapi.json
