Skip to content

Commit c0916e6

Browse files
committed
Merge branch 'release/4.0.0'
2 parents 28470f6 + bb5e408 commit c0916e6

File tree

116 files changed

+17079
-11483
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+17079
-11483
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ __pycache__/
88

99
# Distribution / packaging
1010
.Python
11+
env/
1112
develop-eggs/
1213
dist/
1314
downloads/
@@ -156,4 +157,6 @@ cython_debug/
156157
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
157158
# and can be added to the global gitignore or merged into this file. For a more nuclear
158159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
159-
#.idea/
160+
#.idea/
161+
162+
*.egg-info/

.openapi-generator-ignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
.gitignore
5+
.github/workflows/python.yml
6+
.gitlab-ci.yml
7+
.travis.yml
8+
git_push.sh
9+
docs
10+
docs/**/*
11+
*.md

.openapi-generator/FILES

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
kameleo/__init__.py
2+
kameleo/local_api_client/__init__.py
3+
kameleo/local_api_client/api/__init__.py
4+
kameleo/local_api_client/api/cookie_api.py
5+
kameleo/local_api_client/api/fingerprint_api.py
6+
kameleo/local_api_client/api/folder_api.py
7+
kameleo/local_api_client/api/general_api.py
8+
kameleo/local_api_client/api/kernel_api.py
9+
kameleo/local_api_client/api/profile_api.py
10+
kameleo/local_api_client/api_client.py
11+
kameleo/local_api_client/api_response.py
12+
kameleo/local_api_client/configuration.py
13+
kameleo/local_api_client/exceptions.py
14+
kameleo/local_api_client/models/__init__.py
15+
kameleo/local_api_client/models/add_profile_to_folder_request.py
16+
kameleo/local_api_client/models/audio_spoofing_type.py
17+
kameleo/local_api_client/models/browser.py
18+
kameleo/local_api_client/models/browser_cookie.py
19+
kameleo/local_api_client/models/browser_settings.py
20+
kameleo/local_api_client/models/canvas_spoofing_type.py
21+
kameleo/local_api_client/models/cookie_request.py
22+
kameleo/local_api_client/models/create_folder_request.py
23+
kameleo/local_api_client/models/create_profile_request.py
24+
kameleo/local_api_client/models/delete_folder_response.py
25+
kameleo/local_api_client/models/device.py
26+
kameleo/local_api_client/models/device_memory_choice.py
27+
kameleo/local_api_client/models/device_memory_spoofing_type.py
28+
kameleo/local_api_client/models/export_profile_request.py
29+
kameleo/local_api_client/models/fingerprint.py
30+
kameleo/local_api_client/models/fingerprint_preview.py
31+
kameleo/local_api_client/models/folder_response.py
32+
kameleo/local_api_client/models/font_spoofing_type.py
33+
kameleo/local_api_client/models/geolocation_choice.py
34+
kameleo/local_api_client/models/geolocation_spoofing_options.py
35+
kameleo/local_api_client/models/geolocation_spoofing_type.py
36+
kameleo/local_api_client/models/group_role.py
37+
kameleo/local_api_client/models/hardware_concurrency_choice.py
38+
kameleo/local_api_client/models/hardware_concurrency_spoofing_type.py
39+
kameleo/local_api_client/models/import_profile_request.py
40+
kameleo/local_api_client/models/kernel_response.py
41+
kameleo/local_api_client/models/list_folders_response.py
42+
kameleo/local_api_client/models/os.py
43+
kameleo/local_api_client/models/password_manager_type.py
44+
kameleo/local_api_client/models/preference.py
45+
kameleo/local_api_client/models/problem_details.py
46+
kameleo/local_api_client/models/problem_response.py
47+
kameleo/local_api_client/models/profile_lifetime_state.py
48+
kameleo/local_api_client/models/profile_preview.py
49+
kameleo/local_api_client/models/profile_response.py
50+
kameleo/local_api_client/models/profile_storage_location.py
51+
kameleo/local_api_client/models/proxy_choice.py
52+
kameleo/local_api_client/models/proxy_connection_type.py
53+
kameleo/local_api_client/models/quota_statistics.py
54+
kameleo/local_api_client/models/running_profiles_statistics.py
55+
kameleo/local_api_client/models/screen_choice.py
56+
kameleo/local_api_client/models/screen_spoofing_type.py
57+
kameleo/local_api_client/models/server.py
58+
kameleo/local_api_client/models/share_access.py
59+
kameleo/local_api_client/models/share_access_request.py
60+
kameleo/local_api_client/models/share_group_request.py
61+
kameleo/local_api_client/models/sharing_options_response.py
62+
kameleo/local_api_client/models/status_response.py
63+
kameleo/local_api_client/models/timezone_choice.py
64+
kameleo/local_api_client/models/timezone_spoofing_type.py
65+
kameleo/local_api_client/models/update_folder_request.py
66+
kameleo/local_api_client/models/update_profile_request.py
67+
kameleo/local_api_client/models/user.py
68+
kameleo/local_api_client/models/user_info_response.py
69+
kameleo/local_api_client/models/validation_problem_details.py
70+
kameleo/local_api_client/models/web_rtc_choice.py
71+
kameleo/local_api_client/models/web_rtc_spoofing_options.py
72+
kameleo/local_api_client/models/web_rtc_spoofing_type.py
73+
kameleo/local_api_client/models/webgl_meta.py
74+
kameleo/local_api_client/models/webgl_meta_choice.py
75+
kameleo/local_api_client/models/webgl_meta_spoofing_options.py
76+
kameleo/local_api_client/models/webgl_meta_spoofing_type.py
77+
kameleo/local_api_client/models/webgl_spoofing_type.py
78+
kameleo/local_api_client/py.typed
79+
kameleo/local_api_client/rest.py
80+
pyproject.toml
81+
requirements.txt
82+
setup.cfg
83+
setup.py
84+
test-requirements.txt
85+
tox.ini

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.11.0

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 Kameleo Team
3+
Copyright (c) 2025 Kameleo Team
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 67 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,65 @@
1-
<img src="https://raw.githubusercontent.com/kameleo-io/local-api-client-python/HEAD/docs/kameleo-logo.png" width="150" align="right" />
2-
31
# Kameleo Local API Client
42

