KosmoKrator

sales

Hunter Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Hunter KosmoKrator integration.

8 functions 7 read 1 write API key auth

Lua Namespace

Agents call this integration through app.integrations.hunter.*. Use lua_read_doc("integrations.hunter") inside KosmoKrator to discover the same reference at runtime.

Agent-Facing Lua Docs

This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.

Hunter.io — Lua API Reference

Search for professional email addresses associated with a domain.

Parameters

NameTypeRequiredDescription
domainstringyesThe domain to search (e.g., "example.com")
limitintegernoMaximum number of results (default: 10, max: 100)
offsetintegernoNumber of results to skip for pagination
typestringnoFilter by email type: "personal" or "generic"

Example

local result = app.integrations.hunter.domain_search({
  domain = "example.com",
  limit = 20
})

for _, email in ipairs(result.data.emails) do
  print(email.value .. " - " .. (email.first_name or "") .. " " .. (email.last_name or ""))
end

email_finder

Find the most likely email address for a person based on their name and company domain.

Parameters

NameTypeRequiredDescription
domainstringyesThe company domain (e.g., "example.com")
first_namestringnoThe person’s first name
last_namestringnoThe person’s last name

Example

local result = app.integrations.hunter.email_finder({
  domain = "example.com",
  first_name = "John",
  last_name = "Doe"
})

print("Email: " .. result.data.email)
print("Confidence: " .. result.data.score .. "%")

email_verifier

Verify the deliverability of an email address.

Parameters

NameTypeRequiredDescription
emailstringyesThe email address to verify

Example

local result = app.integrations.hunter.email_verifier({
  email = "[email protected]"
})

print("Result: " .. result.data.result) -- deliverable, undeliverable, risky, unknown
print("Confidence: " .. result.data.score .. "%")

email_count

Get the number of email addresses found for a domain. This endpoint does not consume API credits.

Parameters

NameTypeRequiredDescription
domainstringyesThe domain to count emails for

Example

local result = app.integrations.hunter.email_count({
  domain = "example.com"
})

print("Total emails: " .. result.data.total)
print("Personal: " .. result.data.personal)
print("Generic: " .. result.data.generic)

list_leads

List leads stored in your Hunter.io account.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of leads to return (default: 20, max: 100)
offsetintegernoNumber of leads to skip for pagination

Example

local result = app.integrations.hunter.list_leads({
  limit = 50,
  offset = 0
})

for _, lead in ipairs(result.data.leads) do
  print(lead.id .. ": " .. lead.email .. " - " .. (lead.first_name or "") .. " " .. (lead.last_name or ""))
end

get_lead

Retrieve a single lead by its ID.

Parameters

NameTypeRequiredDescription
idintegeryesThe lead ID

Example

local result = app.integrations.hunter.get_lead({
  id = 12345
})

print("Email: " .. result.data.email)
print("Name: " .. (result.data.first_name or "") .. " " .. (result.data.last_name or ""))

create_lead

Create a new lead in Hunter.io.

Parameters

NameTypeRequiredDescription
emailstringyesThe lead’s email address
first_namestringnoThe lead’s first name
last_namestringnoThe lead’s last name
list_idintegernoID of the lead list to add this lead to

Example

local result = app.integrations.hunter.create_lead({
  email = "[email protected]",
  first_name = "John",
  last_name = "Doe",
  list_id = 42
})

print("Created lead: " .. result.data.id)

get_current_user

Get account information and API usage for the authenticated Hunter.io user.

Parameters

None.

Example

local result = app.integrations.hunter.get_current_user({})

print("Account: " .. result.data.email)
print("Plan: " .. result.data.plan_name)
print("Requests used: " .. result.data.usage.requests.used .. " / " .. result.data.usage.requests.limit)

Multi-Account Usage

If you have multiple Hunter.io accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.hunter.domain_search({domain = "example.com"})

-- Explicit default (portable across setups)
app.integrations.hunter.default.domain_search({domain = "example.com"})

-- Named accounts
app.integrations.hunter.work.domain_search({domain = "example.com"})
app.integrations.hunter.personal.domain_search({domain = "example.com"})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Hunter.io — Lua API Reference

## domain_search

Search for professional email addresses associated with a domain.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `domain` | string | yes | The domain to search (e.g., `"example.com"`) |
| `limit` | integer | no | Maximum number of results (default: 10, max: 100) |
| `offset` | integer | no | Number of results to skip for pagination |
| `type` | string | no | Filter by email type: `"personal"` or `"generic"` |

### Example

```lua
local result = app.integrations.hunter.domain_search({
  domain = "example.com",
  limit = 20
})

for _, email in ipairs(result.data.emails) do
  print(email.value .. " - " .. (email.first_name or "") .. " " .. (email.last_name or ""))
end
```

---

## email_finder

Find the most likely email address for a person based on their name and company domain.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `domain` | string | yes | The company domain (e.g., `"example.com"`) |
| `first_name` | string | no | The person's first name |
| `last_name` | string | no | The person's last name |

### Example

```lua
local result = app.integrations.hunter.email_finder({
  domain = "example.com",
  first_name = "John",
  last_name = "Doe"
})

print("Email: " .. result.data.email)
print("Confidence: " .. result.data.score .. "%")
```

---

## email_verifier

Verify the deliverability of an email address.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `email` | string | yes | The email address to verify |

