Skip to main content

IPLoop Python SDK

HTTP fetching through IPLoop proxies. New-platform accounts use a proxy username/password pair for traffic and a separate API key for account access. Existing key-only integrations retain legacy mode.

Install

python -m pip install 'iploop-sdk[async,socks]>=1.8.2'

Sign up or sign in at https://platform.iploop.io/. Keep API keys and passwords in environment variables, not source code or shared logs.

New platform (V2)

Set IPLOOP_API_KEY, IPLOOP_PROXY_USERNAME and IPLOOP_PROXY_PASSWORD to your own account values. These credentials are separate; the dashboard password is not the proxy password.

import os
from iploop import IPLoop

client = IPLoop(
    api_key=os.environ['IPLOOP_API_KEY'],
    proxy_username=os.environ['IPLOOP_PROXY_USERNAME'],
    proxy_password=os.environ['IPLOOP_PROXY_PASSWORD'],
)
response = client.get('https://example.com', country='US', timeout=15, retries=2)
response.raise_for_status()
print(response.text)

The SDK discovers the current proxy settings from the HTTPS portal metadata endpoint. Passing both proxy credentials explicitly opts into V2; omitting both retains legacy mode. Never replace a customer's working credentials merely to migrate configuration.

Sticky sessions

session = client.session(session_id='my_session1', country='US', lifetime=5)
r1 = session.get('https://api.ipify.org?format=json', retries=1)
r2 = session.get('https://api.ipify.org?format=json', retries=1)

lifetime requests a positive integer duration in minutes, encoded as sesstime for V2. Session IDs accept letters, digits and underscores. Reusing an ID asks for the same session; device availability can force an exit change. Rotating requests can reuse an exit and do not guarantee a never-before-used IP. V2 requests without an explicit session do not acquire an SDK-generated sticky session.

SOCKS5

socks_client = IPLoop(
    api_key=os.environ['IPLOOP_API_KEY'],
    proxy_username=os.environ['IPLOOP_PROXY_USERNAME'],
    proxy_password=os.environ['IPLOOP_PROXY_PASSWORD'],
    proxy_protocol='socks5h',
)
response = socks_client.get('https://example.com', country='GB', retries=1)

Install the socks extra. socks5h resolves target names through the proxy. Async SOCKS is explicitly unsupported in this release; use the synchronous client.

Async HTTP

import asyncio
from iploop import AsyncIPLoop

async def main():
    async with AsyncIPLoop(
        api_key=os.environ['IPLOOP_API_KEY'],
        proxy_username=os.environ['IPLOOP_PROXY_USERNAME'],
        proxy_password=os.environ['IPLOOP_PROXY_PASSWORD'],
    ) as client:
        response = await client.get('https://example.com', country='US', retries=1)
        print(response.status_code)

asyncio.run(main())

Client construction discovers metadata synchronously once; the fetch transport is asynchronous. Account helper methods are synchronous, including when exposed by AsyncIPLoop.

Account helpers

usage = client.usage()
print(usage['account']['balance_gb'])
print(usage['account']['balance_bytes'])
print(usage['daily'])  # last 30 days: day + bytes
status = client.status()  # authenticated account + protocol metadata

balance_bytes is bytes; balance_gb is decimal GB. Daily bytes and account balance are independent readbacks, not one derived from the other. The V2 helper schema differs from legacy support API output.

Feature boundaries

  • Country codes are validated against ISO alpha-2 codes. An accepted code does not guarantee current supply in that location.
  • V2 city targeting and rendering raise an explicit unsupported-feature error; they are not silently routed without the requested constraint.
  • V2 countries() and ask() are explicitly unsupported rather than falling back to unrelated legacy inventory or support systems.
  • The existing extractor modules, cookie handling, headers, TLS integration and batch API remain available. Their existence does not guarantee that every website or anti-bot challenge will succeed. Check returned status/content.
  • stats is SDK request telemetry, not proof of target-site business success or an accounting ledger. Do not treat it as an SLA.

Legacy key-only accounts

from iploop import IPLoop
legacy = IPLoop(os.environ['LEGACY_IPLOOP_API_KEY'])
response = legacy.get('https://example.com', country='US')

Existing constructor arguments and legacy auth generation are retained. Legacy endpoints and support helpers are not the new platform's account API. Do not use the key-only example with V2 credentials.

Errors and retries

Check response status and content before accepting a result. Retry budgets are bounded with the retries and timeout arguments. Retries and rotation cannot guarantee bypass or a fresh exit. Invalid local V2 inputs raise ValueError; known unsupported features raise NotImplementedError; account authentication failures raise AuthError. Connection errors are sanitized in V2 mode so credentials are not repeated in error text.

Metadata

Release files for iploop-sdk 1.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iploop-sdk 1.8.2
File Size Uploaded Provenance Actions
iploop_sdk-1.8.2.tar.gz 67.7 kB Without provenance Details for iploop_sdk-1.8.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for iploop-sdk 1.8.2
File Interpreter ABI Platform Actions
iploop_sdk-1.8.2-py3-none-any.whl Python 3 none any Details for iploop_sdk-1.8.2-py3-none-any.whl

Total release size: 171.2 kB

Release files / iploop_sdk-1.8.2.tar.gz

Download URL iploop_sdk-1.8.2.tar.gz
Size 67.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1713c939dd32b4a2061bfb4154594e9f696e2d2ca7ee972568b7adf9ece13785
BLAKE2b-256 checksum
How to use checksums
787a92c0046e6104f750d153f279cf64daa51415f07f2c0f71070924e57a884d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Release files / iploop_sdk-1.8.2-py3-none-any.whl

Download URL iploop_sdk-1.8.2-py3-none-any.whl
Size 103.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad7ed2003b065d63ca1936a1a8bc9303e4e384908181ec9ba5fe50a36e59b6d8
BLAKE2b-256 checksum
How to use checksums
1d3ec990551048a1e4f74e8df97233e1cf8b7a02744a06e4e592103c385ac90f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.9

Security for iploop-sdk 1.8.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page