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

# REST API Quickstart

> Make your first Databar API call in under 5 minutes.

## 1. Get your API key

Log in to your [Databar workspace](https://databar.ai) and navigate to **Integrations** to find your API key.

<Info>
  API access requires an active paid subscription. Free plans do not include API access.
</Info>

## 2. Verify your key

Test that your API key works by fetching your account info:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.databar.ai/v1/user/me \
    -H "x-apikey: YOUR_API_KEY"
  ```

  ```python Python SDK theme={null}
  from databar import DatabarClient

  client = DatabarClient(api_key="YOUR_API_KEY")
  user = client.get_user()
  print(f"{user.first_name} - {user.balance} credits")
  ```

  ```bash CLI theme={null}
  databar login --api-key YOUR_API_KEY
  databar whoami
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.databar.ai/v1/user/me", {
    headers: { "x-apikey": "YOUR_API_KEY" }
  });
  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

You should receive a response like:

```json theme={null}
{
  "first_name": "David",
  "email": "david@databar.ai",
  "balance": 100.0,
  "plan": "Pro"
}
```

## 3. Search for an enrichment

Find available enrichments by searching with a keyword:

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.databar.ai/v1/enrichments/?q=email" \
    -H "x-apikey: YOUR_API_KEY"
  ```

  ```python Python SDK theme={null}
  enrichments = client.list_enrichments(q="email")
  for e in enrichments:
      print(f"[{e.id}] {e.name} - {e.price} credits")
  ```

  ```bash CLI theme={null}
  databar enrich list --query "email"
  ```
</CodeGroup>

## 4. Run an enrichment

Once you have an enrichment ID, run it with the required parameters:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.databar.ai/v1/enrichments/123/run" \
    -H "x-apikey: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"params": {"email": "test@example.com"}}'
  ```

  ```python Python SDK theme={null}
  result = client.run_enrichment_sync(123, {"email": "test@example.com"})
  print(result)
  ```

  ```bash CLI theme={null}
  databar enrich run 123 --params '{"email": "test@example.com"}'
  ```
</CodeGroup>

## 5. Run in bulk

For batch processing, use the bulk endpoint:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.databar.ai/v1/enrichments/123/bulk-run" \
    -H "x-apikey: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"params": [{"email": "a@example.com"}, {"email": "b@example.com"}]}'
  ```

  ```python Python SDK theme={null}
  results = client.run_enrichment_bulk_sync(123, [
      {"email": "a@example.com"},
      {"email": "b@example.com"},
  ])
  print(results)
  ```

  ```bash CLI theme={null}
  databar enrich bulk 123 --input leads.csv --format csv --out results.csv
  ```
</CodeGroup>

Bulk operations return a `task_id`. Check progress with:

```bash theme={null}
curl "https://api.databar.ai/v1/tasks/YOUR_TASK_ID" \
  -H "x-apikey: YOUR_API_KEY"
```

<Warning>
  Task data is stored for **24 hours** after completion. Make sure to retrieve your results before they expire.
</Warning>

## Next steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Explore all endpoints with request and response examples.
  </Card>

  <Card title="Python SDK" icon="python" href="/python-sdk">
    Full SDK reference with enrichments, waterfalls, tables, and error handling.
  </Card>

  <Card title="Enrich leads" icon="magnifying-glass" href="/guides/enrich-leads">
    Walkthrough: enrich a list of leads with company and contact data.
  </Card>

  <Card title="Waterfall email finder" icon="water" href="/guides/waterfall-email-finder">
    Walkthrough: find emails using multiple providers with automatic fallback.
  </Card>
</CardGroup>