53
With [Kameleo](https://kameleo.io), you can easily create multiple virtual browser profiles to work with multiple accounts. It helps you hide your actual timezone, geolocation, language, IP address and creates natural browser fingerprints to prevent detection by anti-bot systems. Kameleo is compatible with [Selenium](https://www.selenium.dev/), [Playwright](https://playwright.dev/), and [Puppeteer](https://pptr.dev/) frameworks for automating web scraping tasks. This Python package provides convenient access to the [Local API](https://app.swaggerhub.com/apis/kameleo-team/kameleo-local-api/) REST interface of the Kameleo Client. See the [article](https://help.kameleo.io/hc/en-us/articles/4418166326417) in our knowledge base for Getting Started with Kameleo Automation.
64

7-
# Features
5+
## Features
86

9-
- Stay completely undetected, so websites wont be able to detect that you are using automation tools
10-
- Start unlimited number of profiles with different natural browser fingerprints
11-
- Use authenticated HTTP/SOCKS/SSH proxies in browsers
12-
- Create isolated browsing environments simultaneously
13-
- Use real browser profiles of Chrome, Firefox, Safari and Edge
14-
- Edit, Import or Export browser cookies
15-
- Modify WebRTC parameters
16-
- Modify Geolocation settings
17-
- Modify Timezone and Language settings
18-
- Modify WebGL fingerprint
19-
- Modify 2D Canvas fingerprint
20-
- Modify Navigator properties
21-
- Modify Screen resolution
7+
- Stay completely undetected, so websites won't be able to detect that you are using automation tools
8+
- Start unlimited number of profiles with different natural browser fingerprints
9+
- Use authenticated HTTP/SOCKS/SSH proxies in browsers
10+
- Create isolated browsing environments simultaneously
11+
- Use real browser profiles of Chrome, Firefox, Safari and Edge
12+
- Edit, Import or Export browser cookies
13+
- Modify WebRTC parameters
14+
- Modify Geolocation settings
15+
- Modify Timezone and Language settings
16+
- Modify WebGL fingerprint
17+
- Modify 2D Canvas fingerprint
18+
- Modify Navigator properties
19+
- Modify Screen resolution
2220

23-
> Note: _You need [Automation package](https://kameleo.io/pricing) of Kameleo to access the features described below._
21+
> _For an overview of automating with Kameleo and which plan you need to access these features, see our [pricing page](https://kameleo.io/pricing)._
2422
25-
# Quickstart Guide
23+
## Quickstart Guide
2624

27-
## 1. Install package
25+
### 1. Install package
2826

2927
```
3028
pip install kameleo.local_api_client
3129
```
3230

33-
## 2. Start the Kameleo.CLI on your computer
31+
### 2. Start the Kameleo.CLI on your computer
3432

3533
```
3634
./Kameleo.CLI email="your@email.com" password="Pa$$w0rd"
3735
```
3836

39-
## 3. Start a browser with out-of-the-box fingerprinting protection
37+
### 3. Start a browser with out-of-the-box fingerprinting protection
4038

4139
```python
4240
from kameleo.local_api_client import KameleoLocalApiClient
43-
from kameleo.local_api_client.builder_for_create_profile import BuilderForCreateProfile
41+
from kameleo.local_api_client.models import CreateProfileRequest
4442

4543
client = KameleoLocalApiClient()
46-
base_profiles = client.search_base_profiles(
44+
fingerprints = client.fingerprint.search_fingerprints(
4745
device_type='desktop',
4846
browser_product='chrome'
4947
)
5048

5149
# Create a new profile with recommended settings
5250
# for browser fingerprinting protection
53-
create_profile_request = BuilderForCreateProfile \
54-
.for_base_profile(base_profiles[0].id) \
55-
.set_name('example profile') \
56-
.set_recommended_defaults() \
57-
.build()
58-
profile = client.create_profile(body=create_profile_request)
51+
create_profile_request = CreateProfileRequest(
52+
fingerprint_id=fingerprints[0].id,
53+
name='example profile')
54+
profile = client.profile.create_profile(create_profile_request)
5955

6056
# Start the browser
61-
client.start_profile(profile.id)
57+
client.profile.start_profile(profile.id)
6258

6359
# At this point you can automate the browser with your favorite framework
6460
```
6561

66-
# Automate Kameleo profiles with Selenium
62+
## Automate Kameleo profiles with Selenium
6763

6864
Kameleo gives you the ability to control any supported browser using Selenium. It uses the WebDriver protocol, a W3C specification, and industry-standard to interact with a browser.
6965

@@ -88,9 +84,9 @@ driver = webdriver.Remote(
8884
driver.get('https://google.com')
8985
```
9086

91-
The full example can be found [here](https://github.com/kameleo-io/local-api-examples/blob/master/python/connect_to_selenium/app.py).
87+
The full example can be found [here](https://github.com/kameleo-io/local-api-examples/blob/master/python/connect_with_selenium/app.py).
9288

93-
# Automate Kameleo profiles with Puppeteer (Chromium-based)
89+
## Automate Kameleo profiles with Puppeteer (Chromium-based)
9490

9591
Kameleo lets you control Chromium-based browsers (sorry Firefox fans) using the [Pyppeteer library](https://pypi.org/project/pyppeteer/). In this simple example you can see how to connect to the browser that Kameleo starts.
9692

@@ -114,7 +110,7 @@ await page.goto('https://google.com')
114110

115111
The full example can be found [here](https://github.com/kameleo-io/local-api-examples/blob/master/python/connect_with_puppeteer/app.py).
116112

117-
# Automate Kameleo profiles with Playwright
113+
## Automate Kameleo profiles with Playwright
118114

119115
Kameleo allows you to control the browser with the official [Playwright package](https://pypi.org/project/playwright/). It works little bit different with Chromium-based browsers and Firefox, so we provide an example for both. Here we showcase how you can connect to the browser that is already started by Kameleo.
120116

@@ -127,7 +123,7 @@ from playwright.sync_api import sync_playwright
127123

128124
You can find more details here: [Using Kameleo with Playwright framework – Kameleo Support Center](https://help.kameleo.io/hc/en-us/articles/4419471627793-Using-Kameleo-with-Playwright-framework).
129125

130-
## Chromium-based profiles with Playwright
126+
### Chromium-based profiles with Playwright
131127

132128
```python
133129
# Connect to the browser with Playwright through CDP
@@ -145,7 +141,7 @@ with sync_playwright() as playwright:
145141

146142
The full example can be found [here](https://github.com/kameleo-io/local-api-examples/blob/master/python/connect_with_playwright_to_chrome/app.py).
147143

148-
## Firefox-based profiles with Playwright
144+
### Firefox-based profiles with Playwright
149145

150146
```python
151147
# Connect to the browser with Playwright
@@ -161,7 +157,7 @@ with sync_playwright() as playwright:
161157
if pw_bridge_path == None and system() == 'Windows':
162158
pw_bridge_path = path.expandvars(r'%LOCALAPPDATA%\Programs\Kameleo\pw-bridge.exe')
163159
elif pw_bridge_path == None and system() == 'Darwin':
164-
pw_bridge_path = '/Applications/Kameleo.app/Contents/MacOS/pw-bridge'
160+
pw_bridge_path = '/Applications/Kameleo.app/Contents/Resources/CLI/pw-bridge'
165161
browser = playwright.firefox.launch_persistent_context(
166162
'',
167163
executable_path=pw_bridge_path,
@@ -178,38 +174,34 @@ with sync_playwright() as playwright:
178174
page.goto('https://google.com')
179175

180176
# Here we need to close the browser object as well, it is not enough just to stop the profile
181-
client.stop_profile(profile.id)
177+
client.profile.stop_profile(profile.id)
182178
browser.close()
183179
```
184180

185181
The full example can be found [here](https://github.com/kameleo-io/local-api-examples/blob/master/python/connect_with_playwright_to_firefox/app.py).
186182

187-
# Automate mobile profiles
183+
## Automate mobile profiles
188184

189-
Kameleo can emulate mobile devices in the custom built Chromium.
185+
Kameleo can emulate mobile devices with Chroma, our custom built Chromium variant.
190186

191187
```python
192-
# Search for a mobile Base Profiles
193-
base_profile_list = client.search_base_profiles(
188+
# Search for a mobile fingerprints
189+
fingerprints = client.fingerprint.search_fingerprints(
194190
device_type='mobile',
195191
os_family='ios',
196-
browser_product='safari',
197-
language='en-us'
192+
browser_product='safari'
198193
)
199194

200-
# Create a new profile with recommended settings
201-
# Choose one of the Base Profiles
202-
# Set the launcher to 'chromium' so the mobile profile will be started in Chroma browser
203-
create_profile_request = BuilderForCreateProfile \
204-
.for_base_profile(base_profile_list[0].id) \
205-
.set_name('automate mobile profiles on desktop example') \
206-
.set_recommended_defaults() \
207-
.set_launcher('chromium') \
208-
.build()
209-
profile = client.create_profile(body=create_profile_request)
195+
# Create a new profile with automatic recommended settings
196+
# Choose one of the fingerprints
197+
# Kameleo launches mobile profiles with our Chroma browser
198+
create_profile_request = CreateProfileRequest(
199+
fingerprint_id=fingerprints[0].id,
200+
name='automate mobile profiles on desktop example')
201+
profile = client.profile.create_profile(create_profile_request)
210202

211203
# Start the profile
212-
client.start_profile_with_options(profile.id, body={
204+
client.profile.start_profile(profile.id, {
213205
# This allows you to click on elements using the cursor when emulating a touch screen in the browser.
214206
# If you leave this out, your script may time out after clicks and fail.
215207
'additionalOptions': [
@@ -225,35 +217,35 @@ client.start_profile_with_options(profile.id, body={
225217

226218
The full example can be found [here](https://github.com/kameleo-io/local-api-examples/blob/master/python/automate_mobile_profiles_on_desktop/app.py).
227219

228-
# Example codes
220+
## Example codes
229221

230222
[Several examples](https://github.com/kameleo-io/local-api-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.
231223

232-
- Finding base profiles
233-
- Creating profiles with custom options
234-
- Updating profiles with new settings
235-
- How to start a profile
236-
- Using Selenium with Local API
237-
- Using Playwright with Kameleo
238-
- Using Puppeteer with Kameleo
239-
- How to emulate mobile devices
240-
- Adding an HTTP, SOCKS or SSH proxy to profile
241-
- Saving/Loading a browsing session to/from a .kameleo file
242-
- Modify and Delete browser cookies
243-
- Start profile with extra WebDriver capabilities
244-
- How to duplicate virtual browser profiles
245-
- Refresh the browser of the emulated profiles
224+
- Finding fingerprints
225+
- Creating profiles with custom options
226+
- Updating profiles with new settings
227+
- How to start a profile
228+
- Using Selenium with Local API
229+
- Using Playwright with Kameleo
230+
- Using Puppeteer with Kameleo
231+
- How to emulate mobile devices
232+
- Adding an HTTP, SOCKS or SSH proxy to profile
233+
- Saving/Loading a browsing session to/from a .kameleo file
234+
- Modify and Delete browser cookies
235+
- Start profile with extra WebDriver capabilities
236+
- How to duplicate virtual browser profiles
237+
- Refresh the browser of the emulated profiles
246238

247239
> Note: _If you are interested in more information about Kameleo, or have encountered an issue with using it, please check out our [Help Center](https://help.kameleo.io/)._
248240
249-
# Endpoints
241+
## Package
250242

251-
Available API endpoints with exhaustive descriptions and example values are documented on this [SwaggerHub](https://app.swaggerhub.com/apis/kameleo-team/kameleo-local-api/) page. This package has built-in [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense) support in Visual Studio Code, no extra package installation needed.
243+
This package can be found on PyPI here: [kameleo.local-api-client](https://pypi.org/project/kameleo.local-api-client/).
252244

253-
# Package
245+
## Endpoints
254246

255-
This package can be found on PyPI here: [kameleo.local-api-client](https://pypi.org/project/kameleo.local-api-client/).
247+
Available API endpoints with exhaustive descriptions and example values are documented on this [SwaggerHub](https://app.swaggerhub.com/apis/kameleo-team/kameleo-local-api/) page. This package has built-in [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense) support in Visual Studio Code, no extra package installation needed.
256248

257-
# License
249+
## License
258250

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

docs/kameleo-logo.png

-71 KB
Binary file not shown.

kameleo/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

0 commit comments

Comments
 (0)