KosmoKrator

marketing

Brandfetch Lua API for KosmoKrator Agents

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

7 functions 7 read 0 write Bearer token auth

Lua Namespace

Agents call this integration through app.integrations.brandfetch.*. Use lua_read_doc("integrations.brandfetch") 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.

Brandfetch — Lua API Reference

get_brand

Look up a brand by its domain to retrieve logos, colors, fonts, and other brand assets.

Parameters

NameTypeRequiredDescription
domainstringyesThe brand domain (e.g., "spotify.com", "nike.com")

Example

local result = app.integrations.brandfetch.get_brand({
  domain = "spotify.com"
})

-- Access brand data
print(result.name)        -- "Spotify"
print(result.domain)      -- "spotify.com"

-- Logos
for _, logo in ipairs(result.logos or {}) do
  print(logo.url, logo.format, logo.theme)
end

-- Colors
for _, color in ipairs(result.colors or {}) do
  print(color.hex, color.type)
end

-- Fonts
for _, font in ipairs(result.fonts or {}) do
  print(font.name, font.weight)
end

search_brands

Search for brands by name or domain.

Parameters

NameTypeRequiredDescription
querystringyesSearch term — brand name or domain
limitintegernoMaximum number of results

Example

local result = app.integrations.brandfetch.search_brands({
  query = "Nike",
  limit = 5
})

for _, brand in ipairs(result.brands or result or {}) do
  print(brand.name, brand.domain, brand.brand_id)
end

list_logos

List all logo variants available for a brand.

Parameters

NameTypeRequiredDescription
brand_idstringyesThe brand identifier from a search or lookup
limitintegernoMaximum number of logos to return

Example

local result = app.integrations.brandfetch.list_logos({
  brand_id = "brand_abc123",
  limit = 10
})

for _, logo in ipairs(result.logos or result or {}) do
  print(logo.id, logo.url, logo.format, logo.theme)
end

Get a single logo by its ID.

Parameters

NameTypeRequiredDescription
idstringyesThe unique logo identifier

Example

local result = app.integrations.brandfetch.get_logo({
  id = "logo_xyz789"
})

print(result.url, result.format, result.width, result.height)

list_colors

List the official brand colors for a brand.

Parameters

NameTypeRequiredDescription
brand_idstringyesThe brand identifier from a search or lookup
limitintegernoMaximum number of colors to return

Example

local result = app.integrations.brandfetch.list_colors({
  brand_id = "brand_abc123"
})

for _, color in ipairs(result.colors or result or {}) do
  print(color.hex, color.type)  -- e.g., "#1DB954", "primary"
end

list_fonts

List fonts used by a brand.

Parameters

NameTypeRequiredDescription
brand_idstringyesThe brand identifier from a search or lookup
limitintegernoMaximum number of fonts to return

Example

local result = app.integrations.brandfetch.list_fonts({
  brand_id = "brand_abc123"
})

for _, font in ipairs(result.fonts or result or {}) do
  print(font.name, font.weight, font.type)  -- e.g., "Circular", "700", "heading"
end

get_current_user

Get the authenticated user’s Brandfetch account details.

Parameters

None.

Example

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

print(result.name, result.email)
print(result.plan)

Multi-Account Usage

If you have multiple Brandfetch accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.brandfetch.function_name({...})

-- Explicit default (portable across setups)
app.integrations.brandfetch.default.function_name({...})

-- Named accounts
app.integrations.brandfetch.work.function_name({...})
app.integrations.brandfetch.client.function_name({...})

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

Raw agent markdown
# Brandfetch — Lua API Reference

## get_brand

Look up a brand by its domain to retrieve logos, colors, fonts, and other brand assets.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `domain` | string | yes | The brand domain (e.g., `"spotify.com"`, `"nike.com"`) |

### Example

```lua
local result = app.integrations.brandfetch.get_brand({
  domain = "spotify.com"
})

-- Access brand data
print(result.name)        -- "Spotify"
print(result.domain)      -- "spotify.com"

-- Logos
for _, logo in ipairs(result.logos or {}) do
  print(logo.url, logo.format, logo.theme)
end

-- Colors
for _, color in ipairs(result.colors or {}) do
  print(color.hex, color.type)
end

-- Fonts
for _, font in ipairs(result.fonts or {}) do
  print(font.name, font.weight)
end
```

---

## search_brands

Search for brands by name or domain.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `query` | string | yes | Search term — brand name or domain |
| `limit` | integer | no | Maximum number of results |

