TL;DR Getting accurate network metrics on macOS is possible using sysctl() with NET_RT_IFLIST2. Traffic metrics are exposed in units of 1KiB to prevent fingerprinting (only for 3rd party programs). As of macOS Ventura 13.2.1, there’s a kernel bug which truncates traffic values at the 4GiB mark. Using getifaddrs() only exposes 32bit fields, so it’s not a viable API on modern systems. Updates Mojo_66 pointed out that IFMIB_IFDATA does not suffer from truncation (code).