getmac
Get MAC addresses of remote hosts and local interfaces
Decision gist · record as of 2026-08-14
Yes. getmac is lightweight, dependency-free, actively maintained, and covers a genuine need for cross-platform MAC address lookup without C extensions. It is well-suited for network diagnostics, device discovery, and inventory tasks. The trade-off is that it relies on ARP/NDP tables and may be slower than C-based alternatives like psutil for high-volume queries, but for typical use cases the simplicity and portability outweigh that cost.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Remote host MAC lookup requires the ARP/NDP table to be populated; by default getmac sends a UDP packet to the target (port 55555) to trigger this, which can be disabled with network_request=False.
- Low friction: pure-Python wheel with zero runtime dependencies and a small footprint.
- Actively maintained as of August 2026 with recent commits; suitable for production use.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2024-07-16 (759 days) · last repo commit 2026-08-06 · 89 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 385,828 downloads/mo, #7,059 on PyPI
Alternatives
Verify before relying
pip install getmac
from getmac import get_mac_address
# Get MAC of a local interface
eth_mac = get_mac_address(interface="eth0")
# Get MAC of a remote host by IP
ip_mac = get_mac_address(ip="192.168.0.1")- Relative performance compared to alternatives like psutil or netifaces in typical workloads
- Success rate of MAC resolution across different network topologies and configurations
- Whether Python 3.10+ support is tested in CI or only claimed to work
What it is and what it does
getmac is a pure-Python library that retrieves MAC (Media Access Control) addresses from local network interfaces and remote hosts on the same LAN. It provides a single function, `get_mac_address()`, that accepts either an interface name, IPv4/IPv6 address, or hostname and returns the corresponding MAC address. The package works across Windows, macOS, Linux, BSD, and other POSIX systems without requiring compiled C extensions.
The library handles remote host lookups by querying the system's ARP (Address Resolution Protocol) or NDP (Neighbor Discovery Protocol) table. For hosts not yet in the table, it can optionally send a UDP packet to populate the table first. It also offers a command-line tool for one-off lookups and supports Python 2.7 and 3.4 through 3.11, making it suitable for legacy and modern codebases alike.
Use it for
- Identify which physical network interface a service is bound to by retrieving its MAC address for logging or diagnostics.
- Resolve a remote host's MAC address on the LAN for network inventory, device discovery, or ARP spoofing detection.
- Build a cross-platform network diagnostic tool that needs MAC addresses without adding C-extension dependencies.
- Populate a local device database by querying MAC addresses of known hosts on a corporate network.
- Implement network-based device authentication or access control that keys off MAC addresses.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
getmac is lightweight, dependency-free, actively maintained, and covers a genuine need for cross-platform MAC address lookup without C extensions. It is well-suited for network diagnostics, device discovery, and inventory tasks. The trade-off is that it relies on ARP/NDP tables and may be slower than C-based alternatives like psutil for high-volume queries, but for typical use cases the simplicity and portability outweigh that cost.
Install
getmac on PyPI
Before you install
Low friction: pure-Python wheel with zero runtime dependencies and a small footprint. Actively maintained as of August 2026 with recent commits; suitable for production use.
Remote host MAC lookup requires the ARP/NDP table to be populated; by default getmac sends a UDP packet to the target (port 55555) to trigger this, which can be disabled with network_request=False.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install getmac
from getmac import get_mac_address
# Get MAC of a local interface
eth_mac = get_mac_address(interface="eth0")
# Get MAC of a remote host by IP
ip_mac = get_mac_address(ip="192.168.0.1")
Verify before relying
- Relative performance compared to alternatives like psutil or netifaces in typical workloads
- Success rate of MAC resolution across different network topologies and configurations
- Whether Python 3.10+ support is tested in CI or only claimed to work
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 759 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 385,828 / month, #7,059 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: IronPythonProgramming Language :: Python :: Implementation :: JythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: NetworkingTopic :: System :: Systems AdministrationTopic :: Utilities |
Evidence: getmac-0.9.5-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “get mac address network interface”
- getmacRetrieves MAC addresses of local network interfaces and remote hosts…
- netifaces-plusRetrieves network interface information (addresses, gateways, MAC…
- netifacesProvides portable access to network interface information (addresses,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also aiodiscover · netifaces-plus · netifaces2 · netifaces · ifaddr · ifcfg · wakeonlan · randmac · macaddress · mac-vendor-lookup