---
title: "Lookalike Search Endpoint"
method: POST
path: "/search/lookalike"
tags: ["search"]
---

# Lookalike Search Endpoint

`POST /search/lookalike`

## Request

- Base URL: `https://api.dataforb2b.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dataforb2b.ai/search/lookalike`
- Auth: none declared

Find similar profiles using vector embedding similarity (pgvector).

**Authentication required:** Header `api_key: <your_api_key>`

**Pricing:** 0.25 credit per profile returned (DB data)

This endpoint uses OpenAI embeddings + pgvector cosine similarity to find
profiles that are semantically similar to a given LinkedIn profile.

**How it works:**
1. Takes a LinkedIn profile URL, public_id, or member_identity
2. If the profile has no embedding yet: scrapes it live, generates embedding, stores it
3. Queries pgvector for the most similar profiles by cosine distance
4. Returns profiles ranked by similarity score (1.0 = identical, 0.0 = unrelated)

**Use cases:**
- `sales`: Find similar prospects (matches on title, industry, company size, skills)
- `recruiter`: Find similar candidates (matches on skills, education, experience)

**Example request:**
```json
{
    "profile": "https://www.linkedin.com/in/johndoe",
    "use_case": "sales",
    "country": "US",
    "count": 25,
    "offset": 0
}
```

**Example response:**
```json
{
    "lookalike_profile": "https://www.linkedin.com/in/john-doe",
    "total": 847,
    "offset": 0,
    "count": 25,
    "has_next_page": true,
    "credits_used": 6.25,
    "method": "vector",
    "results": [
        {
            "similarity_score": 0.8234,
            "member_identity": "ACoAABxxxxxx",
            "headline": "Sales Director at BigCo",
            ...
        }
    ]
}
```

## Headers

- `api-key` string, nullable

## Request body

- LookalikeRequest: Request for vector-based lookalike search
  - `profile` string, nullable: LinkedIn profile URL, public_id, or member_identity
  - `company` string, nullable: LinkedIn company URL or universal_name to find similar companies
  - `country` string, nullable: ISO country code to filter results (e.g. 'US', 'FR')
  - `location` string, nullable: Location text filter (city, region, etc.) - matches on profile location or job location (e.g. 'Paris', 'San Francisco Bay Area')
  - `count` integer: Number of results to return
  - `offset` integer: Pagination offset

## Response `200`

Successful Response

- LookalikeResponse: Response for vector-based lookalike search
  - `lookalike_profile` string, required: LinkedIn URL of the profile used as lookalike source
  - `total` integer, required
  - `offset` integer, required
  - `count` integer, required
  - `has_next_page` boolean, required
  - `credits_used` number, required
  - `method` string: Search method used: 'vector' or 'llm_fallback'
  - `results` object[], required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dataforb2b/apis/dataforb2b-api.md) · [All operations](https://skmtc.dev/dataforb2b/apis/dataforb2b-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dataforb2b/apis/dataforb2b-api/revisions/24ea79caa1a1?raw)
