I used to find it very tedious to lookup MAC addresses manually. I’d have a ton to work through so I had to find a way to automate the process.
Luckily, I found that my good ol’ friend PowerShell could be used in conjunction with a free API provided by macvendors.com. This allowed for MAC addresses to be saved into CSV files and worked through in batches.
I’ve noticed that this post is starting to gain more traffic, so I’ve decided to come back and rework it. Sorry if it’s changed a lot since you last checked it out! – 27th Dec 2024
Before we start, you can also read this article on Medium!
Introduction
If you haven’t seen or heard of macvendors.com before, it’s a super simple website that also exposes an API that allows for easy MAC address lookups. You can see the website below:

The task I was trying to automate was simple:
- Get a system (laptop/desktop) that was ready for destruction
- Search the MAC address online to find out the manufacturer info
- Add it to a list and document the system
Whilst I am simplifying this quite a bit, this is essentially what I had to do.
How to Upgrade MySQL Community to MySQL Enterprise on Red Hat 9
Been a while since I made a post, so let’s jump straight back in with…
How to Setup WordPress Backups (FREE!)
Personally, I like my website. A lot. And I wouldn’t want one mistake to make…
Install NGINX on an Offline RHEL System – 2 Systems Required!
Been a while since my previous post, but let’s hope the magic hasn’t rubbed off…
MySQL 8.4 Replication with SSL on Ubuntu 22.02
So I recently wrote a post and made a YouTube video on setting up MySQL…
Gutenberg Just Broke my Website
More of a story and vent than an informative article. So to save you reading…
How to Design a Website in 5 Steps
Rather than manually enter MAC addresses into the website, I saw that it also had a free API available. So I wondered if I could use the Invoke-WebRequest command from PowerShell to blast through my list of MAC addresses.
Lookup MAC Addresses
To perform a MAC address lookup using PowerShell and the macvendors.com API, it’s as simple as running this inside a PowerShell prompt:
$mac_example = "3C-07-71-75-BC-32"
Invoke-WebRequest -Uri "https://api.macvendors.com/$mac_example"
From that request, I received the following information:
StatusCode : 200
StatusDescription : OK
Content : Sony Corporation
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
x-request-id: GBULs4JAkI7OtV0ATx5n
x-do-app-origin: c9cc0578-5d31-4bae-a690-bf01c1952665
x-do-orig-status: 200
CF-Cache-Status: MISS
CF-RAY: 8f89a7211a0b73...
Forms : {}
Headers : {[Connection, keep-alive], [x-request-id, GBULs4JAkI7OtV0ATx5n], [x-do-app-origin,
c9cc0578-5d31-4bae-a690-bf01c1952665], [x-do-orig-status, 200]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : System.__ComObject
RawContentLength : 16
As you can see, this brings back a whole bunch of information that we don’t really want. All we’re interested in is the Content. Whilst you could use Piping to gather this info, the simplest for me is to wrap the request in brackets and return only the Content.
You can do this using:
(Invoke-WebRequest -Uri "https://api.macvendors.com/$mac_example").content
This now nicely returns only the data I’m interested in – “Sony Corporation“
Sony Corporation
Enjoy! 🎉