API

//Intro

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