### Example

```lua
local result = app.integrations.brandfetch.search_brands({
  query = "Nike",
  limit = 5
})

for _, brand in ipairs(result.brands or result or {}) do
  print(brand.name, brand.domain, brand.brand_id)
end
```

---

## list_logos

List all logo variants available for a brand.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `brand_id` | string | yes | The brand identifier from a search or lookup |
| `limit` | integer | no | Maximum number of logos to return |

### Example

```lua
local result = app.integrations.brandfetch.list_logos({
  brand_id = "brand_abc123",
  limit = 10
})

for _, logo in ipairs(result.logos or result or {}) do
  print(logo.id, logo.url, logo.format, logo.theme)
end
```

---

## get_logo

Get a single logo by its ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique logo identifier |

### Example

```lua
local result = app.integrations.brandfetch.get_logo({
  id = "logo_xyz789"
})

print(result.url, result.format, result.width, result.height)
```

---

## list_colors

List the official brand colors for a brand.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `brand_id` | string | yes | The brand identifier from a search or lookup |
| `limit` | integer | no | Maximum number of colors to return |

### Example

```lua
local result = app.integrations.brandfetch.list_colors({
  brand_id = "brand_abc123"
})

for _, color in ipairs(result.colors or result or {}) do
  print(color.hex, color.type)  -- e.g., "#1DB954", "primary"
end
```

---

## list_fonts

List fonts used by a brand.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `brand_id` | string | yes | The brand identifier from a search or lookup |
| `limit` | integer | no | Maximum number of fonts to return |

### Example

```lua
local result = app.integrations.brandfetch.list_fonts({
  brand_id = "brand_abc123"
})

for _, font in ipairs(result.fonts or result or {}) do
  print(font.name, font.weight, font.type)  -- e.g., "Circular", "700", "heading"
end
```

---

## get_current_user

Get the authenticated user's Brandfetch account details.

### Parameters

None.

### Example

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

print(result.name, result.email)
print(result.plan)
```

---

## Multi-Account Usage

If you have multiple Brandfetch accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.brandfetch.function_name({...})

-- Explicit default (portable across setups)
app.integrations.brandfetch.default.function_name({...})

-- Named accounts
app.integrations.brandfetch.work.function_name({...})
app.integrations.brandfetch.client.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.brandfetch.brandfetch_get_brand({
  domain = "example_domain"
})
print(result)

Functions

brandfetch_get_brand

Look up a brand by its domain (e.g., "spotify.com") to retrieve logos, colors, fonts, and other brand assets. Returns the complete brand profile with all available assets.

Operation
Read read
Full name
brandfetch.brandfetch_get_brand
ParameterTypeRequiredDescription
domain string yes The brand domain to look up (e.g., "spotify.com", "nike.com").

brandfetch_search_brands

Search for brands by name or domain. Returns a list of matching brands with basic info. Use the brand ID from results to fetch detailed assets like logos, colors, and fonts.

Operation
Read read
Full name
brandfetch.brandfetch_search_brands
ParameterTypeRequiredDescription
query string yes Search term — brand name or domain (e.g., "Nike", "spotify.com").
limit integer no Maximum number of results to return.

brandfetch_list_logos

List all logo variants available for a brand. Returns logos in different formats (SVG, PNG), sizes, and themes (light, dark, icon).

Operation
Read read
Full name
brandfetch.brandfetch_list_logos
ParameterTypeRequiredDescription
brand_id string yes The brand identifier obtained from a brand search or lookup.
limit integer no Maximum number of logos to return.

brandfetch_list_colors

List the official brand colors (hex values) for a brand. Returns color types such as primary, secondary, accent, dark, and light.

Operation
Read read
Full name
brandfetch.brandfetch_list_colors
ParameterTypeRequiredDescription
brand_id string yes The brand identifier obtained from a brand search or lookup.
limit integer no Maximum number of colors to return.

brandfetch_list_fonts

List the fonts used by a brand. Returns font families, weights, and usage context (heading, body, etc.).

Operation
Read read
Full name
brandfetch.brandfetch_list_fonts
ParameterTypeRequiredDescription
brand_id string yes The brand identifier obtained from a brand search or lookup.
limit integer no Maximum number of fonts to return.

brandfetch_get_current_user

Get the authenticated user's Brandfetch account details, including name, email, plan, and usage information.

Operation
Read read
Full name
brandfetch.brandfetch_get_current_user
ParameterTypeRequiredDescription
No parameters.