Skip to main content

Official Python SDK for MobileProxy.Space API — private mobile proxies on real GSM devices

Project description

MobileProxy.Space Python SDK

CI PyPI Python

Official Python SDK for the MobileProxy.Space API — private mobile proxies on real GSM devices across 52 countries.

Features

  • Full API coverage — all endpoints wrapped in typed, documented methods
  • Context manager support (with Client(...) as client:)
  • Typed exceptionsApiError, AuthenticationError, RateLimitError
  • IP rotation — dedicated change_ip() with no rate limit
  • Python 3.8+ compatible
  • Type hints throughout + py.typed marker (PEP 561)

Installation

pip install mobileproxy-sdk

Quick Start

from mobileproxy import Client

client = Client("YOUR_API_TOKEN")

# Check balance
balance = client.get_balance()
print(balance)

# List active proxies
proxies = client.get_my_proxy()

# Get current IP
ip = client.get_proxy_ip(12345)

# Rotate IP (no rate limit)
client.change_ip("your_proxy_key")

Context Manager

with Client("YOUR_API_TOKEN") as client:
    balance = client.get_balance()
    print(balance)
# session is closed automatically

API Methods

Proxy Information

Method Description
get_proxy_ip(proxy_id, *, check_spam=) Get current IP address of a proxy
get_my_proxy(proxy_id=) List active proxies (all or specific)
get_ip_stats() IP address statistics by GEO

Proxy Management

Method Description
change_proxy_credentials(proxy_id, login, password) Change proxy login/password
reboot_proxy(proxy_id) Restart the modem
edit_proxy(proxy_id, *, reboot_time=, ip_auth=, comment=) Update proxy settings
change_ip(proxy_key, *, format=, user_agent=) Rotate IP (no rate limit)

Equipment & GEO

Method Description
change_equipment(proxy_id, **kwargs) Switch modem/SIM/operator/city
get_available_equipment(proxy_id, **kwargs) List available equipment by GEO
get_geo_list(proxy_id, geo_id) Available GEOs for a proxy
get_operators(geo_id) Operators for a GEO
get_countries(only_available=) List of countries
get_cities() List of cities

Blacklist

Method Description
get_black_list(proxy_id) Get equipment/operator blacklist
add_operator_to_black_list(proxy_id, operator_id) Block an operator
remove_operator_from_black_list(proxy_id, operator_id) Unblock an operator
remove_from_black_list(proxy_id, black_list_id, eid) Remove equipment from blacklist

Purchasing & Billing

Method Description
buy_proxy(**kwargs) Purchase a proxy
refund_proxy(proxy_id) Request a refund
get_balance() Account balance
get_prices(country_id) Prices for a country
get_test_proxy(geo_id, operator) Get a free 2-hour trial proxy

Utilities

Method Description
check_equipment_availability(eid) Check if equipment is available
view_url_from_different_ips(url, country_id) Anti-cloaking: view URL from another country
get_task_result(task_id) Get async task result

Error Handling

from mobileproxy import Client, ApiError, AuthenticationError, RateLimitError

client = Client("YOUR_API_TOKEN")

try:
    client.get_balance()
except AuthenticationError as e:
    # Invalid API token
    print(e, e.http_code)
except RateLimitError as e:
    # Too many requests — back off and retry
    # Limit: 3 × (number of active proxies) requests/sec
    print(e)
except ApiError as e:
    print(e.http_code, e.response_body)

Configuration

client = Client(
    "YOUR_API_TOKEN",
    timeout=120,     # request timeout in seconds
    base_url="https://mobileproxy.space/api.html",  # default
)

Rate Limits

API requests are limited to 3 × (number of active proxies) per second. For example, 10 proxies = 30 req/s. The change_ip() method uses a separate endpoint with no rate limit.

Requirements

  • Python 3.8 or higher
  • requests library (installed automatically)

Links

License

MIT — see LICENSE.

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

mobileproxy_sdk-1.0.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

mobileproxy_sdk-1.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file mobileproxy_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: mobileproxy_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for mobileproxy_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 691248dd08614a961d69f3835552e4d022d2f6402bc6d767c863497bc186c297
MD5 8228a68206802dc5d0652418eebfc184
BLAKE2b-256 0657f37111ce30d9c3ebb0112c78abe851cbfb7dd76b439e7ddf1b31f715a114

See more details on using hashes here.

File details

Details for the file mobileproxy_sdk-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mobileproxy_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efa76e9470a0bbb5889a253a93815b70b131081012944e61116192b2a1d44c53
MD5 02179d878e09801353d9351975813527
BLAKE2b-256 edb1ae364e3189a86149068237db019e5501b148a1d8a2ba65b503cab8956034

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