Skip to main content

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 Python 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 package

pip install kameleo.local_api_client

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

from kameleo.local_api_client.kameleo_local_api_client import KameleoLocalApiClient
from kameleo.local_api_client.builder_for_create_profile import BuilderForCreateProfile

client = KameleoLocalApiClient()
base_profiles = client.search_base_profiles(
    device_type='desktop',
    browser_product='chrome'
)

# Create a new profile with recommended settings
# for browser fingerprinting protection
create_profile_request = BuilderForCreateProfile \
    .for_base_profile(base_profiles[0].id) \
    .set_recommended_defaults() \
    .build()
profile = client.create_profile(body=create_profile_request)

# Start the browser
client.start_profile(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.

from kameleo.local_api_client.kameleo_local_api_client import KameleoLocalApiClient
from kameleo.local_api_client.builder_for_create_profile import BuilderForCreateProfile
from selenium import webdriver

kameleoBaseUrl = 'http://localhost:5050'
client = KameleoLocalApiClient(kameleoBaseUrl)

# Search Chrome Base Profiles
base_profiles = client.search_base_profiles(
    device_type='desktop',
    browser_product='chrome'
)

# Create a new profile with recommended settings
# for browser fingerprinting protection
create_profile_request = BuilderForCreateProfile \
    .for_base_profile(base_profiles[0].id) \
    .set_recommended_defaults() \
    .build()
profile = client.create_profile(body=create_profile_request)

# Start the browser
client.start_profile(profile.id)

# Connect to the running browser instance using WebDriver
options = webdriver.ChromeOptions()
options.add_experimental_option("kameleo:profileId", profile.id)
driver = webdriver.Remote(
    command_executor=f'{kameleoBaseUrl}/webdriver',
    options=options
)

# Use any WebDriver command to drive the browser
# and enjoy full protection from Selenium detection methods
driver.get('https://google.com')
driver.find_element('name', 'q').send_keys('Kameleo\n')
print(driver.title)

# Stop the browser by stopping the Kameleo profile
client.stop_profile(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)

Endpoints

Available API endpoints with exhaustive descriptions and example values are documented on this SwaggerHub page. This package has built-in IntelliSense support in Visual Studio Code, no extra package installation needed.

License

This project is released under MIT License. Please refer the LICENSE.txt for more details.

Metadata

Release files for kameleo.local-api-client 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kameleo.local-api-client 2.3.0
File Size Uploaded
kameleo.local_api_client-2.3.0.tar.gz 27.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kameleo.local-api-client 2.3.0
File Interpreter ABI Platform
kameleo.local_api_client-2.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 106.1 kB

Release files / kameleo.local_api_client-2.3.0.tar.gz

Download URL kameleo.local_api_client-2.3.0.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
60d7b835f662e63f50a8721be62946b95a0f4761f682f5ddadc181a9c0f50afa
BLAKE2b-256 checksum
How to use checksums
08be4fa17d9ed8d0f276e5ba450d305b8f2dc0b4fa4a6da1021c6b4017424236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.0

Release files / kameleo.local_api_client-2.3.0-py2.py3-none-any.whl

Download URL kameleo.local_api_client-2.3.0-py2.py3-none-any.whl
Size 78.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
851aaefe006646b4ed3f2f2aff1f9eb84dfaff63f1400b3e75ff56f671239151
BLAKE2b-256 checksum
How to use checksums
0a095feccf7b169ea8e8bd09e86dea250864fa997c3694f2c1ec2256066319cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.0

Release history Release notifications | RSS feed

5.2.0

2 release files

5.1.0

2 release files

5.0.0

2 release files

4.4.0

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.4.0

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.11.1

2 release files

2.10.0

2 release files

2.9.0

2 release files

2.6.0

2 release files

2.3.2

2 release files

This release

2.3.0 This release

2 release files

2.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page