Skip to main content

Python SDK for aimlib mobile proxies and remote-browser sessions

Project description

aimlib Python SDK

PyPI Python CI

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

Install

For proxy, device, radio-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 connects to Chromium on the leased phone. It does not download or launch a browser binary on your computer.

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 can be created only after a rental is active and the phone has been assigned to it.

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 radio operations.
  • ai.tickets creates, lists, reads, replies to, and closes support tickets.

Development

python -m pip install -e ".[browser]"
python -m unittest discover -s tests -v

See the customer documentation for the complete API contract, limits, security policy, and examples. Release notes are kept in the changelog.

Report security issues privately as described in the security policy. Never include API keys, credential-bearing proxy URLs, browser connection tokens, or customer data in an issue or log.

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

aimlib-0.4.2.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

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

aimlib-0.4.2-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file aimlib-0.4.2.tar.gz.

File metadata

  • Download URL: aimlib-0.4.2.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aimlib-0.4.2.tar.gz
Algorithm Hash digest
SHA256 63d3c904413b57762a54c3b6f730ad968da78824e426f930901b8b73d0d6eb48
MD5 68d9b2e7c3693560463bbc63e167d2a2
BLAKE2b-256 d87f9bd2eeafe6a88aca345b7c9b551a41d09ed3e69f9909940e95b7da1cbb8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for aimlib-0.4.2.tar.gz:

Publisher: release.yml on rukouai/aimlib-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aimlib-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: aimlib-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for aimlib-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 178762b924be7b9b118b310ee7c24c2cffff2643c2d9767a79292e0cacbbf9bb
MD5 7014e53f7e3247fe578af222db47dad5
BLAKE2b-256 27a6805e906d5a74205981036c0cdbd3686b1f3bed41460209692cc630df8330

See more details on using hashes here.

Provenance

The following attestation bundles were made for aimlib-0.4.2-py3-none-any.whl:

Publisher: release.yml on rukouai/aimlib-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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