Looking for recommendations for High Res USB cameras capable of macro photography

Hello! I’m building a coin sorting machine that will automatically sort coins by year and mint stamp. I need a USB Camera that can be controlled by the host computer to take the pictures with enough resolution that OpenCV can do the image recognition to extract (and read) the date stamped on the coin.

Do any of you have recommendations on which camera I should use. So far, looking on eBay and Amazon I’m having trouble finding anything that will work.