Peripheral nerves are anisotropic and heterogeneous neural tissues. Their complex physiology restricts realistic in vitro models, and high resolution and selective probing of axonal activity. Here, we present a nerve-on-a-chip platform that enables rapid extracellular recording and axonal tracking of action potentials collected from tens of myelinated fibers. The platform consists of microfabricated stimulation and recording microchannel electrode arrays. First, we identify conduction velocities of action potentials traveling through the microchannel and propose a robust data-sorting algorithm using velocity selective recording. We optimize channel geometry and electrode spacing to enhance the algorithm reliability. Second, we demonstrate selective heat-induced neuro-inhibition of peripheral nerve activity upon local illumination of a conjugated polymer (P3HT) blended with a fullerene derivative (PCBM) coated on the floor of the microchannel. We demonstrate the nerve-on-a-chip platform is a versatile tool to optimize the design of implantable peripheral nerve interfaces and test selective neuromodulation techniques ex vivo.