Skip to content

SDK release

This guide covers SDK v0.4.4.

Python SDK quickstart

Asynchronous Python client for aimlib mobile proxies, managed remote-browser sessions, network operations, and support tickets. Python 3.10 or newer is required.

Install

For proxy, device, network-operation, and support APIs:

python -m pip install --upgrade aimlib

Include managed remote-browser support when needed:

python -m pip install --upgrade "aimlib[browser]"

The browser extra provides the supported client integration. No separate browser installation step is required.

Configure

export AIMLIB_API_KEY="<api-key>"
export AIMLIB_BASE_URL="https://uswest1.aimlib.com"

API keys, credential-bearing proxy URLs, and browser connection tokens are secrets. Do not print or log them.

Example

from aimlib import Aimlib

async with Aimlib() as ai:
    device = (await ai.devices.list())[0]

    http_proxy = device.proxy.http_url
    socks_remote_dns_proxy = device.proxy.socks5h_url

    async with await device.browser(ttl="10m") as session:
        page = await session.new_page()
        await page.goto("https://example.com")
        print(await page.title())

Only devices in your active rentals are returned. A remote browser requires an eligible active rental.

Main APIs

  • ai.devices.list() and ai.device(id) return devices in active rentals.
  • device.proxy.http_url, .socks5_url, and .socks5h_url address the same proxy host and port.
  • device.browser() creates a remote-browser session for the active rental.
  • session.new_page(), .disconnect(), .connect(), and .stop() manage that session.
  • device.rotate_ip() and device.switch_carrier() support blocking or queued operation modes.
  • ai.operations.get(id) and .wait(id) poll queued network operations.
  • ai.tickets creates, lists, reads, replies to, and closes support tickets.