firefox-relay-api
Unofficial Python client for Firefox Relay. Not affiliated with Mozilla.
⚠️ The Firefox Relay API is not officially documented for third-party use. Endpoints and fields may change without notice.
Install
pip install firefox-relay-api
Requires Python 3.10+.
Quickstart
Get your API key from Relay account settings.
from firefox_relay import FirefoxRelayClient
with FirefoxRelayClient(api_key="your-api-key") as client:
# Create a mask
mask = client.relay_addresses.create(description="for shopping")
print(mask.full_address) # e.g. abc123@mozmail.com
# List all masks
for m in client.relay_addresses.list():
print(m.full_address, "—", m.description)
# Rename
client.relay_addresses.update(mask.id, description="renamed")
# Disable (stop forwarding) without deleting
client.relay_addresses.update(mask.id, enabled=False)
# Delete
client.relay_addresses.delete(mask.id)
Error handling
All errors inherit from RelayError:
from firefox_relay import RelayError, RelayAuthError, RelayRateLimitError
try:
client.relay_addresses.list()
except RelayAuthError:
print("Bad or expired API key")
except RelayRateLimitError as e:
print(f"Rate limited, retry after {e.retry_after}s")
except RelayError as e:
print(f"API error: {e.message} (HTTP {e.status_code})")
Status
v0.1.0 — MVP, supports random masks (/relayaddresses/) only.
Planned for v0.2: domain addresses (premium), profile, runtime data, async client.
License
MIT
Metadata
Release files for firefox-relay-api 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| firefox_relay_api-0.1.0.tar.gz | 36.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| firefox_relay_api-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.9 kB
Release files / firefox_relay_api-0.1.0.tar.gz
| Download URL | firefox_relay_api-0.1.0.tar.gz |
|---|---|
| Size | 36.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ff0d003190b5a7791510bf0e7024b6a43dbc2669cb033dffdf27343db4a66190
|
|
BLAKE2b-256 checksum How to use checksums |
e103d69ae7d21d5e8dfeb62972e2c5a3e5f14ba3a1267d8e7ecc226756b4f4b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / firefox_relay_api-0.1.0-py3-none-any.whl
| Download URL | firefox_relay_api-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca685e91f4f67fc46e0da37fcfc1b12f93b41053a8bcb4943ef91edbc72e552b
|
|
BLAKE2b-256 checksum How to use checksums |
9d03e0e387e7b631c985a3840e65dac4fbb256c61171e9cf35c6ce732555448a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|