# Search LinkedIn posts (https://snitchfeed.com/docs/api/linkedin/posts/search)

**Authentication:** All requests require `Authorization: Bearer <api_key>` header. Obtain your API key from the SnitchFeed platform under Integrations → API Keys.

## `POST /data/linkedin/posts/search`

**Full URL:** `https://api.snitchfeed.com/v1/data/linkedin/posts/search`

**Summary:** Search LinkedIn posts

Search public LinkedIn posts by keyword, filterable by author job title, company, industry, member or organization. Costs 4 credits per successful request.

**Recommended client timeout: 90 seconds.** Most requests resolve in 2-5 seconds, but set your HTTP client timeout to at least 90 seconds to avoid false timeouts on slower queries.

Credits

Each **successful** response deducts **4 credits** from your organization. Requests that fail (4xx / 5xx) are not billed.

See the [credits documentation](https://snitchfeed.com/docs/api/credits) for the full rate table.

### Request Body

**Content-Type:** `application/json`

#### Fields

Request body for `POST /data/linkedin/posts/search`.

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `query` | string | ✓ | Keywords / search terms (text you would put in the LinkedIn search bar). (minLength: 1, maxLength: 200) |
| `page` | integer |  | Page number (1-based). Default: `1`. (min: 1) |
| `sort_by` | "recent", "relevant" |  | Sort order for this page. Mapped upstream to `relevance` (top match) or `date_posted` (latest). Default: `"recent"`. |
| `count` | integer |  | Deprecated. Ignored. The full page is always returned. (min: 1, max: 20) |
| `author_job_title` | string |  | Rough text matching the author's job title (e.g. CEO). Maps to upstream `author_job_title`. (maxLength: 80) |
| `content_type` | "photos", "videos", "liveVideos", "collaborativeArticles", "documents" |  | Require posts to include this content type. Maps to upstream `content_type`. |
| `from_member` | string |  | Person URNs who authored the post, comma-separated. Maps to upstream `from_member`. (maxLength: 120) |
| `from_organization` | string |  | Organization ids that posted the post, comma-separated. Maps to upstream `from_organization`. (maxLength: 120) |
| `author_company` | string |  | Company ids where the author works, comma-separated. Maps to upstream `author_company`. (maxLength: 120) |
| `author_industry` | integer[] |  | Numeric industry IDs to filter by author industry (max 5). Use [GET /data/linkedin/industries](/docs/api/linkedin/industries/search) to find valid IDs. |
| `mentions_member` | string |  | Person URNs mentioned in the post, comma-separated. Maps to upstream `mentions_member`. (maxLength: 120) |
| `mentions_organization` | string |  | Organization ids mentioned in the post, comma-separated. Maps to upstream `mentions_organization`. (maxLength: 120) |

### Responses

#### `200`: Search results

#### Response fields

Successful `POST /data/linkedin/posts/search` response.

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `posts` | object[] | ✓ | Matching posts for this page. |
| `meta` | object | ✓ | Pagination metadata for LinkedIn post search. |
| `returnedCount` | integer | ✓ | Number of posts returned in this response. (min: 0) |
| `page` | integer | ✓ | Page number echoed from the request (1-based). (min: 1) |

#### `400`: Validation or bad request

#### Response fields

Validation error

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "validation_error" | ✓ |  |
| `message` | string | ✓ |  |
| `issues` | object[] | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "validation_error",
    "message": "query: String must contain at least 1 character(s)",
    "issues": [
      {
        "path": "query",
        "message": "String must contain at least 1 character(s)"
      }
    ]
  }
}
```

#### `401`: Unauthorized

#### Response fields

Unauthorized

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "unauthorized" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "unauthorized",
    "message": "Invalid or revoked API key."
  }
}
```

#### `403`: Forbidden: the credential lacks the `search:read` scope, the organization's plan does not include API access (API keys only), or the authorizing user's role lacks the required permission.

#### Response fields

Forbidden — the API key lacks a required scope, or its owner's role lacks the underlying permission.

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "forbidden" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "forbidden",
    "message": "This credential does not have the \"search:read\" scope."
  }
}
```

#### `429`: Rate limited (20 requests per minute per surface) or too many concurrent in-flight requests (max 2 per organization)

#### Response fields

Rate limited or too many concurrent in-flight requests

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "rate_limited" | ✓ |  |
| `message` | string | ✓ |  |
| `retryAfter` | integer | ✓ | Seconds until the rate limit resets (same value as the `Retry-After` response header). |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded for linkedin. Try again later.",
    "retryAfter": 42
  }
}
```

#### `502`: Upstream error

#### Response fields

Upstream error

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "upstream_error" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "01HXYZABCDEF",
  "error": {
    "code": "upstream_error",
    "message": "LinkedIn search could not be completed. You won't be charged for this request."
  }
}
```

#### `503`: LinkedIn search temporarily unavailable

#### Response fields

LinkedIn search temporarily unavailable

| Field | Type | Required | Description |
|-------|------|:--------:|-------------|
| `requestId` | string | ✓ | Server-generated id for this request (logging / support). |
| `error` | object | ✓ |  |
| `code` | "linkedin_unavailable" | ✓ |  |
| `message` | string | ✓ |  |

**Example:**
```json
{
  "requestId": "ce8f36c6-c9e6-4ab1-93b3-d11bbbe886aa",
  "error": {
    "code": "linkedin_unavailable",
    "message": "LinkedIn search is temporarily unavailable. Retry later. You won't be charged for this request."
  }
}
```
