Skip to main content

i8.ae

i8.ae Python Library


Table of contents

About

  • Python client for the i8.ae URL shortener — API docs
  • advantages
    • FREE to use
    • password-protect links
    • every field the API documents (custom, expiry, domain, campaign, deeplink, …) passed straight through
    • typed exceptions, connection pooling, configurable timeout

Installation

pip install i8.ae

Requires Python 3.9+.

API key

Example Usage

from i8_ae import i8

client = i8("YOUR_API_KEY")

# link shortener
short = client.short("https://github.com/")
print(short)  # Output: https://i8.ae/ETyxT

# link shortener (with password)
short = client.short("https://github.com/", "pass")
print(short)  # Output: https://i8.ae/WSRdf

# any other documented field is forwarded as-is
short = client.short(
    "https://github.com/",
    custom="github",
    expiry="2030-01-01 00:00:00",
)
print(short)  # Output: https://i8.ae/github

# request timeout in seconds (default 10)
client = i8("YOUR_API_KEY", timeout=30)

Error handling

from time import sleep
from i8_ae import i8, I8Error, AuthError, RateLimitError, RequestError, APIError

client = i8("YOUR_API_KEY")

try:
    short = client.short("https://github.com/")
except RateLimitError as e:
    print("throttled, retry after header:", e.reset)
except AuthError:
    print("bad or expired API key")
except I8Error as e:
    print(e, "status:", e.status, "error code:", e.error)
Exception Raised when
AuthError HTTP 401 / 403 — missing, invalid or expired key
RateLimitError HTTP 429 — carries .reset (X-RateLimit-Reset header)
RequestError timeout, DNS, TLS or connection failure
APIError API returned error != 0, a non-JSON body, or a payload without shorturl
I8Error base class — catches all of the above

Rate limit

The API allows 30 requests per minute. On HTTP 429 a RateLimitError is raised and .reset holds the X-RateLimit-Reset response header.

Release files for i8.ae 2.1.0

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

Source distribution (sdist)

Source distribution for i8.ae 2.1.0
File Size Uploaded
i8_ae-2.1.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for i8.ae 2.1.0
File Interpreter ABI Platform
i8_ae-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / i8_ae-2.1.0.tar.gz

Download URL i8_ae-2.1.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5fb0070a82900f62a6eea9200deb746f3b3276065eb5458a48f40d84520b7567
BLAKE2b-256 checksum
How to use checksums
089b937c9e9d03741b8e6b11a90d11cb3675b0c1e055e4a8e66fe03f9f2233cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / i8_ae-2.1.0-py3-none-any.whl

Download URL i8_ae-2.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa372e2497cb58b785e15573ba211869b221651f69c4ede50d7bc67c3756a29f
BLAKE2b-256 checksum
How to use checksums
83f6061d7425d9933ca585e67ecf2f1654b9dc215bcf2b57ccc4b87013e0b546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.0

2 release files

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