API

LinkedIn Groups

Fetch and manage LinkedIn group members with our Groups API

LinkedIn Groups API

The LinkedIn Groups API enables you to fetch and manage LinkedIn group members programmatically. Extract member information, filter by membership status, and search members by name.

Overview

Use these endpoints to:

  • Fetch Group Members: Get a list of all members in a LinkedIn group
  • Pagination Support: Handle large groups with built-in pagination
  • Filter by Status: Get only owners, managers, or regular members
  • Search Members: Find specific members by name
  • Rich Profile Data: Access full member profiles including names, headlines, and profile pictures

Key Features

Comprehensive Member Data

Each member object includes:

  • Full name and profile details
  • Professional headline
  • Profile picture URL
  • Membership status (OWNER, MANAGER, MEMBER)
  • Follower count and following status
  • LinkedIn creator badge status

Flexible Filtering

Filter members by:

  • Membership Status: Get only owners, managers, or regular members
  • Name Search: Use typeahead query to find specific members
  • Pagination: Fetch members in batches (1-100 per request)

Two Ways to Query

  • By Group ID: Direct group ID lookup
  • By Group URL: Provide the full LinkedIn group URL

Use Cases

Lead Generation

Extract all members from industry-specific groups for targeted outreach campaigns.

Community Analysis

Analyze group composition, identify key influencers, and track member growth over time.

Recruitment

Find potential candidates by filtering through professional groups related to specific skills or industries.

Network Building

Identify and connect with group owners and managers for strategic partnerships.

Getting Started

Finding Your Group ID

The group ID can be found in the LinkedIn group URL:

https://www.linkedin.com/groups/9357376/
                                 ^^^^^^^^
                                 Group ID

Basic Example

curl -X POST "https://api.connectsafely.ai/linkedin/groups/members" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "groupId": "9357376",
    "count": 50
  }'

Pagination Example

Fetch all members from a large group:

let allMembers = [];
let start = 0;
const batchSize = 50;

while (true) {
  const response = await fetch('/linkedin/groups/members', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      groupId: '9357376',
      count: batchSize,
      start: start
    })
  });

  const data = await response.json();
  allMembers.push(...data.members);

  if (!data.hasMore) break;
  start += batchSize;
}

console.log(`Total members: ${allMembers.length}`);

Response Format

All endpoints return a consistent structure:

{
  "success": true,
  "groupId": "9357376",
  "members": [...],
  "pagination": {
    "count": 50,
    "start": 0,
    "total": 3806
  },
  "hasMore": true
}

Rate Limits

Please be mindful of LinkedIn's rate limits when fetching group members. We recommend:

  • Adding delays between paginated requests (1-2 seconds)
  • Caching results when possible
  • Respecting the group's privacy settings

Available Endpoints

Best Practices

  1. Use Pagination: For groups with thousands of members, always use pagination
  2. Cache Results: Group membership doesn't change frequently, consider caching
  3. Filter Wisely: Use membershipStatuses to get only the members you need
  4. Handle Errors: Some profiles may be private or deleted, handle null values gracefully
  5. Respect Privacy: Only use member data in accordance with LinkedIn's terms and privacy policies

Need Help?

  • Check our API Reference for detailed endpoint documentation
  • Contact support for questions about rate limits or specific use cases