According to the source code, `ip neigh show` output is based on `rtnetlink` messages from the kernel.
See `netlink(7)` man page for an example on how to operate a (rt)netlink socket, and the above-mentioned `rtnetlink(7)` man page for the necessary constants. I guess you'd want a `RTM_GETNEIGH` message.