# LinkedIn Profile Search API Reference

> Platform documentation snapshot. Access, charging and provider requirements remain operation-specific; examples do not execute requests.

### What it does

Deep professional-profile search across roughly 55 filters covering current and past roles, tenure, seniority, function, skills, education, geography and company attributes. Built for precise people targeting when title alone is not enough.

### Use cases

- Find people who held a specific role at a specific company for at least two years, then moved.
- Recruit or map talent by skill plus tenure plus location without touching LinkedIn manually.
- Build very narrow buying-committee lists (for example, security leaders at regulated mid-market firms).

### Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `keyword` | string | Free-text search across headline, summary, skills, interests, associations and full name |
| `linkedin_url` | string | Exact profile lookup by LinkedIn URL or /in/slug |
| `name` | string | Full-name phrase match |
| `first_name` | string | First-name match |
| `last_name` | string | Last-name match |
| `title` | string | string[] | Current job title phrase(s). Any match (OR) |
| `title_exclude` | string | string[] | Exclude profiles whose current title matches any of these phrases |
| `company` | string | string[] | Current employer name phrase(s). Any match (OR) |
| `company_exclude` | string | string[] | Exclude profiles at these employers |
| `domain` | string | string[] | Current employer domain(s), e.g. "stripe.com" |
| `seniority` | string | string[] | Seniority of current role (e.g. "Chief X Officer (CxO)", "Vice President (VP)", "Director", "Manager") |
| `job_function` | string | string[] | Job function of current role (e.g. "Sales", "Engineering", "Marketing") |
| `employment_type` | string | string[] | Employment type (e.g. "Full-time", "Contract", "Internship") |
| `started_after` | date | Current role started on or after this date (YYYY-MM-DD) |
| `started_before` | date | Current role started on or before this date (YYYY-MM-DD) |
| `started_within_days` | integer | Started the current role within the last N days (recent job changers) |
| `min_months_in_role` | integer | Minimum tenure in the current role, in months |
| `max_months_in_role` | integer | Maximum tenure in the current role, in months |
| `past_title` | string | string[] | Held this title in a previous role |
| `past_company` | string | string[] | Worked at this company previously |
| `past_domain` | string | string[] | Worked at this company domain previously |
| `industry` | string | string[] | Current employer industry (LinkedIn industry naming; & / and spellings both matched) |
| `company_size` | string | string[] | Company size band (e.g. "SMB", "Enterprise") |
| `company_type` | string | string[] | Company type (e.g. "Public Company", "Privately Held", "Nonprofit") |
| `min_employees` | integer | Minimum employee count at current employer |
| `max_employees` | integer | Maximum employee count at current employer |
| `min_employee_growth_12mo` | float | Minimum 12-month headcount growth multiplier at current employer (e.g. 1.2 = +20%) |
| `founded_after` | integer | Current employer founded in or after this year |
| `founded_before` | integer | Current employer founded in or before this year |
| `specialties` | string | Phrase match on current employer specialties |
| `naics_codes` | string | string[] | NAICS industry code(s) of current employer |
| `sic_codes` | string | string[] | SIC industry code(s) of current employer |
| `company_locality` | string | Current employer city / locality |
| `company_region` | string | Current employer state / region |
| `company_country_iso` | string | Current employer country ISO code |
| `country` | string | Country name (e.g. "United States") |
| `country_iso` | string | string[] | Country ISO code(s) (e.g. "US", "GB") |
| `state` | string | State / province / admin district |
| `city` | string | City / locality |
| `postal_code` | string | Postal code |
| `location` | string | Phrase match on the full formatted address |
| `skills` | string | string[] | Required skill(s). All must be present (AND) |
| `interests` | string | string[] | Declared interest(s). All must be present (AND) |
| `school` | string | School name phrase match |
| `degree` | string | Degree phrase match |
| `graduated_after` | date | Education end date on or after (YYYY-MM-DD) |
| `graduated_before` | date | Education end date on or before (YYYY-MM-DD) |
| `min_connections` | integer | Minimum number of professional connections |
| `min_followers` | integer | Minimum follower count |
| `min_jobs_count` | integer | Minimum number of recorded roles on the profile |
| `active_only` | boolean | Only live (non-deleted) profiles. Default: true — set false to include deleted profiles |
| `exclude_incomplete` | boolean | Exclude profiles flagged as incomplete. Default: false |
| `require_linkedin_url` | boolean | Require a public LinkedIn URL. Default: true |
| `sort_by` | enum | "relevance" (default), "recent_job_change", "connections", "followers" |
| `size` | integer | Results per page (1-50, default: 25) |
| `from` | integer | Pagination offset (0-5000, default: 0) |
| `count` | boolean | Set true for a free count-only query (0 credits, empty profiles array) |

### Response Schema

_Complete documented fields for this section, with nested notation preserved. Endpoint-specific envelopes, availability and additional fields are described under each endpoint below._

