# Add Tasks

Add LinkedIn URLs to scrape posts

Add LinkedIn URLs to your **LinkedIn Posts Scraper** squid. Each task accepts a profile URL (collects recent posts from that member), a company URL (collects recent posts from that company), or a direct post URL (collects that single post).

<Note>Crawler ID: `6a9159b682cfb187977ae5c645e4df7a`</Note>

## Headers

<ParamField header="Authorization" type="string" required>
  Your API authentication token. Value: `Token YOUR_API_KEY`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Request body format. Value: `application/json`
</ParamField>

## Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **squid** | string | Yes | Hash of your squid configured with the LinkedIn Posts Scraper crawler |
| **tasks** | array | Yes | Array of task objects, each containing a `linkedin_url` field |

## Task Object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| **linkedin_url** | string | Yes | LinkedIn profile URL, company URL, or direct post URL |

<Note>
  Accepted URL formats:
  - Profile: `https://www.linkedin.com/in/username/`
  - Company: `https://www.linkedin.com/company/company-name/`
  - Post: `https://www.linkedin.com/feed/update/urn:li:activity:1234567890/`
</Note>

<Warning>
  This scraper requires a LinkedIn account to be linked to your squid. See [Link Account to Squid](https://staging.docs.lobstr.io/docs/link-account-to-squid).
</Warning>

## Code Examples

<CodeGroup>
```bash cURL
curl -X POST "https://api.lobstr.io/v1/tasks" \
  -H "Authorization: Token YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "squid": "YOUR_SQUID_HASH",
    "tasks": [
      {"linkedin_url": "https://www.linkedin.com/in/username/"},
      {"linkedin_url": "https://www.linkedin.com/company/openai/"}
    ]
  }'
```

```python Python
import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.lobstr.io/v1"
headers = {"Authorization": f"Token {API_KEY}"}

squid_id = "YOUR_SQUID_HASH"

payload = {
    "squid": squid_id,
    "tasks": [
        {"linkedin_url": "https://www.linkedin.com/in/username/"},
        {"linkedin_url": "https://www.linkedin.com/company/openai/"}
    ]
}

response = requests.post(f"{BASE_URL}/tasks", headers=headers, json=payload)

data = response.json()
print(f"Added {len(data['tasks'])} tasks")
print(f"Duplicates skipped: {data['duplicated_count']}")
```
</CodeGroup>

## Response

```json 200
{
  "duplicated_count": 0,
  "tasks": [
    {
      "id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
      "created_at": "2026-06-09T10:00:00.000000",
      "is_active": true,
      "params": {
        "linkedin_url": "https://www.linkedin.com/in/username/"
      },
      "object": "task"
    }
  ]
}
```
