Kameleo.LocalApiClient
2.3.0
See the version list below for details.
dotnet add package Kameleo.LocalApiClient --version 2.3.0
NuGet\Install-Package Kameleo.LocalApiClient -Version 2.3.0
<PackageReference Include="Kameleo.LocalApiClient" Version="2.3.0" />
paket add Kameleo.LocalApiClient --version 2.3.0
#r "nuget: Kameleo.LocalApiClient, 2.3.0"
// Install Kameleo.LocalApiClient as a Cake Addin #addin nuget:?package=Kameleo.LocalApiClient&version=2.3.0 // Install Kameleo.LocalApiClient as a Cake Tool #tool nuget:?package=Kameleo.LocalApiClient&version=2.3.0
<img src="docs/kameleo-logo.png" width="150" align="right" />
Kameleo Local API Client
Kameleo is a complete and integrated solution for browser fingerprinting protection, and also for easy browser automation using W3C WebDriver. This .NET Standard package provides convenient access to the Local API REST interface of the Kameleo Client.
Features
- Protection from Selenium/WebDriver detection
- Start unlimited number of profiles with different browser fingerprints
- Use authenticated HTTP/SOCKS/SSH proxies in browsers
- Create isolated browsing environments simultaneously
- Use real browser profiles of Chrome, Firefox, Safari and Edge
- Edit, Import or Export browser cookies
- Modify WebRTC parameters
- Modify Geolocation settings
- Modify WebGL fingerprint
- Modify 2D Canvas fingerprint
- Modify Navigator properties
- Modify Screen resolution
Quickstart Guide
1. Install by NuGet
Install-Package Kameleo.LocalApiClient
2. Start the Kameleo.CLI on your computer
./Kameleo.CLI.exe email="your@email.com" password="Pa$$w0rd"
Note: You need Automation package of Kameleo to access the features described below.
3. Start a browser with out-of-the-box fingerprinting protection
using System;
using System.Threading.Tasks;
using Kameleo.LocalApiClient;
namespace Kameleo.QuickstartGuide
{
class Program
{
private const string KameleoBaseUrl = "http://localhost:5050";
static async Task Main()
{
var client = new KameleoLocalApiClient(new Uri(KameleoBaseUrl));
client.SetRetryPolicy(null);
// Search Chrome Base Profiles
var baseProfiles = await client.SearchBaseProfilesAsync(deviceType: "desktop", browserProduct: "chrome");
// Create a new profile with recommended settings
// for browser fingerprint protection
var requestBody = BuilderForCreateProfile
.ForBaseProfile(baseProfiles[0].Id)
.SetRecommendedDefaults()
.Build();
var profile = await client.CreateProfileAsync(requestBody);
// Start the browser
await client.StartProfileAsync(profile.Id);
}
}
}
Automate browsers with W3C WebDriver
Kameleo uses a WebDriver compatible server to control the browser. WebDriver is a W3C specification and industry standard which provides a platform and HTTP protocol to interact with a browser.
using System;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
using Kameleo.LocalApiClient;
namespace Kameleo.AutomateBrowsers
{
class Program
{
private const string KameleoBaseUrl = "http://localhost:5050";
static async Task Main()
{
var client = new KameleoLocalApiClient(new Uri(KameleoBaseUrl));
client.SetRetryPolicy(null);
// Search Chrome Base Profiles
var baseProfiles = await client.SearchBaseProfilesAsync(deviceType: "desktop", browserProduct: "chrome");
// Create a new profile with recommended settings
// for browser fingerprint protection
var requestBody = BuilderForCreateProfile
.ForBaseProfile(baseProfiles[0].Id)
.SetRecommendedDefaults()
.Build();
var profile = await client.CreateProfileAsync(requestBody);
// Start the browser
await client.StartProfileAsync(profile.Id);
// Connect to the running browser instance using WebDriver
var uri = new Uri($"{KameleoBaseUrl}/webdriver");
var opts = new ChromeOptions();
opts.AddAdditionalOption("kameleo:profileId", profile.Id.ToString());
var webdriver = new RemoteWebDriver(uri, opts);
// Use any WebDriver command to drive the browser
// and enjoy full protection from Selenium detection methods
webdriver.Navigate().GoToUrl("https://google.com");
webdriver.FindElement(By.Name("q")).SendKeys("Kameleo");
webdriver.FindElement(By.Name("q")).SendKeys(Keys.Enter);
await Task.Delay(5000);
var title = webdriver.Title;
Console.WriteLine("The title is " + title);
// Stop the browser by stopping the Kameleo profile
await client.StopProfileAsync(profile.Id);
}
}
}
Example codes
Several examples have been prepared in a different repository to showcase the most interesting features. Feel free to create a pull request to add new example codes.
- Finding base profiles
- Creating profiles with custom options
- Updating profiles with new settings
- How to start a profile
- Using WebDriver with Local API
- Adding an HTTP, SOCKS or SSH proxy to profile
- Saving/Loading a browsing session to/from a .kameleo file
- Modify and Delete browser cookies
- Hooking up Kameleo with an external browser (Puppeteer)
- Start profile with extra WebDriver capabilites
Endpoints
Available API endpoints with exhaustive descriptions and example values are documented on this SwaggerHub page.
License
This project is released under MIT License. Please refer the LICENSE.txt for more details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Rest.ClientRuntime (>= 2.3.22)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.4.0 | 130 | 11/13/2024 |
3.2.0 | 203 | 5/13/2024 |
3.1.1 | 221 | 3/20/2024 |
3.1.0 | 345 | 2/7/2024 |
3.0.0 | 434 | 7/21/2023 |
2.11.0 | 484 | 2/8/2023 |
2.10.0 | 502 | 11/15/2022 |
2.9.0 | 542 | 8/18/2022 |
2.6.0 | 16,157 | 2/18/2022 |
2.3.2 | 561 | 7/21/2021 |
2.3.1 | 460 | 7/21/2021 |
2.3.0 | 472 | 7/21/2021 |
2.0.2 | 584 | 12/21/2020 |
2.0.1 | 544 | 12/21/2020 |
2.0.0 | 599 | 12/7/2020 |