Skip to main content

mac-vendors-sdk

Async HTTP client SDK for the MAC Vendors public REST API.

It is a thin, typed wrapper over the hosted service at https://mac-vendors.lizardsystems.com/api/v1. The base URL is fixed (not configurable). Every endpoint maps to one async method that returns a Pydantic v2 model.

Install

pip install mac-vendors-sdk

Authentication

The API accepts either an API key (sent as the X-API-Key header) or a JWT bearer token (sent as Authorization: Bearer <token>). Provide whichever you have:

from mac_vendors_sdk import MacVendorsAPI

api = MacVendorsAPI(api_key="your-api-key")
# or
api = MacVendorsAPI(token="your-jwt")

Usage

import asyncio
from mac_vendors_sdk import MacVendorsAPI

async def main() -> None:
    async with MacVendorsAPI(api_key="key") as api:
        # Single lookup
        result = await api.lookup("00:50:56:AA:BB:CC")
        print(result.vendor, result.found)

        # Historical lookup
        old = await api.lookup("005056AABBCC", as_of="2020-01-01T00:00:00Z")

        # MAC assignment history
        history = await api.lookup_history("00:50:56:AA:BB:CC")

        # Batch lookup (requires a plan with the batch_lookup feature)
        batch = await api.batch_lookup(["005056AABBCC", "001122334455"])

        # List / search vendors
        page = await api.list_vendors(name="VMware", page=1, page_size=50)
        matches = await api.search_vendors("apple", limit=10)
        top = await api.top_vendors(limit=15)

        # Vendor detail / history / point-in-time
        assignments = await api.vendor_assignments("VMware, Inc.")
        vhist = await api.vendor_history("VMware, Inc.")
        version = await api.vendor_at("VMware, Inc.", as_of="2022-06-01T00:00:00Z")

        # Reference data and stats
        countries = await api.countries()
        stats = await api.database_stats()

        # Exports
        exports = await api.list_exports()
        await api.download_export("sqlite", "vendors.sqlite")

asyncio.run(main())

Errors

Non-2xx responses raise a typed exception (all subclasses of MacVendorsApiError):

Status Exception
401, 403 AuthError
404 NotFoundError
429 RateLimitError (exposes .retry_after from the Retry-After header)
other MacVendorsApiError

Each carries .status_code, .detail (parsed from FastAPI's {"detail": ...} body when present), and .response.

from mac_vendors_sdk import MacVendorsAPI, NotFoundError, RateLimitError

async with MacVendorsAPI(api_key="key") as api:
    try:
        await api.lookup_history("00:00:00:00:00:00")
    except NotFoundError as exc:
        print("not found:", exc.detail)
    except RateLimitError as exc:
        print("retry after", exc.retry_after, "seconds")

Custom HTTP client

You can inject your own httpx.AsyncClient (for custom transports, proxies, or shared connection pools). When you do, you own its lifecycle and must set the base URL (https://mac-vendors.lizardsystems.com/api/v1) and auth headers yourself:

import httpx
from mac_vendors_sdk import MacVendorsAPI

client = httpx.AsyncClient(
    base_url="https://mac-vendors.lizardsystems.com/api/v1",
    headers={"X-API-Key": "key"},
)
api = MacVendorsAPI(client=client)
# api.aclose() will NOT close an injected client.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mac_vendors_sdk-1.0.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

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

mac_vendors_sdk-1.0.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mac_vendors_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for mac_vendors_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e3372af08874ee3047dd30fdf99d7e29863fb921488163973540e083be86159a
MD5 86e34c6d04429cca6fe0c74d2606b12d
BLAKE2b-256 8fcbb56ad107b43cf1a81349fe80f3243f036e8b15eae34ac5750eaed833c09f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mac_vendors_sdk-1.0.0.tar.gz:

Publisher: publish.yml on mac-vendors/mac-vendors-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for mac_vendors_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d27394909899697aab89ad4dc10c282d5ddb9dc2615d9f84df2bda8bd166b90c
MD5 b13b946b0013fe9fc6ae3b272d56cdca
BLAKE2b-256 49ca02cce2dc7fd7f57a2eff213283282d463ed1ec69f55b4cd676eb8e1b896f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mac_vendors_sdk-1.0.0-py3-none-any.whl:

Publisher: publish.yml on mac-vendors/mac-vendors-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.0.0

2 files

This release

1.0.0 This release

2 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