MAC Address API use case.
Sometimes you just need to get explicit data for any given MAC Address for your network administration or DEVOPS activities and you can use free RESTful APIs
provided by "WhoisXML API" - don't forget to get your API KEY.
With one API call you will obtain ready to use parsed JSON file with a MAC Address data such as OUI vendor information, manufacturer data and location details,
detect virtual machines, and read the information encoded in a given MAC address.
Python Knowledge Base: Make coding great again.
- Updated:
2024-11-20 by Andrey BRATUS, Senior Data Analyst.
How does it work ?
Python code to perform MAC Address Lookup using API:
MAC Address Lookup output:
This Python script below will use information from "WhoisXML API" and provide you a result in a JSON format without the need to use web a browser.
The process of performing MAC data Lookup for specified Address can be easily automated now !
# MAC Address Lookup API USE
import requests
MAC = '00:00:5e:00:53:ab'
APIKEY ='your-api-key'
MACAddressLookupURL = f'https://mac-address.whoisxmlapi.com/api/v1?apiKey={APIKEY}&macAddress={MAC}&outputFormat=JSON'
r = requests.get(MACAddressLookupURL)
MACAddressLookup = r.json()
print(f'MAC Address Lookup info for {MAC} .\n')
MACAddressLookup
MAC Address Lookup info for 00:00:5e:00:53:ab .
{'vendorDetails': {'oui': '00005E',
'isPrivate': False,
'companyName': 'Icann, Iana Department',
'companyAddress': "INTERNET ASS'NED NOS.AUTHORITY Los Angeles CA 90094-2536 US",
'countryCode': 'US'},
'blockDetails': {'blockFound': True,
'borderLeft': '00005E000000',
'borderRight': '00005EFFFFFF',
'blockSize': 16777216,
'assignmentBlockSize': 'MA-L',
'dateCreated': '1980-01-01',
'dateUpdated': '2015-09-27'},
'macAddressDetails': {'searchTerm': '00:00:5e:00:53:ab',
'isValid': True,
'virtualMachine': 'Microsoft Virtual PC / Virtual Server',
'applications': ['Assigned for use in documentation'],
'transmissionType': 'unicast',
'administrationType': 'UAA',
'wiresharkNotes': 'No details',
'comment': ''}}