### Example

```lua
local result = app.integrations.hunter.email_verifier({
  email = "[email protected]"
})

print("Result: " .. result.data.result) -- deliverable, undeliverable, risky, unknown
print("Confidence: " .. result.data.score .. "%")
```

---

## email_count

Get the number of email addresses found for a domain. This endpoint does not consume API credits.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `domain` | string | yes | The domain to count emails for |

### Example

```lua
local result = app.integrations.hunter.email_count({
  domain = "example.com"
})

print("Total emails: " .. result.data.total)
print("Personal: " .. result.data.personal)
print("Generic: " .. result.data.generic)
```

---

## list_leads

List leads stored in your Hunter.io account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of leads to return (default: 20, max: 100) |
| `offset` | integer | no | Number of leads to skip for pagination |

### Example

```lua
local result = app.integrations.hunter.list_leads({
  limit = 50,
  offset = 0
})

for _, lead in ipairs(result.data.leads) do
  print(lead.id .. ": " .. lead.email .. " - " .. (lead.first_name or "") .. " " .. (lead.last_name or ""))
end
```

---

## get_lead

Retrieve a single lead by its ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The lead ID |

### Example

```lua
local result = app.integrations.hunter.get_lead({
  id = 12345
})

print("Email: " .. result.data.email)
print("Name: " .. (result.data.first_name or "") .. " " .. (result.data.last_name or ""))
```

---

## create_lead

Create a new lead in Hunter.io.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `email` | string | yes | The lead's email address |
| `first_name` | string | no | The lead's first name |
| `last_name` | string | no | The lead's last name |
| `list_id` | integer | no | ID of the lead list to add this lead to |

### Example

```lua
local result = app.integrations.hunter.create_lead({
  email = "[email protected]",
  first_name = "John",
  last_name = "Doe",
  list_id = 42
})

print("Created lead: " .. result.data.id)
```

---

## get_current_user

Get account information and API usage for the authenticated Hunter.io user.

### Parameters

None.

### Example

```lua
local result = app.integrations.hunter.get_current_user({})

print("Account: " .. result.data.email)
print("Plan: " .. result.data.plan_name)
print("Requests used: " .. result.data.usage.requests.used .. " / " .. result.data.usage.requests.limit)
```

---

## Multi-Account Usage

If you have multiple Hunter.io accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.hunter.domain_search({domain = "example.com"})

-- Explicit default (portable across setups)
app.integrations.hunter.default.domain_search({domain = "example.com"})

-- Named accounts
app.integrations.hunter.work.domain_search({domain = "example.com"})
app.integrations.hunter.personal.domain_search({domain = "example.com"})
```

All functions are identical across accounts — only the credentials differ.

Metadata-Derived Lua Example

local result = app.integrations.hunter.hunter_domain_search({
  domain = "example_domain",
  limit = 1,
  offset = 1,
  type = "example_type"
})
print(result)

Functions

hunter_email_finder

Find the most likely professional email address for a person based on their name and company domain. Returns the email with a confidence score and sources where the email was found.

Operation
Read read
Full name
hunter.hunter_email_finder
ParameterTypeRequiredDescription
domain string yes The company domain (e.g., "example.com").
first_name string no The person's first name.
last_name string no The person's last name.

hunter_email_verifier

Verify the deliverability of an email address. Checks whether the email is valid, the mailbox exists, and accepts mail. Returns a result status (deliverable, undeliverable, risky, or unknown) along with confidence scores and SMTP details.

Operation
Read read
Full name
hunter.hunter_email_verifier
ParameterTypeRequiredDescription
email string yes The email address to verify.

hunter_email_count

Get the total number of email addresses Hunter.io has found for a domain. Returns counts broken down by email type (personal, generic) and department. This endpoint does not consume API credits.

Operation
Read read
Full name
hunter.hunter_email_count
ParameterTypeRequiredDescription
domain string yes The domain to count emails for (e.g., "example.com").

hunter_list_leads

List leads stored in your Hunter.io account. Supports pagination with limit and offset parameters. Returns lead details including email, name, and associated lists.

Operation
Read read
Full name
hunter.hunter_list_leads
ParameterTypeRequiredDescription
limit integer no Maximum number of leads to return (default: 20, max: 100).
offset integer no Number of leads to skip for pagination.

hunter_get_lead

Retrieve detailed information about a single lead by its ID. Returns the lead's email address, name, company, and any associated lists or custom fields.

Operation
Read read
Full name
hunter.hunter_get_lead
ParameterTypeRequiredDescription
id integer yes The lead ID.

hunter_create_lead

Create a new lead in Hunter.io. Requires an email address. Optionally include first name, last name, and a list ID to add the lead to a specific lead list. Returns the created lead object with its ID.

Operation
Write write
Full name
hunter.hunter_create_lead
ParameterTypeRequiredDescription
email string yes The lead's email address.
first_name string no The lead's first name.
last_name string no The lead's last name.
list_id integer no ID of the lead list to add this lead to.

hunter_get_current_user

Get information about the authenticated Hunter.io account, including the user's name, email, plan details, and API usage (requests made and remaining). Useful for verifying the API key works and checking usage limits.

Operation
Read read
Full name
hunter.hunter_get_current_user
ParameterTypeRequiredDescription
No parameters.