Skip to content
mcuee edited this page Apr 29, 2026 · 34 revisions

Welcome to the HIDAPI wiki!

For cross platform communication with HID devices, libusb project recommends HIDAPI.

Supported Environments

Linux [status: Stable]

Any modern Linux system with either hidraw or libusb-1.0. Take note hidraw will support different transport like USB and Bluetooth.

macOS / Mac OS X [status: Stable]

Any modern version of macOS (PowerPC or x86 either in 32 and 64 bits or Apple Silicon) Note: the device should be be bound to the kernel HID driver.

Windows [status: Stable]

Windows 7 and later, USB HID device, Bluetooth/BLE HID device, I2C HID device, etc

FreeBSD [status: Stable]

Only device with ugen driver are supported, using libusb backend. hidapi PR #730 will add hidraw backend.

OpenBSD [status: EXPERIMENTAL]

Only device with ugen driver are supported, using libusb backend

NetBSD [status: EXPERIMENTAL]

Only device with uhid driver are supported, using uhid backend. Using libusb backend may be possible as well but you may need to rebuild the kernel.

Android [status: EXPERIMENTAL]

As of now, hidraw backend may not work. You may want to try libusb backend.

HIDAPI versioning

HIDAPI follows (at least tries to) the Semantic Versioning scheme. Even though we're still at version 0.x.y - we're doing our best to keep backward compatibility across releases.

Various related projects and repositories

libusb -- https://github.com/libusb/libusb/wiki

Original version of hidapi -- https://github.com/signal11/hidapi

hidapi fork with an hid report parser based on the above old version of hidapi -- https://github.com/supercollider/hidapi

hidapitester command line tool based on HIDAPI -- https://github.com/todbot/hidapitester

hidpytoy: GUI tool based on HIDAPI -- https://github.com/todbot/hidpytoy

Python binding for HIDAPI cython-hidapi -- https://github.com/trezor/cython-hidapi

nodejs binding -- https://github.com/node-hid/node-hid.git

Rust binding -- https://github.com/ruabmbua/hidapi-rs

Single header C++23 wrapper -- https://github.com/acdemiralp/hid.hpp

Java binding -- https://github.com/gary-rowe/hid4java

QT wrapper for HIDAPI -- https://github.com/simonmeaden/qhidapi

Ruby binding -- https://rubygems.org/gems/hidapi/

C++ wrapper -- https://github.com/sensics/HIDAPIpp

.NET binding -- https://github.com/badcel/HidApi.Net.git and https://github.com/alexgubanow/hidapiw

Go binding -- https://github.com/sstallion/go-hid

WIP Kotlin Native binding -- https://git.sr.ht/~z3ntu/kotlin-native-hidapi

Free Pascal bindings for HIDAPI -- https://github.com/dioannidis/HIDAPI.pas

Erlang binding (requires a fork version of hidapi) -- https://github.com/tonyrog/hid

FAQ

  1. hidapi is not thread-safe in general. How to use hidapi in multithreaded application?
  1. How to use hidapi with unrooted Android devices
  1. Platform-specific behaviors and limitations (Windows backend, Bluetooth, etc.)
  1. How to build hidapi under NetBSD? You need to use CMake.

Something like the following.

cmake .. -D HIDAPI_BUILD_HIDTEST=1  -D CMAKE_C_FLAGS=-I/usr/pkg/include -D CMAKE_EXE_LINKER_FLAGS=-R/usr/pkg/lib -DCMAKE_INSTALL_PREFIX=/usr/pkg

Links to platform specific HID information

  1. Windows HID Transport

https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/hid-transports

https://github.com/MicrosoftDocs/windows-driver-docs/blob/staging/windows-driver-docs-pr/hid/hid-transports.md

  1. Linux HID transport and hidraw

https://github.com/torvalds/linux/blob/master/Documentation/hid/hid-transport.rst

https://github.com/torvalds/linux/blob/master/Documentation/hid/hidraw.rst