# Finding a profile by email

To find the LinkedIn profile of the person behind an email address, start a workflow with st.findPersonByEmail, and open the profile in the same workflow if you need its data.

> The API Reference is also the SDK and CLI reference. Consecutive code fences marked `tab=HTTP`, `tab=Node`, `tab=Python` and `tab=CLI` are the same call on each surface (a fence marked `tab=HTTP,CLI` is the same text for both), and a block between `:::surface <names>` and `:::` applies only to the surfaces it names. Identifiers in the text are written as in Node and in HTTP JSON (camelCase); the Python SDK spells methods, parameters and result attributes in snake_case (`sendMessage` → `send_message`, `reconnectionLink` → `reconnection_link`), while names inside HTTP JSON stay camelCase.

To find the LinkedIn profile of the person behind an email address, start a workflow with [`st.findPersonByEmail`](/docs/action-st-find-person-by-email). It returns the profile URL. To get the person's data in the same workflow, add [`st.openPersonPage`](/docs/action-st-open-person-page) as its child: it runs only when a profile is found.

:::surface node
Each example below has its Node SDK call in the Node tab, and the label over each completion says what that call returns.
:::

:::surface python
Each example below has its Python SDK call in the Python tab, and the label over each completion says what that call returns.
:::

:::surface cli
Each example below has its CLI command in the CLI tab, and the label over each completion says what the command prints.
:::

The lookup uses **10 [enrichment credits](/docs/enrichment-credits)** when it finds a profile. A lookup that finds nothing is free. Professional addresses work best; personal ones (such as gmail.com) are accepted but rarely found.

## Finding the profile URL

**Workflow:**

```json tab=HTTP
{
  "actionType": "st.findPersonByEmail",
  "email": "jane.doe@acme.com"
}
```

```typescript tab=Node
const workflow = await linkedapi.findPersonByEmail.execute({
  email: "jane.doe@acme.com"
});

const { data, errors } = await linkedapi.findPersonByEmail.result(workflow.workflowId);
```

```python tab=Python
from linkedapi import FindPersonByEmailParams

workflow = linkedapi.find_person_by_email.execute(
    FindPersonByEmailParams(email="jane.doe@acme.com")
)

result = linkedapi.find_person_by_email.result(workflow.workflow_id)
```

```bash tab=CLI
linkedin person find-by-email jane.doe@acme.com --json
```

:::surface http
**Completion:**
:::

:::surface node,python
**Completion** – `result()` returns its `data` in `data`:
:::

:::surface cli
**Completion** – with `--json` the CLI prints its `data` as `data`:
:::

```json
{
  "actionType": "st.findPersonByEmail",
  "success": true,
  "data": {
    "personUrl": "https://www.linkedin.com/in/jane-doe",
    "providerStatus": "found"
  }
}
```

When no profile is known for the address, `personUrl` is `null` and `providerStatus` is `notFound`, and no credits are used.

:::surface python
In Python, the method's result has these as snake_case attributes: `result.data.person_url` and `result.data.provider_status`. In the workflow below, which goes through `custom_workflow`, the keys stay as in the JSON.
:::

## Opening the found profile

Add `st.openPersonPage` without a `personUrl`: it gets the found profile. Its own children work as usual. For example, [`st.retrievePersonExperience`](/docs/action-st-retrieve-person-experience) reads the person's career, and [`st.findPersonEmail`](/docs/action-st-find-person-email) finds their other addresses.

**Workflow:**

```json tab=HTTP
{
  "actionType": "st.findPersonByEmail",
  "email": "jane.doe@acme.com",
  "then": {
    "actionType": "st.openPersonPage",
    "basicInfo": true,
    "then": {
      "actionType": "st.retrievePersonExperience"
    }
  }
}
```

```typescript tab=Node
const workflow = await linkedapi.customWorkflow.execute({
  actionType: "st.findPersonByEmail",
  email: "jane.doe@acme.com",
  then: {
    actionType: "st.openPersonPage",
    basicInfo: true,
    then: {
      actionType: "st.retrievePersonExperience"
    }
  }
});

const { data, errors } = await linkedapi.customWorkflow.result(workflow.workflowId);
```

```python tab=Python
workflow = linkedapi.custom_workflow.execute(
    {
        "actionType": "st.findPersonByEmail",
        "email": "jane.doe@acme.com",
        "then": {
            "actionType": "st.openPersonPage",
            "basicInfo": True,
            "then": {
                "actionType": "st.retrievePersonExperience",
            },
        },
    }
)

result = linkedapi.custom_workflow.result(workflow.workflow_id)
```

```bash tab=CLI
linkedin workflow run <<'EOF'
{
  "actionType": "st.findPersonByEmail",
  "email": "jane.doe@acme.com",
  "then": {
    "actionType": "st.openPersonPage",
    "basicInfo": true,
    "then": {
      "actionType": "st.retrievePersonExperience"
    }
  }
}
EOF
```

:::surface http
**Completion:**
:::

:::surface node,python
**Completion** – `result()` returns this whole completion in `data`:
:::

:::surface cli
**Completion** – `linkedin workflow run` prints this whole completion as `data`:
:::

```json
{
  "actionType": "st.findPersonByEmail",
  "success": true,
  "data": {
    "personUrl": "https://www.linkedin.com/in/jane-doe",
    "providerStatus": "found",
    "then": {
      "actionType": "st.openPersonPage",
      "success": true,
      "data": {
        "name": "Jane Doe",
        "publicUrl": "https://www.linkedin.com/in/jane-doe",
        "position": "Head of Sales",
        "companyName": "Acme",
        ...
        "then": {
          "actionType": "st.retrievePersonExperience",
          "success": true,
          "data": [ ... ]
        }
      }
    }
  }
}
```

## Good to know

- The lookup itself opens no LinkedIn page and counts against no account limit. The `st.openPersonPage` child counts as one `stPersonProfileViews` for the found profile. See [Limits](/docs/admin-limits).
- If the child fails with an error of its own, it reports the error in `then`, and `personUrl` is still returned and paid for. If the account fails as a whole – it is signed out, or its interface language is not supported – the whole workflow fails and the lookup's credits are given back.
- With fewer than 10 credits, the workflow is rejected with `insufficientEnrichmentCredits` before it starts.

> 💡 To find a person's email from their LinkedIn profile, see [Finding a person's email](/docs/finding-person-email).

> This page provides examples of [workflows](/docs/building-workflows) and their [completions](/docs/executing-workflows). For detailed documentation on constraints, parameters, and possible results of specific actions, always refer to the corresponding [action documentation pages](/docs/actions-overview).
