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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3372af08874ee3047dd30fdf99d7e29863fb921488163973540e083be86159a
|
|
| MD5 |
86e34c6d04429cca6fe0c74d2606b12d
|
|
| BLAKE2b-256 |
8fcbb56ad107b43cf1a81349fe80f3243f036e8b15eae34ac5750eaed833c09f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mac_vendors_sdk-1.0.0.tar.gz -
Subject digest:
e3372af08874ee3047dd30fdf99d7e29863fb921488163973540e083be86159a - Sigstore transparency entry: 2226554058
- Sigstore integration time:
-
Permalink:
mac-vendors/mac-vendors-sdk@6ac48179f8c93a7ef0c1a7f4b200f8ade2de52c0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/mac-vendors
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6ac48179f8c93a7ef0c1a7f4b200f8ade2de52c0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mac_vendors_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mac_vendors_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d27394909899697aab89ad4dc10c282d5ddb9dc2615d9f84df2bda8bd166b90c
|
|
| MD5 |
b13b946b0013fe9fc6ae3b272d56cdca
|
|
| BLAKE2b-256 |
49ca02cce2dc7fd7f57a2eff213283282d463ed1ec69f55b4cd676eb8e1b896f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mac_vendors_sdk-1.0.0-py3-none-any.whl -
Subject digest:
d27394909899697aab89ad4dc10c282d5ddb9dc2615d9f84df2bda8bd166b90c - Sigstore transparency entry: 2226554127
- Sigstore integration time:
-
Permalink:
mac-vendors/mac-vendors-sdk@6ac48179f8c93a7ef0c1a7f4b200f8ade2de52c0 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/mac-vendors
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6ac48179f8c93a7ef0c1a7f4b200f8ade2de52c0 -
Trigger Event:
release
-
Statement type: