> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peoplecontext.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Start using People Context API in under 5 minutes

## Setup Your Environment

<AccordionGroup>
  <Accordion icon="key" title="Get Your API Key">
    Contact [justin@peoplecontext.com](mailto:justin@peoplecontext.com) to obtain your API key. Keep your key secure - never commit it to version control.
  </Accordion>

  <Accordion icon="terminal" title="Install Dependencies">
    <CodeGroup>
      ```bash Python theme={null}
      pip install requests
      ```

      ```bash Node.js theme={null}
      npm install axios
      ```

      ```bash cURL theme={null}
      # No installation needed
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## Make Your First Request

Let's enrich a GitHub user's profile:

<CodeGroup>
  ```python Python theme={null}
  import requests

  API_KEY = "your_api_key_here"
  BASE_URL = "https://api.peoplecontext.com"

  headers = {
      "Authorization": f"Bearer {API_KEY}",
      "Content-Type": "application/json"
  }

  # Enrich by GitHub username
  payload = {
      "github": "torvalds",
      "websets": ["github"]
  }

  response = requests.post(
      f"{BASE_URL}/v1/person/enrich",
      headers=headers,
      json=payload
  )

  data = response.json()
  person = data.get("person", {})
  github = person.get("github", {})

  if github:
      print(f"Name: {github.get('full_name')}")
      print(f"Username: {github.get('github_username')}")
      print(f"Emails: {github.get('emails')}")
      print(f"Followers: {github.get('followers')}")
  else:
      print("No match found")
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const API_KEY = 'your_api_key_here';
  const BASE_URL = 'https://api.peoplecontext.com';

  const headers = {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  };

  // Enrich by GitHub username
  async function enrichGithubUser(username) {
    try {
      const response = await axios.post(
        `${BASE_URL}/v1/person/enrich`,
        {
          github: username,
          websets: ['github']
        },
        { headers }
      );

      const { person } = response.data;
      const github = person?.github;

      if (github) {
        console.log(`Name: ${github.full_name}`);
        console.log(`Username: ${github.github_username}`);
        console.log(`Emails: ${github.emails}`);
        console.log(`Followers: ${github.followers}`);
      } else {
        console.log('No match found');
      }
    } catch (error) {
      console.error('Error:', error.message);
    }
  }

  enrichGithubUser('torvalds');
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.peoplecontext.com/v1/person/enrich" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{"github": "torvalds", "websets": ["github"]}'
  ```
</CodeGroup>

## Understanding the Response

A successful match returns the profile data within the `person` object:

```json theme={null}
{
  "person": {
    "github": {
      "github_username": "torvalds",
      "full_name": "Linus Torvalds",
      "names": ["Linus Torvalds"],
      "emails": ["torvalds@example.com"],
      "bio": "Creator of Linux and Git",
      "location": "Portland, OR",
      "company": "@linuxfoundation",
      "followers": 180000,
      "following": 0,
      "public_repos": 6,
      "repos": [...]
    }
  },
  "websets_matched": ["github"]
}
```

If no match is found:

```json theme={null}
{
  "person": {},
  "websets_matched": []
}
```

## Enrich with LinkedIn Data

Access professional profiles with the LinkedIn webset:

<CodeGroup>
  ```python Python theme={null}
  # Enrich by LinkedIn username
  payload = {
      "linkedin_username": "williamhgates",
      "websets": ["linkedin"]
  }

  response = requests.post(
      f"{BASE_URL}/v1/person/enrich",
      headers=headers,
      json=payload
  )

  data = response.json()
  if "linkedin" in data["person"]:
      linkedin = data["person"]["linkedin"]
      profile = linkedin.get("profile", {})
      print(f"Name: {profile.get('full_name')}")
      print(f"Headline: {profile.get('headline')}")
      print(f"Location: {profile.get('location')}")
  ```

  ```javascript Node.js theme={null}
  // Enrich by LinkedIn username
  const payload = {
    linkedin_username: 'williamhgates',
    websets: ['linkedin']
  };

  const response = await axios.post(
    `${BASE_URL}/v1/person/enrich`,
    payload,
    { headers }
  );

  const linkedin = response.data.person?.linkedin;
  if (linkedin) {
    console.log(`Name: ${linkedin.profile.full_name}`);
    console.log(`Headline: ${linkedin.profile.headline}`);
  }
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.peoplecontext.com/v1/person/enrich" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{"linkedin_username": "williamhgates", "websets": ["linkedin"]}'
  ```
</CodeGroup>

## Enrich Company Data

Get comprehensive company information:

<CodeGroup>
  ```python Python theme={null}
  # Enrich by LinkedIn company slug
  response = requests.post(
      f"{BASE_URL}/v1/company/enrich",
      headers=headers,
      json={"linkedin_slug": "openai"}
  )

  data = response.json()
  if data["matched"]:
      company = data["company"]
      profile = company["profile"]
      print(f"Name: {profile['name']}")
      print(f"Industry: {profile['industry']}")
      print(f"Employees: {profile['employees']}")
      print(f"Location: {company['headquarters']['city']}")
  ```

  ```javascript Node.js theme={null}
  // Enrich by LinkedIn company slug
  const response = await axios.post(
    `${BASE_URL}/v1/company/enrich`,
    { linkedin_slug: 'openai' },
    { headers }
  );

  if (response.data.matched) {
    const company = response.data.company;
    console.log(`Name: ${company.profile.name}`);
    console.log(`Employees: ${company.profile.employees}`);
  }
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.peoplecontext.com/v1/company/enrich" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{"linkedin_slug": "openai"}'
  ```
</CodeGroup>

## Search by Email

You can also enrich profiles by email address across multiple websets:

<CodeGroup>
  ```python Python theme={null}
  payload = {
      "email": "user@example.com",
      "websets": ["github", "linkedin"]
  }

  response = requests.post(
      f"{BASE_URL}/v1/person/enrich",
      headers=headers,
      json=payload
  )

  # Finds GitHub and LinkedIn profiles associated with this email
  ```

  ```javascript Node.js theme={null}
  const payload = {
    email: 'user@example.com',
    websets: ['github', 'linkedin']
  };

  // Finds GitHub and LinkedIn profiles associated with this email
  const response = await axios.post(
    `${BASE_URL}/v1/person/enrich`,
    payload,
    { headers }
  );
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.peoplecontext.com/v1/person/enrich" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{"email": "user@example.com", "websets": ["github", "linkedin"]}'
  ```
</CodeGroup>

<Note>
  You can provide multiple identifiers and websets. The API will try specific identifiers first, then fall back to email search across all requested websets if needed.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="GitHub Webset Guide" icon="github" href="/guides/github-webset">
    Learn about all GitHub API features and parameters
  </Card>

  <Card title="LinkedIn Webset Guide" icon="linkedin" href="/guides/linkedin-webset">
    Access 58M professional profiles and company data
  </Card>

  <Card title="Person Enrichment API" icon="user" href="/api-reference/person/enrich">
    Complete API documentation for person enrichment
  </Card>

  <Card title="Company Enrichment API" icon="building" href="/api-reference/company/enrich">
    Complete API documentation for company enrichment
  </Card>
</CardGroup>
