Skip to main content

A client of ixBrowser local api

Project description

ixBrowser Local API

Official Python client for ixBrowser Local API V2.0.

Language

Prerequisites

  • Python 3.5 or later.
  • The ixBrowser desktop client is installed and running.
  • The ixBrowser Local API service is enabled in the desktop client.
  • By default, this SDK connects to http://127.0.0.1:53200/api/v2/.

If your local API service uses a different host or port, pass them to IXBrowserClient:

from ixbrowser_local_api import IXBrowserClient

c = IXBrowserClient(target="127.0.0.1", port=53200)

Installation

Install from PyPI:

pip install ixbrowser-local-api

Install from source:

git clone https://github.com/ixspyinc/ixbrowser-local-api-python.git
cd ixbrowser-local-api-python
pip install .

(Legacy Support) If you still use the deprecated setup.py installation, we recommend installing setuptools first:

git clone https://github.com/ixspyinc/ixbrowser-local-api-python.git
cd ixbrowser-local-api-python
pip install setuptools
python setup.py install

Quick Start

import random
from ixbrowser_local_api import IXBrowserClient

c = IXBrowserClient()

profiles = c.get_profile_list()
if profiles is None:
    print("Get profile list error:")
    print("Error code=", c.code)
    print("Error message=", c.message)
else:
    item = random.choice(profiles)
    profile_id = item["profile_id"]
    print("Random profile_id=", profile_id)

    open_result = c.open_profile(
        profile_id,
        cookies_backup=False,
        load_profile_info_page=False,
    )
    if open_result is None:
        print("Open profile error:")
        print("Error code=", c.code)
        print("Error message=", c.message)
    else:
        print(open_result)
        # open_result contains "webdriver" and "debugging_address".
        # They can be used to attach Selenium, Playwright, or another
        # browser automation tool to the opened profile.

Error Handling

Most client methods return the API data on success. When a request fails, the method returns None, and the error details are stored on the client instance:

result = c.get_profile_list()
if result is None:
    print(c.code)
    print(c.message)

See docs/error-handling.md for details.

Documentation

Examples

The examples/ directory contains runnable scripts for common tasks:

  • examples/simple_test.py: basic connectivity and common API calls.
  • examples/show_info.py: print local information and list resources.
  • examples/profile_create.py: create a profile with proxy, preferences, and fingerprint settings.
  • examples/profile_open.py: open a profile and attach Selenium.
  • examples/profile_open_with_random_fingerprint.py: open a profile with a randomized fingerprint.
  • examples/profile_update.py: update profile settings.
  • examples/profile_copy.py: create a profile by copying another profile.
  • examples/tag/: profile tag CRUD examples.
  • examples/proxy_tag/: proxy tag CRUD examples.
  • examples/profile_transfer_code/: transfer code examples.

See examples/README.md for the full examples map.

Official API Documentation

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

ixbrowser_local_api-1.2.5.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

ixbrowser_local_api-1.2.5-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file ixbrowser_local_api-1.2.5.tar.gz.

File metadata

  • Download URL: ixbrowser_local_api-1.2.5.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for ixbrowser_local_api-1.2.5.tar.gz
Algorithm Hash digest
SHA256 8294f11d8384fdb42c052c78eeadad0dfc249e3d783ca18627d517a9c14bd770
MD5 f15fddd271fbcbe9391177c452318b5f
BLAKE2b-256 af78a225a9f6ddff5b42e03851004252940cd19215d35e9db48781e25398215b

See more details on using hashes here.

File details

Details for the file ixbrowser_local_api-1.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for ixbrowser_local_api-1.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b43c8eefd292bdcf678a9c431e3903be29e2fb69476787161526f205ba4e99ee
MD5 78fec88827ea40ebc91bb38b7c1c4800
BLAKE2b-256 ad63ddd4d4b9c8cbf66f01e8f888aee3b448e40ead91c7fca3288504f5023280

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