Go SDK
Installation
Section titled “Installation”go get github.com/bizverify/bizverify-goRequires Go 1.21+. Zero external dependencies (stdlib only).
Quick start
Section titled “Quick start”package main
import ( "context" "fmt" "log"
bv "github.com/bizverify/bizverify-go")
func main() { client := bv.New(bv.WithAPIKey("bv_live_..."))
resp, err := client.Verification.Verify(context.Background(), bv.VerifyParams{ EntityName: "Acme Corporation", Jurisdiction: "us-fl", }) if err != nil { log.Fatal(err) } fmt.Println(resp.Status)}Passwordless auth
Section titled “Passwordless auth”ctx := context.Background()client := bv.New()
// Step 1: Request a code_, err := client.Auth.RequestAccess(ctx, "you@example.com", true)
// Step 2: Verify code — client auto-configuresresp, err := client.Auth.VerifyAccess(ctx, "you@example.com", "123456", nil)fmt.Println("API Key:", resp.APIKey)Verify and wait
Section titled “Verify and wait”job, err := client.Verification.VerifyAndWait(ctx, bv.VerifyParams{ EntityName: "Acme Inc", Jurisdiction: "us-fl",}, &bv.PollOptions{ PollInterval: 2 * time.Second, Timeout: 120 * time.Second, OnStatusChange: func(status *bv.JobStatusResponse) { log.Printf("Status: %s\n", status.Status) },})Search
Section titled “Search”// Single pageresp, err := client.Search.Find(ctx, bv.SearchParams{ EntityName: "Acme", Jurisdiction: "us-fl", Limit: 10,})for _, r := range resp.Results { fmt.Printf("%s (confidence: %d%%)\n", r.EntityName, r.Confidence)}
// Auto-paginateiter := client.Search.FindAll(ctx, bv.SearchParams{EntityName: "Acme"})for iter.Next() { r := iter.Value() fmt.Println(r.EntityName)}if err := iter.Err(); err != nil { log.Fatal(err)}Fetch a cached entity
Section titled “Fetch a cached entity”Retrieve a previously verified business by its entity ID (returned from a Verify or Search call) — free, no credits charged.
entity, err := client.Entities.Get(ctx, "550e8400-e29b-41d4-a716-446655440000")if err != nil { log.Fatal(err)}fmt.Println(entity.EntityName, entity.Status)if entity.RegisteredAgent != nil { fmt.Println(entity.RegisteredAgent.Name)}fmt.Println(entity.Officers)if entity.LastVerifiedAt != nil { fmt.Println(*entity.LastVerifiedAt)}Configuration
Section titled “Configuration”client := bv.New( bv.WithAPIKey("bv_live_..."), bv.WithBaseURL("https://api.bizverify.co"), bv.WithMaxRetries(2), bv.WithTimeout(30 * time.Second),)Error handling
Section titled “Error handling”import "errors"
entity, err := client.Entities.Get(ctx, "ent_nonexistent")if err != nil { var notFound *bv.NotFoundError var noCredits *bv.InsufficientCreditsError var rateLimit *bv.RateLimitError
switch { case errors.As(err, ¬Found): fmt.Printf("Not found: %s\n", notFound.Message) case errors.As(err, &noCredits): fmt.Println("Need more credits") case errors.As(err, &rateLimit): fmt.Printf("Retry after %ds\n", rateLimit.RetryAfter) default: log.Fatal(err) }}Full reference
Section titled “Full reference”See the SDK README on GitHub for the complete API.