# How to Install and Use LinkedIn API in OpenClaw

- Tool: OpenClaw
- Difficulty: Beginner
- Time required: 15 minutes
- Last updated: March 2026

## TL;DR

To access LinkedIn programmatically in OpenClaw, run `clawhub install linkedin-api` in your terminal, set your LINKEDIN_ACCESS_TOKEN in OpenClaw config, and make LinkedIn REST API calls from OpenClaw chat. The skill provides low-level access to LinkedIn's API for posting, reading profiles, retrieving analytics, and managing connections — giving you full programmatic control over LinkedIn operations without a browser.

## Programmatic LinkedIn Access via REST API from OpenClaw

The LinkedIn API skill gives OpenClaw direct programmatic access to LinkedIn's REST API, enabling operations that go beyond casual social interaction. With this skill configured, you can post on behalf of your LinkedIn account, retrieve detailed engagement analytics for your posts, read profile and company page data, manage UGC (User Generated Content) posts, and access follower demographics — all through OpenClaw chat or automated workflows triggered by other skills.

This skill is particularly valuable for content creators managing a LinkedIn presence at scale, marketing teams that need LinkedIn data in automation pipelines, founders who want to build LinkedIn publishing workflows into their OpenClaw setup, and developers building applications that interact with LinkedIn. The low-level API access means you can perform any operation LinkedIn's API supports, not just the operations a higher-level social interaction tool exposes.

The LinkedIn API skill differs from the LinkedIn social skill in its interaction model. The LinkedIn social skill provides natural-language browsing — you can ask it to 'browse my feed' or 'find posts about AI funding rounds' using a higher-level abstraction. The LinkedIn API skill gives you direct REST API access with an access token — more powerful and precise, but requiring you to understand what API operations you want to perform. If you need programmatic posting, analytics, or data retrieval, use this API skill. If you want to browse and engage with LinkedIn conversationally, use the LinkedIn social skill.

## Before you start

- OpenClaw installed and running (see openclaw.ai for installation instructions)
- ClawHub CLI available in your terminal (comes bundled with OpenClaw)
- A LinkedIn account with developer access — either a personal account or access to a LinkedIn Developer Application
- A LinkedIn access token with the required OAuth 2.0 scopes for your intended operations (r_liteprofile, w_member_social, r_organization_social, etc.)
- Terminal/command line access to run the clawhub install command

## Step-by-step guide

### 1. Install the LinkedIn API Skill via ClawHub

Open your terminal and run the clawhub install command to add the linkedin-api skill to your OpenClaw instance. ClawHub downloads the skill package from the registry and registers it with your local OpenClaw configuration. The skill requires a LinkedIn access token, which you will configure in the next step.

After installation, run `clawhub info linkedin-api` to see the required configuration keys and supported API operations. The key required variable is `LINKEDIN_ACCESS_TOKEN`. Some advanced operations may require additional scopes on your access token or additional configuration.

The skill will not activate until the LINKEDIN_ACCESS_TOKEN is configured. Attempting to use it before configuration returns a clear error message pointing you to the missing token.

```
clawhub install linkedin-api
```

**Expected result:** Terminal shows 'linkedin-api@X.X.X installed successfully' with a note about required configuration keys. The skill appears in `clawhub list`.

### 2. Obtain a LinkedIn Access Token

LinkedIn uses OAuth 2.0 for API authentication. You need an access token with the appropriate scopes for the operations you plan to perform. There are two ways to get a LinkedIn access token: using LinkedIn's Developer Portal to create an app and generate a token, or using an existing token from a LinkedIn app you have already created.

To create a LinkedIn Developer App and get an access token:
1. Go to developer.linkedin.com and sign in with your LinkedIn account.
2. Click 'Create App', fill in the required details (App Name, LinkedIn Page, App Logo, Legal Agreement).
3. Once the app is created, go to the 'Auth' tab and note the Client ID and Client Secret.
4. Under 'OAuth 2.0 scopes', request the scopes you need: `w_member_social` for posting, `r_liteprofile` for profile reading, `r_organization_social` for company page operations.
5. Use the OAuth 2.0 Authorization Code flow or LinkedIn's token generator tool to exchange your authorization code for an access token.

LinkedIn access tokens expire after 60 days by default. Refresh tokens can extend this, but most personal use cases simply require generating a new token periodically.

Keep your access token private — it provides posting and reading access to your LinkedIn account. Never commit it to version control or share it in chat logs.

```
# After obtaining your token, configure it in OpenClaw
clawhub config set LINKEDIN_ACCESS_TOKEN AQX...your-token-here

# Verify the token is stored
clawhub config get LINKEDIN_ACCESS_TOKEN

# Reload OpenClaw configuration
clawhub reload
```

**Expected result:** Running `clawhub config get LINKEDIN_ACCESS_TOKEN` returns your token masked. OpenClaw confirms the linkedin-api skill is active and authenticated.

