Skip to main content

Python client for Incogniton API

Project description

Incogniton Python Client

The official Incogniton Anti-detect browser Python SDK for seamless integration with the Incogniton Antidetect Browser API and browser automation workflows. For more about Incogniton, visit our website.

This package enables Python developers to automate browser tasks, manage profiles, and handle cookies using Incogniton's local desktop app. It supports both REST API operations and direct browser automation (Selenium, Pyppeteer and Playwright).

Key Capabilities

  • Create, update, and delete browser profiles
  • Manage cookies for any profile
  • Launch and control browsers using Selenium, Pyppeteer and Playwright
  • Headless automation and custom browser arguments
  • Built-in error handling and logging

Getting Started

Installation

# Recommended: Poetry
poetry install

# Or with pip
pip install -e .

Requirements

  • Python 3.8 or newer
  • Incogniton desktop app running locally

Example Usage

Profile Management

from incogniton import IncognitonClient

client = IncognitonClient()

# Add a new profile
data = {"profileData": {"general_profile_information": {"profile_name": "Test Profile"}}}
profile = await client.profile.add(data)

# List all profiles
profiles = await client.profile.list()

# Fetch a profile by ID
details = await client.profile.get("PROFILE_ID")

Automating Browsers

from incogniton import IncognitonBrowser

browser = IncognitonBrowser(client, profile_id="your-profile-id", headless=True)

# Pyppeteer example
pyppeteer_browser = await browser.start_puppeteer()
page = await pyppeteer_browser.newPage()
await page.goto("https://example.com")
await browser.close(pyppeteer_browser)

# Selenium example
selenium_driver = await browser.start_selenium()
selenium_driver.get("https://example.com")
selenium_driver.quit()

Configuration Options

  • profile_id: Incogniton profile to use for automation
  • headless: Run browsers in headless mode (default: True)
  • custom_args: Pass extra arguments to the browser (optional)

Endpoints & Methods

Below is a summary of the most commonly used methods and operations available in the Incogniton Python SDK. For a complete and up-to-date API reference, please see the official Incogniton API Documentation.

Profile Operations (client.profile)

  • await client.profile.list()
    • List all browser profiles.
  • await client.profile.get(profile_id)
    • Get a specific browser profile.
  • await client.profile.add(create_request)
    • Add a new browser profile. "create_request" is a "CreateBrowserProfileRequest".
  • await client.profile.update(profile_id, update_request)
    • Update an existing browser profile. "update_request" is an "UpdateBrowserProfileRequest".
  • await client.profile.switchProxy(profile_id, proxy)
    • Update a browser profile's proxy configuration.
  • await client.profile.launch(profile_id)
    • Launch a browser profile.
  • await client.profile.launchForceLocal(profile_id)
    • Force a browser profile to launch in local mode.
  • await client.profile.launchForceCloud(profile_id)
    • Force a browser profile to launch in cloud mode.
  • await client.profile.getStatus(profile_id)
    • Get the current status of a browser profile.
  • await client.profile.stop(profile_id)
    • Stop a running browser profile.
  • await client.profile.delete(profile_id)
    • Delete a browser profile.

Cookie Operations (client.cookie)

  • await client.cookie.get(profile_id)
    • Get all cookies associated with a browser profile.
  • await client.cookie.add(profile_id, cookie_data)
    • Add a new cookie to a browser profile. "cookie_data" is a list of cookie dicts.
  • await client.cookie.delete(profile_id)
    • Delete all cookies from a browser profile.

Automation Operations (client.automation)

  • await client.automation.launchPuppeteer(profile_id)
    • Launch a browser profile with Puppeteer automation.
  • await client.automation.launchPuppeteerCustom(profile_id, custom_args)
    • Launch a browser profile with Puppeteer automation using custom arguments.
  • await client.automation.launchSelenium(profile_id)
    • Launch a browser profile with Selenium automation.
  • await client.automation.launchSeleniumCustom(profile_id, custom_args)
    • Launch a browser profile with Selenium automation using custom arguments.

Browser Automation Operations (browser)

  • puppeteer_browser = await browser.start_puppeteer()
    • Launch the profile and return a connected Puppeteer (Pyppeteer) Browser instance.
  • selenium_driver = await browser.start_selenium()
    • Launch the profile and return a connected Selenium WebDriver instance.
  • await browser.close(puppeteer_browser)
    • Close a single Puppeteer (Pyppeteer) browser instance with logging and error handling.
  • await browser.close_all([puppeteer_browser1, puppeteer_browser2, ...])
    • Close multiple Puppeteer (Pyppeteer) browser instances in parallel with logging and error handling.

Running Tests

poetry run pytest
# or
pytest tests/

Contributing

We welcome improvements and bugfixes! Please fork the repository, create a branch, and open a pull request.

Need Help?

For questions or support, email yusuf@incogniton.com or use our contact form.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

incogniton-0.1.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

incogniton-0.1.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file incogniton-0.1.1.tar.gz.

File metadata

  • Download URL: incogniton-0.1.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.6 Darwin/24.4.0

File hashes

Hashes for incogniton-0.1.1.tar.gz
Algorithm Hash digest
SHA256 aa41883a2123a844e09e817d951e9e546677ee6491d55837604d1f1de5537428
MD5 6bf12040f5f52bbe7d032d37424edc58
BLAKE2b-256 1f5d90d607f7a50e04f02a17ad24ae49aa96dd5a8750c4695d27b12a87f86acf

See more details on using hashes here.

File details

Details for the file incogniton-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: incogniton-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.6 Darwin/24.4.0

File hashes

Hashes for incogniton-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84a21cd1191fa68a85215898547023409c437f4f0cf06149c8fcf42571d7efe7
MD5 54554f5da6389984e98227da010fce81
BLAKE2b-256 9d7051ddc220d29092a6c91586525f8d2632bff4a8d1d5bd0eb5e84328d803ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page