| Field | Notes |
|-------|-------|
| total | |
| total_relation | |
| from | |
| size | |
| has_more | |
| profiles[] → linkedin_url, full_name, first_name, middle_name, last_name, nickname, headline, summary | |
| profiles[] → skills, interests, associations, profile_status, is_incomplete, experience_count | |
| profiles[] → location → formatted_address, city, neighborhood, state, county, postal_code, country, country_iso, region, latitude, longitude | |
| profiles[] → social → connections, followers, recommenders, jobs_count, current_roles | |
| profiles[] → education → school, degree, start_date, end_date | |
| profiles[] → current_role → title, start_date, months_in_role, seniority, job_function, employment_type, description, location | |
| profiles[] → current_role → company → name, domain, website, linkedin_slug, headline, industry, size_band, type, employee_count, employee_growth_12mo, founded, follower_count, specialties, naics_codes, sic_codes, locality, region, country_iso | |
| profiles[] → past_roles[] → title, is_current, start_date, end_date, months_in_role, seniority, job_function, employment_type, description, location, company{...} | |
| trimmed | |
| credits_warning | |

**Illustrative Example Response (synthetic, not a complete endpoint schema):**

```json
{
  "data": [
    {
      "total": "string",
      "total_relation": "string",
      "from": "string",
      "size": "string",
      "has_more": false,
      "trimmed": "string",
      "credits_warning": "string",
      "profiles": [
        {
          "past_roles[] → title": "string",
          "is_current": false,
          "start_date": "2025-06-01T12:00:00Z",
          "end_date": "2025-06-01T12:00:00Z",
          "months_in_role": "string",
          "seniority": "string",
          "job_function": "string",
          "employment_type": "string",
          "description": "string",
          "location": "string",
          "company{...}": "string"
        }
      ]
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 20,
    "total": 1,
    "has_more": false
  },
  "credits_used": 1
}
```

### POST /v1/linkedin/profile-search — Search LinkedIn Profiles

Search the enriched professional-profile index with the full filter set: identity, current role, tenure, past employers, company attributes, geography, skills, education and social metrics. Returns clean, normalized profiles keyed on the public LinkedIn URL — no internal identifiers or profile images. Costs 1 credit per profile returned. Use `count: true` to size a segment for free before spending credits.

**Example Request Body:**

```json
{
  "title": [
    "VP Sales",
    "Chief Revenue Officer"
  ],
  "seniority": [
    "Vice President (VP)",
    "Chief X Officer (CxO)"
  ],
  "industry": [
    "Computer Software"
  ],
  "country_iso": [
    "US"
  ],
  "min_employees": 100,
  "max_employees": 5000,
  "min_employee_growth_12mo": 1.1,
  "skills": [
    "Enterprise Sales"
  ],
  "max_months_in_role": 12,
  "sort_by": "recent_job_change",
  "size": 25,
  "from": 0
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/v1/linkedin/profile-search",
  "method": "POST",
  "body": {
    "title": [
      "VP Sales",
      "Chief Revenue Officer"
    ],
    "seniority": [
      "Vice President (VP)",
      "Chief X Officer (CxO)"
    ],
    "industry": [
      "Computer Software"
    ],
    "country_iso": [
      "US"
    ],
    "min_employees": 100,
    "max_employees": 5000,
    "min_employee_growth_12mo": 1.1,
    "skills": [
      "Enterprise Sales"
    ],
    "max_months_in_role": 12,
    "sort_by": "recent_job_change",
    "size": 25,
    "from": 0
  }
}'
```

### POST /v1/linkedin/profile-search — Count Matching Profiles

Size a segment without consuming credits.

**Example Request Body:**

```json
{
  "count": true,
  "title": "Head of Marketing",
  "country_iso": "US",
  "min_employees": 50
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/v1/linkedin/profile-search",
  "method": "POST",
  "body": {
    "count": true,
    "title": "Head of Marketing",
    "country_iso": "US",
    "min_employees": 50
  }
}'
```

### POST /v1/linkedin/profile-search — Lookup a Single Profile

Fetch one profile by LinkedIn URL. Costs 1 credit.

**Example Request Body:**

```json
{
  "linkedin_url": "https://www.linkedin.com/in/williamhgates/",
  "size": 1
}
```

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/v1/linkedin/profile-search",
  "method": "POST",
  "body": {
    "linkedin_url": "https://www.linkedin.com/in/williamhgates/",
    "size": 1
  }
}'
```

### GET /v1/linkedin/hot-leads — Get Agent Hot Leads

Retrieve the hot leads your Bytemine LinkedIn agent has captured and qualified, newest first. Filter by qualification tier, capturing user, or a `since` timestamp. Free — reads your own workspace's lead feed.

**Query Parameters:**

- `qualification`: Filter by qualification tier exactly as stored on the lead (as shown in the agent dashboard).
- `limit`: Page size. Default 50, max 200.
- `offset`: Pagination offset.
- `since`: Only leads created at or after this ISO timestamp.
- `user_id`: Only leads captured for this agent user.

**cURL Example:**

```bash
curl -X POST 'https://bvjmtgaxijpyasjtaqiv.supabase.co/functions/v1/api-gateway' \
  -H 'Content-Type: application/json' \
  -H 'x-amz-security-token: YOUR-API-KEY' \
  -d '{
  "path": "/v1/linkedin/hot-leads",
  "method": "GET"
}'
```

