Skip to main content

mac-vendors-sdk

PyPI Python versions CI License: MIT

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 (requires a plan with the history feature)
        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, prefixes=4)
        top = await api.top_vendors(limit=15)

        # Vendor detail / history / point-in-time
        assignments = await api.vendor_assignments("VMware, Inc.", page=1)
        if assignments.truncated:
            more = await api.vendor_assignments("VMware, Inc.", page=2)
        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()
        info = await api.database_info()
        alive = await api.health()

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

        # Point-in-time export (requires a plan with the export_asof feature)
        if exports.asof_allowed:
            await api.download_export_as_of("2025-01-01", "vendors-2025.csv")


asyncio.run(main())

Plan-gated endpoints

Some calls need a subscription feature and raise AuthError (403) without it: lookup(as_of=...), lookup_history, vendor_at and the full vendor_history timeline need history; batch_lookup needs batch_lookup; each export format needs its own feature, and download_export_as_of needs export_asof. list_exports() reports per-format allowed and asof_allowed so you can check before calling.

vendor_history is trimmed rather than refused without history: it returns only the current version, sets truncated, and still reports the true total_versions.

Export formats

download_export accepts any identifier in EXPORT_FORMATS: sqlite, csv, json, wireshark, wireshark_legacy, nmap, ieee_oui_txt, the csv_history / sqlite_history SCD-2 dumps, and a _zip variant of each.

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

Metadata

Release files for mac-vendors-sdk 2.0.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 mac-vendors-sdk 2.0.0
File Size Uploaded Provenance
mac_vendors_sdk-2.0.0.tar.gz 20.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mac-vendors-sdk 2.0.0
File Interpreter ABI Platform
mac_vendors_sdk-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.0 kB

Release files / mac_vendors_sdk-2.0.0.tar.gz

Download URL mac_vendors_sdk-2.0.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1454189da007bcad243fe92539aaa693af660491b3726623b9df0956061b02b5
BLAKE2b-256 checksum
How to use checksums
8f7c771878be72b5535eae84192179e17634a37ad9e7a2ab6154c5801326da1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / mac_vendors_sdk-2.0.0-py3-none-any.whl

Download URL mac_vendors_sdk-2.0.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1775dcb5db0ff768dea4a9d02b484fcafbc0eadab6e99ec375f8c2f2d7e161d1
BLAKE2b-256 checksum
How to use checksums
d31cd2af624a2be5dd56c3c2e316cf486c485699b213c8fd23d9752aa1db4848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Security for mac-vendors-sdk 2.0.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mac_vendors_sdk-2.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files Full provenance

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