clearbit

package
v0.4.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClearbitCategory

type ClearbitCategory struct {
	Sector        string `json:"sector"`
	IndustryGroup string `json:"industryGroup"`
	Industry      string `json:"industry"`
	SubIndustry   string `json:"subIndustry"`
}

ClearbitCategory contains industry classification

type ClearbitCompany

type ClearbitCompany struct {
	// Name is the company name
	Name string `json:"name"`

	// LegalName is the legal name of the company
	LegalName string `json:"legalName"`

	// Domain is the company's primary domain
	Domain string `json:"domain"`

	// Site contains the company's website information
	Site *ClearbitSite `json:"site,omitempty"`

	// Category contains industry classification
	Category *ClearbitCategory `json:"category,omitempty"`

	// Metrics contains company size and other metrics
	Metrics *ClearbitMetrics `json:"metrics,omitempty"`

	// Description is a description of the company
	Description string `json:"description"`
}

ClearbitCompany represents the company data structure returned by Clearbit API

type ClearbitCompanySuggestion added in v0.4.1

type ClearbitCompanySuggestion struct {
	// Name is the company name
	Name string `json:"name"`

	// Domain is the company's primary domain
	Domain string `json:"domain"`

	Logo *string `json:"logo"`
}

ClearbitCompanySuggestion represents a company suggestion from the autocomplete API

type ClearbitError

type ClearbitError struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

ClearbitError represents error details

type ClearbitErrorResponse

type ClearbitErrorResponse struct {
	Error *ClearbitError `json:"error,omitempty"`
}

ClearbitErrorResponse represents an error response from Clearbit API

type ClearbitMetrics

type ClearbitMetrics struct {
	Employees      *int   `json:"employees,omitempty"`
	EmployeesRange string `json:"employeesRange"`
}

ClearbitMetrics contains company metrics

type ClearbitSite

type ClearbitSite struct {
	URL string `json:"url"`
}

ClearbitSite contains website information

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a Clearbit API client

func NewClient

func NewClient(config Config) *Client

NewClient creates a new Clearbit API client

func (*Client) FindCompanyByDomain

func (c *Client) FindCompanyByDomain(ctx context.Context, domain string) (*ClearbitCompany, error)

FindCompanyByDomain searches for a company by domain using Clearbit's Company API

func (*Client) FindCompanyByName

func (c *Client) FindCompanyByName(ctx context.Context, name string) (*ClearbitCompany, error)

FindCompanyByName searches for a company by name using Clearbit's Company API

func (*Client) IsReady

func (c *Client) IsReady(ctx context.Context) error

IsReady checks if the Clearbit API is reachable

func (*Client) SuggestCompanies added in v0.4.1

func (c *Client) SuggestCompanies(ctx context.Context, query string) ([]ClearbitCompanySuggestion, error)

SuggestCompanies searches for company suggestions using Clearbit's Autocomplete API

type Config

type Config struct {
	// APIKey is the Clearbit API key for authentication
	APIKey string

	// BaseURL is the base URL for Clearbit Company API (default: https://company.clearbit.com)
	BaseURL string

	// AutocompleteBaseURL is the base URL for Clearbit Autocomplete API (default: https://autocomplete.clearbit.com)
	AutocompleteBaseURL string

	// Timeout is the HTTP client timeout for API requests
	Timeout time.Duration

	// MaxRetries is the maximum number of retry attempts for failed requests
	MaxRetries int

	// RetryDelay is the delay between retry attempts
	RetryDelay time.Duration
}

Config holds the configuration for Clearbit API client

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible defaults

func NewConfig

func NewConfig(apiKey, baseURL, autocompleteBaseURL, timeout string, maxRetries int, retryDelay string) (Config, error)

NewConfig creates a new Clearbit configuration with the provided parameters

type OrganizationSearcher

type OrganizationSearcher struct {
	// contains filtered or unexported fields
}

OrganizationSearcher implements the port.OrganizationSearcher interface using Clearbit API

func NewOrganizationSearcher

func NewOrganizationSearcher(ctx context.Context, config Config) (*OrganizationSearcher, error)

NewOrganizationSearcher creates a new Clearbit-based organization searcher

func (*OrganizationSearcher) IsReady

func (s *OrganizationSearcher) IsReady(ctx context.Context) error

IsReady checks if the Clearbit API is ready to serve requests

func (*OrganizationSearcher) QueryOrganizations

QueryOrganizations searches for organizations using Clearbit API

func (*OrganizationSearcher) SuggestOrganizations added in v0.4.1

SuggestOrganizations returns organization suggestions using Clearbit Autocomplete API

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL