Skip to main content

Unofficial Python client for Firefox Relay

Project description

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

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

firefox_relay_api-0.1.0.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

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

firefox_relay_api-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file firefox_relay_api-0.1.0.tar.gz.

File metadata

  • Download URL: firefox_relay_api-0.1.0.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for firefox_relay_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff0d003190b5a7791510bf0e7024b6a43dbc2669cb033dffdf27343db4a66190
MD5 9d49e8ae96beecb45f08d8b78b0746c9
BLAKE2b-256 e103d69ae7d21d5e8dfeb62972e2c5a3e5f14ba3a1267d8e7ecc226756b4f4b4

See more details on using hashes here.

File details

Details for the file firefox_relay_api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: firefox_relay_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for firefox_relay_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca685e91f4f67fc46e0da37fcfc1b12f93b41053a8bcb4943ef91edbc72e552b
MD5 ebfa146cae3e9d81fa9ab696981aebbc
BLAKE2b-256 9d03e0e387e7b631c985a3840e65dac4fbb256c61171e9cf35c6ce732555448a

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