C# SDK

Install and start using the C# SDK.

Intro

The BrightQuery API SDK provides access to the BrightQuery API REST APIs.

Government-verified business intelligence on U.S. organizations, legal entities, locations and people, linked by the BrightQuery bq_id.

Installation

Add the SDK as a project reference into your solution:

Terminal
dotnet add reference <path-to-sdk>/src/BrightQueryApi/BrightQueryApi.csproj

The project takes its build settings from the files around it, so reference it in place.

Quick Start

Dependency Injection

Register the client with IServiceCollection and resolve it from the container. The HttpClient is managed by IHttpClientFactory. Configure the client's behavior through BrightQueryApiClientOptions.

C#
services.AddBrightQueryApiClient(options =>
{
    options.ApiKeyAuth = "YOUR_API_KEY";
    options.Environment = ServerEnvironment.Production;
    // TODO: configure more client options here
});

Direct Instantiation

Create the client by passing an HttpClient you manage yourself. Configure the client's behavior through BrightQueryApiClientOptions.

C#
var httpClient = new HttpClient();
// TODO: configure more client options here
var options = new BrightQueryApiClientOptions
{
    ApiKeyAuth = "YOUR_API_KEY",
    Environment = ServerEnvironment.Production,
};
var client = new BrightQueryApiClient(httpClient, options);

On this page