A simple MAC Address to Manufacturer Information json response.
PHP based webserver
On first run the script will download the latest oui.txt file from the IEEE OUI registry (the source can be changed within the script).
To receive a JSON reply with the MAC address manufacturer, pass the MAC address in the query string.
For example: ?mac=08:00:20
would return
{
"query": "08:00:20",
"hex": "08-00-20",
"base16": "080020",
"company": "Oracle Corporation",
"data_source": "November 27 2019 20:08",
"querytime": "0.0522ms",
"peakmemory": "379KB"
}
Note: you can see the data_source date in the response.
Periodically you may wish to update the oui.txt file from the original source.
To achieve this include &refresh=yes on the end of a request.
This request will take longer as it will re-download the oui.txt file before responding. For safety, refreshes are rate-limited (default: once per 10 minutes).
For example: ?mac=08:00:20&refresh=yes
Errors are returned as JSON with appropriate HTTP status codes (e.g. 400 for invalid input, 404 for no match).
Disclaimer: Use at your own peril. Basic error checking is present, and improvements are welcome via PRs.