# Run a historical search

**`POST https://myagentmail.com/linkedin/searches`**

Group: LinkedIn — Searches
Operation ID: `linkedinRunSearch`

Synchronous keyword search across the past 24 hours, week, or month.
Returns the full hit list inline. Use this for one-shot lookups; for
continuous monitoring use POST /v1/linkedin/signals.


## Request body

Content-Type: `application/json`

```json
{
  "sessionId": "string",
  "query": "string",
  "lookback": "past-week",
  "minIntent": "low",
  "intentDescription": "string",
  "limit": 50
}
```

## Responses

### 200 — Search ran successfully. results may be empty.

```json
{
  "search": {
    "id": "string",
    "sessionId": "string",
    "query": "string",
    "lookback": "past-24h",
    "minIntent": "low",
    "intentDescription": "string",
    "resultCount": 0,
    "tookMs": 0,
    "errorCode": "string",
    "errorMessage": "string",
    "createdAt": "2026-05-01T09:03:22.715Z"
  },
  "results": [
    {
      "postUrl": "string",
      "postExcerpt": "string",
      "postedAt": "2026-05-01T09:03:22.715Z",
      "author": {
        "name": "string",
        "profileUrl": "string",
        "headline": "string",
        "role": "string",
        "company": "string"
      },
      "classification": {
        "engage": false,
        "intent": "low",
        "reason": "string"
      },
      "triageScore": 0,
      "rank": 0
    }
  ]
}
```

### 404 — LinkedIn session not found or inactive.

### 429 — LinkedIn rate-limited this session. The search row is persisted with errorCode=LINKEDIN_RATE_LIMITED.

### 502 — LinkedIn returned an unexpected error. The search row is persisted with the error captured.

## Code samples

### TypeScript

```typescript
import { MyAgentMail } from "myagentmail";

const client = new MyAgentMail({ apiKey: process.env.MYAGENTMAIL_API_KEY! });

// POST /linkedin/searches
const result = await client.request("post", "/linkedin/searches", { body: {
  "sessionId": "string",
  "query": "string",
  "lookback": "past-week",
  "minIntent": "low",
  "intentDescription": "string",
  "limit": 50
} });
```

### curl

```bash
curl -X POST 'https://myagentmail.com/linkedin/searches' \
  -H 'X-API-Key: $MYAGENTMAIL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "sessionId": "string",
  "query": "string",
  "lookback": "past-week",
  "minIntent": "low",
  "intentDescription": "string",
  "limit": 50
}'
```

### Python

```python
import os, requests

r = requests.post(
    "https://myagentmail.com/linkedin/searches",
    headers={"X-API-Key": os.environ["MYAGENTMAIL_API_KEY"]},
    json={
        "sessionId": "string",
        "query": "string",
        "lookback": "past-week",
        "minIntent": "low",
        "intentDescription": "string",
        "limit": 50
    },
)
r.raise_for_status()
print(r.json())
```