### 3. Test the Skill with a Profile or API Query

Before testing any write operations (posting), verify the skill is working correctly by making a read-only API call — fetching your own profile data. This confirms the token is valid and has the expected permissions without risking unintended published content.

In OpenClaw chat, ask the skill to fetch your LinkedIn profile information. If the API call succeeds, you will see your LinkedIn profile data returned as structured information. If the call fails with a 401 error, the token is invalid or expired. If it fails with a 403 error, the token lacks the required scope for that operation.

Once you have confirmed read access works correctly, you can test write operations — start with a draft post or a post on a test LinkedIn account before publishing to your actual profile.

**Expected result:** OpenClaw returns your LinkedIn profile data including name, headline, and basic profile information, confirming the access token is valid and the skill is correctly configured.

### 4. Post to LinkedIn and Retrieve Analytics

With the skill configured and tested, you can now use the full range of LinkedIn API operations from OpenClaw chat. For content publishing, the skill supports text posts, article shares, image posts, and video posts depending on the LinkedIn API version and your app's permissions.

For analytics retrieval, the skill can fetch impressions, engagement metrics, and audience data for your posts and company pages. This data is useful for understanding content performance and can be exported to spreadsheets or databases via other OpenClaw skills for ongoing tracking.

RapidDev offers configuration support for teams building LinkedIn content automation pipelines — particularly useful when combining the LinkedIn API skill with AI content generation skills (like ai-ppt-generator or summarize) to create end-to-end content workflows that generate and publish without manual steps.

Note that LinkedIn's API has posting rate limits and content policies — automated or high-volume posting may trigger LinkedIn's spam detection. Keep posting frequency within reasonable bounds (2-3 posts per day maximum for individual accounts) and ensure all content is genuine and adds value.

```
# Example: Retrieve analytics for recent posts via clawhub CLI
clawhub run linkedin-api --action get-post-analytics --limit 10

# Example: Post a text update
clawhub run linkedin-api --action create-post --text 'Your post text here' --visibility public
```

**Expected result:** The post appears on your LinkedIn profile as published content. Analytics retrieval returns structured engagement data for the requested posts.

## Best practices

- Store your LINKEDIN_ACCESS_TOKEN in the OpenClaw .env file or skill config only — never include it in chat prompts, scripts committed to version control, or shared configuration files.
- Set a calendar reminder 55 days after generating a LinkedIn access token — tokens expire after 60 days and you want to refresh before workflows start failing unexpectedly.
- Test all API operations on a personal test account before using them on your main professional LinkedIn profile — API posting errors can result in partial or duplicate posts that need manual cleanup.
- Keep LinkedIn API posting frequency reasonable — LinkedIn's spam detection can flag accounts that post too frequently via API, especially if the content pattern looks automated. 1-2 API posts per day is a safe upper limit for individual accounts.
- Request only the OAuth scopes you actually need when generating your access token — the principle of least privilege reduces the risk if your token is ever compromised.
- Combine the LinkedIn API skill with AI content generation skills for end-to-end content workflows, but always review AI-generated LinkedIn content before posting — automated publishing of AI content without human review risks reputational issues.
- For analytics workflows, export LinkedIn engagement data to Google Sheets or Notion regularly rather than relying on API calls each time you need historical data — this builds a persistent record and reduces API usage.
- If you manage multiple LinkedIn accounts or company pages, generate separate access tokens for each and use distinct OpenClaw profiles or config environments to keep them separate.

## Use cases

### Automated LinkedIn Post Publishing

Use the LinkedIn API skill to publish text posts, article shares, or multi-media updates to your LinkedIn profile or company page programmatically. This enables content publishing workflows where OpenClaw generates content (using AI generation skills) and then publishes it directly to LinkedIn without manual copy-paste.

Prompt example:

```
Post the following update to my LinkedIn profile via the API: 'Excited to share that we just closed our seed round. 3 years of building in stealth, and now it's time to tell the story. More details in the comments.' Include the hashtags #startup #founder #fundraising.
```

### Post Engagement Analytics Retrieval

Retrieve engagement metrics for your LinkedIn posts — impressions, likes, comments, shares, and click-through rates — to understand which content resonates with your audience. Pull this data into OpenClaw for analysis or export to a Google Sheets or Notion database for tracking over time.

Prompt example:

```
Retrieve the engagement analytics for my last 10 LinkedIn posts via the API. Show me the impressions, likes, and comments for each post. Which post performed best by engagement rate?
```

### LinkedIn Profile and Company Page Data Retrieval

Fetch structured data about LinkedIn profiles, company pages, or followers for research, competitive analysis, or CRM enrichment. The API provides access to public profile information, follower counts, and content published by specific pages.

Prompt example:

```
Use the LinkedIn API to fetch the public profile information and follower count for the company page of 'Anthropic'. Return the data as structured JSON.
```

## Troubleshooting

### LinkedIn API skill returns '401 Unauthorized' when making API calls

