static async Task Main(string[] args) { string api_key = ""; //Add your api key from companies house api here https://developer.companieshouse.gov.uk/developer/applications if (!api_key.Any()) { Console.WriteLine($"No API Key found. Please edit Program.cs to add it in."); return; } Console.WriteLine($"Starting up - Found this api key: {api_key}"); CompaniesHouseClientResponse <CompaniesHouse.Response.Search.AllSearch.AllSearch> result = null; string nameToSearchFor = "Bigman"; var settings = new CompaniesHouseSettings(api_key); using (var client = new CompaniesHouseClient(settings)) { var request = new SearchRequest() { Query = nameToSearchFor, StartIndex = 0, ItemsPerPage = 10 }; result = await client.SearchAllAsync(request); } DisplayResults(result, nameToSearchFor); }
private void GivenACompaniesHouseClient() { var apiKey = Environment.GetEnvironmentVariable("CompaniesHouseApiKey"); var settings = new CompaniesHouseSettings(apiKey); _client = new CompaniesHouseClient(settings); }
private CompaniesHouseClient GetCompaniesHouseClient() { var key = ConfigurationManager.AppSettings["CompaniesHouseApiKey"]; var settings = new CompaniesHouseSettings(key); var client = new CompaniesHouseClient(settings); return(client); }
public void GivenACompaniesHouseClient() { var apiKey = Environment.GetEnvironmentVariable("CompaniesHouseApiKey"); var settings = new CompaniesHouseSettings(apiKey); _client = new CompaniesHouseClient(settings); }
private async Task <CompanyProfile> CompanyProfileData(string companyNumber) { using (var client = new CompaniesHouseClient(CHSettings)) { var profile = await client.GetCompanyProfileAsync(companyNumber); return(profile.Data); } }
private async Task <SearchItem[]> SearchCHData() { using (var client = new CompaniesHouseClient(CHSettings)) { var request = new SearchRequest() { Query = "Cloth", StartIndex = 10, ItemsPerPage = 10 }; var result = await client.SearchAllAsync(request); return(result.Data.Items); } }
public void GivenACompaniesHouseClient() { var settings = new CompaniesHouseSettings(Keys.ApiKey); _client = new CompaniesHouseClient(settings); }
public void GivenACompaniesHouseClient() { var settings = new CompaniesHouseSettings(Keys.ApiKey); _client = new CompaniesHouseClient(settings); }
private void GivenACompaniesHouseClient() { Client = new CompaniesHouseClient(new CompaniesHouseSettings(CompaniesHouseUris.Default, Keys.ApiKey)); }
private void GivenACompaniesHouseClient() { var settings = new CompaniesHouseSettings(Keys.ApiKey); Client = new CompaniesHouseClient(settings); }