Welcome to the MAC Vendors API! Our goal is to make our data accessible to anyone that wants to use it. In order to achieve that goal, we wanted to make our API as easy to use as possible. No registration or API key is required for up to 1,000 requests per day at 1 request per second. For higher limits, please checkout the various
plans
we offer. In its most basic form, all that is required is a simple HTTP GET to our api server. If the vendor is found, we return a string. If it's not found, we'll send a "404". Utilizing our API is as simple as sending a request to
https://api.macvendors.com/FC-A1-3E-2A-1C-33
//Accepted MAC Address Formats
Send your MAC address in any shape or form and our server should be able to handle it. Separated by periods? Dashes? Slashes? Separated every 2 characters? 4 characters? Not a problem. Generally, MAC addresses will come in the following shape or form:
00-11-22-33-44-55
00:11:22:33:44:55
00.11.22.33.44.55
001122334455
0011.2233.4455
//Examples
mac_address="FC:FB:FB:01:FA:21"
response=$(curl -s -w "\n%{http_code}" "https://api.macvendors.com/$mac_address")
status=${response##*$'\n'}
body=${response%$'\n'*}
case "$status" in
200) echo "Vendor: $body" ;;
404) echo "Not Found" ;;
# 429: rate limited (1 request/second, 1,000/day without an API key)
*) echo "Request failed with status $status" ;;
esac
const macAddress = "FC:FB:FB:01:FA:21";
const response = await fetch(
`https://api.macvendors.com/${encodeURIComponent(macAddress)}`
);
if (response.ok) {
console.log(`Vendor: ${await response.text()}`);
} else if (response.status === 404) {
console.log("Not Found");
} else {
// 429: rate limited (1 request/second, 1,000/day without an API key)
console.error(`Request failed with status ${response.status}`);
}
import requests
mac_address = "FC:FB:FB:01:FA:21"
response = requests.get(f"https://api.macvendors.com/{mac_address}")
if response.ok:
print(f"Vendor: {response.text}")
elif response.status_code == 404:
print("Not Found")
else:
# 429: rate limited (1 request/second, 1,000/day without an API key)
print(f"Request failed with status {response.status_code}")
require "net/http"
mac_address = "FC:FB:FB:01:FA:21"
uri = URI("https://api.macvendors.com/#{mac_address}")
res = Net::HTTP.get_response(uri)
case res
when Net::HTTPSuccess then puts "Vendor: #{res.body}"
when Net::HTTPNotFound then puts "Not Found"
else
# 429: rate limited (1 request/second, 1,000/day without an API key)
puts "Request failed with status #{res.code}"
end
package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
macAddress := "FC:FB:FB:01:FA:21"
res, err := http.Get("https://api.macvendors.com/" + url.PathEscape(macAddress))
if err != nil {
panic(err)
}
defer res.Body.Close()
switch res.StatusCode {
case http.StatusOK:
body, _ := io.ReadAll(res.Body)
fmt.Printf("Vendor: %s\n", body)
case http.StatusNotFound:
fmt.Println("Not Found")
default:
// 429: rate limited (1 request/second, 1,000/day without an API key)
fmt.Printf("Request failed with status %d\n", res.StatusCode)
}
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class MacLookup {
public static void main(String[] args) throws Exception {
String macAddress = "FC:FB:FB:01:FA:21";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.macvendors.com/" + macAddress))
.build();
HttpResponse<String> response =
HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
switch (response.statusCode()) {
case 200 -> System.out.println("Vendor: " + response.body());
case 404 -> System.out.println("Not Found");
// 429: rate limited (1 request/second, 1,000/day without an API key)
default -> System.out.println("Request failed with status " + response.statusCode());
}
}
}
using System.Net;
var macAddress = "FC:FB:FB:01:FA:21";
using var client = new HttpClient();
var response = await client.GetAsync(
$"https://api.macvendors.com/{Uri.EscapeDataString(macAddress)}");
switch (response.StatusCode)
{
case HttpStatusCode.OK:
Console.WriteLine($"Vendor: {await response.Content.ReadAsStringAsync()}");
break;
case HttpStatusCode.NotFound:
Console.WriteLine("Not Found");
break;
default:
// 429: rate limited (1 request/second, 1,000/day without an API key)
Console.WriteLine($"Request failed with status {(int)response.StatusCode}");
break;
}
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking"] }
use reqwest::{blocking::get, StatusCode};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mac_address = "FC:FB:FB:01:FA:21";
let response = get(format!("https://api.macvendors.com/{mac_address}"))?;
match response.status() {
StatusCode::OK => println!("Vendor: {}", response.text()?),
StatusCode::NOT_FOUND => println!("Not Found"),
// 429: rate limited (1 request/second, 1,000/day without an API key)
status => println!("Request failed with status {status}"),
}
Ok(())
}
import Foundation
let macAddress = "FC:FB:FB:01:FA:21"
let url = URL(string: "https://api.macvendors.com/\(macAddress)")!
let (data, response) = try await URLSession.shared.data(from: url)
let status = (response as! HTTPURLResponse).statusCode
switch status {
case 200:
print("Vendor: \(String(decoding: data, as: UTF8.self))")
case 404:
print("Not Found")
default:
// 429: rate limited (1 request/second, 1,000/day without an API key)
print("Request failed with status \(status)")
}