Cause: The LINKEDIN_ACCESS_TOKEN is missing from OpenClaw config, set under the wrong variable name, or the token has expired (LinkedIn tokens expire after 60 days).

Solution: Run `clawhub config get LINKEDIN_ACCESS_TOKEN` to verify the token is stored. If it returns empty, re-run the config set command. If the token was working previously but stopped, it may have expired — generate a new token from developer.linkedin.com and update the config.

```
# Check token configuration
clawhub config get LINKEDIN_ACCESS_TOKEN

# Reset with a new token
clawhub config set LINKEDIN_ACCESS_TOKEN AQX-your-new-token
clawhub reload
```

### clawhub install linkedin-api fails with '429 Too Many Requests' or timeout

Cause: The ClawHub skill registry is experiencing temporary rate limiting. This is a registry-side issue.

Solution: Wait 2-3 minutes and retry. Use `clawhub install linkedin-api --force` to clear partial installation state if needed.

```
clawhub install linkedin-api --force
```

### LinkedIn API returns '403 Forbidden' when posting or reading certain data

Cause: The access token does not have the OAuth 2.0 scope required for that specific operation. For example, `w_member_social` is required for posting but not automatically included in all tokens.

Solution: Review the required scopes for the operation you are attempting in the LinkedIn Developer documentation. Re-generate your access token with the correct additional scopes enabled in your LinkedIn app settings.

```
# Check required scopes:
# w_member_social - for posting updates
# r_liteprofile - for reading your profile
# r_organization_social - for company page operations
# Regenerate token at developer.linkedin.com with required scopes
```

### LinkedIn API rate limit exceeded — too many requests error

Cause: LinkedIn's API has rate limits per token — typically 100 requests per day for standard apps or higher limits for approved Marketing API partners. Automated workflows can hit this quickly.

Solution: Reduce the frequency of API calls. Add delays between operations in automated workflows. For higher limits, apply for LinkedIn's Marketing Developer Platform access which grants elevated rate limits for approved use cases.

## Frequently asked questions

### How do I install the LinkedIn API skill in OpenClaw?

Run `clawhub install linkedin-api` in your terminal. Then obtain a LinkedIn access token from developer.linkedin.com and configure it with `clawhub config set LINKEDIN_ACCESS_TOKEN your-token`. Run `clawhub reload` and the skill is ready for API calls in OpenClaw chat.

### How do I configure the OpenClaw LinkedIn API access token?

Run `clawhub config set LINKEDIN_ACCESS_TOKEN AQX-your-access-token-here` in the terminal. The token can also be added to `~/.openclaw/.env` as `LINKEDIN_ACCESS_TOKEN=AQX-your-token`. Run `clawhub reload` after any configuration change. Verify it is set correctly with `clawhub config get LINKEDIN_ACCESS_TOKEN`.

### Where do I get a LinkedIn access token for OpenClaw?

Go to developer.linkedin.com, create a LinkedIn Developer App, configure the OAuth 2.0 scopes you need (at minimum `r_liteprofile` and `w_member_social`), and generate an access token using the Authorization Code flow. The LinkedIn Developer Portal provides a token generator tool for testing. Access tokens expire after 60 days.

### ClawHub install linkedin-api is not working — what should I do?

Confirm the exact skill name: `linkedin-api` (with a hyphen). If the install fails with a timeout, wait a few minutes and retry — ClawHub's registry occasionally experiences brief rate limits. Run `clawhub install linkedin-api --force` to clear any partial installation state before retrying.

### What is the difference between the LinkedIn API skill and the LinkedIn skill in OpenClaw?

LinkedIn API provides programmatic REST API access via an access token — you control specific operations like posting, analytics retrieval, and profile data fetching. LinkedIn social skill provides higher-level natural language interaction with LinkedIn — you can browse your feed, engage with posts, and manage your presence conversationally. LinkedIn API is for developers and automation; LinkedIn social skill is for conversational social media management.

### Does RapidDev offer help building LinkedIn automation workflows in OpenClaw?

Yes — RapidDev can help configure LinkedIn API integration as part of content automation pipelines combining the LinkedIn API skill with AI content generation tools. The individual setup on this page covers self-serve configuration. Teams building systematic LinkedIn publishing or analytics workflows can contact RapidDev for a configuration review.

### How often do LinkedIn access tokens expire, and how do I refresh them?

LinkedIn access tokens expire after 60 days by default. To refresh, generate a new token from your app in developer.linkedin.com and update your OpenClaw config with `clawhub config set LINKEDIN_ACCESS_TOKEN your-new-token` followed by `clawhub reload`. Some LinkedIn app configurations support refresh tokens for longer-lived access — check your app's OAuth settings in the LinkedIn Developer Portal.

---

Source: https://www.rapidevelopers.com/openclaw-integrations/linkedin-api
© RapidDev — https://www.rapidevelopers.com/openclaw-integrations/linkedin-api
