Python script to get device vendor name from MAC Address Last Updated : 07 Sep, 2022 Comments Improve Suggest changes Like Article Like Report Prerequisite: Python Requests A MAC address is a unique identity of a network interface that is used to address the device in a Computer Network. What does MAC Address consist of? A MAC address is made up of 12 hexadecimal digits, 6 octets separated by ':'. There are 6 octets in a MAC address. In the first half, the manufacturer info is stored. How do we get the Manufacturer details? For this article, we will be using an API that will fetch the MAC Address for us. We will use a Python script to automate the fetching process so that we can use it later in the Softwares and websites that may require this functionality. We will use requests module to work with this API. Below is the implementation. Python3 import requests import argparse print("[*] Welcome") # Function to get the interface name def get_arguments(): # This will give user a neat CLI parser = argparse.ArgumentParser() # We need the MAC address parser.add_argument("-m", "--macaddress", dest="mac_address", help="MAC Address of the device. " ) options = parser.parse_args() # Check if address was given if options.mac_address: return options.mac_address else: parser.error("[!] Invalid Syntax. " "Use --help for more details.") def get_mac_details(mac_address): # We will use an API to get the vendor details url = "https://api.macvendors.com/" # Use get method to fetch details response = requests.get(url+mac_address) if response.status_code != 200: raise Exception("[!] Invalid MAC Address!") return response.content.decode() # Driver Code if __name__ == "__main__": mac_address = get_arguments() print("[+] Checking Details...") try: vendor_name = get_mac_details(mac_address) print("[+] Device vendor is "+vendor_name) except: # Incase something goes wrong print("[!] An error occurred. Check " "your Internet connection.") Save this code as macdetails.py. We can use '-h' or '--help' to see the help on how to run this script from the terminal. Output : Comment More infoAdvertise with us Next Article Python script to get device vendor name from MAC Address M mukulbindal170299 Follow Improve Article Tags : Python python-utility Python-requests Python-projects Python web-scraping-exercises +1 More Practice Tags : python Similar Reads How to get value from address in Python ? In this article, we will discuss how to get the value from the address in Python. First, we have to calculate the memory address of the variable or python object which can be done by using the id() function. Syntax: id(python_object) where, python_object is any python variable or data structure like 4 min read Python - tensorflow.DeviceSpec.parse_from_string() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. parse_from_string() is used to parse a DeviceSpec name into its components. Syntax: tensorflow.DeviceSpec.parse_from_string( spec ) Parameters: spec: It is a string of 1 min read Python - tensorflow.DeviceSpec.from_string() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. from_string is used to generate DeviceSpec from string. Syntax: tensorflow.DeviceSpec.from_string( spec ) Parameters: spec: It is a string of the form  /job:/replica:/t 1 min read Extracting MAC address using Python MAC address also known as physical address is the unique identifier that is assigned to the NIC (Network Interface Card) of the computer. NIC helps in connection of a computer with other computers in the network. MAC address is unique for all the NIC's. Uses of MAC address : Useful in places where I 3 min read How to Disconnect Devices from Wi-Fi using Scapy in Python? Without permission, disconnecting a device from a Wi-Fi network is against the law and immoral. Sometimes, you might need to check your network's security or address network problems. You may send a de-authentication packet to disconnect devices from Wi-Fi using Scapy, a potent Python packet manipul 5 min read Like