Detect product in user history and custom load download links on site

We have a digital product we are selling and I’d like to detect a logged-in Snipcart user who has purchased this item and display a link to it on the product page, in case the order confirmation goes to junk mail or they delete it and don’t save the files.

I also have a video that goes along with the product that’s too large for the downloadable files on Snipcart. Ideally, I would be able to tell if they’ve purchased the product and display those links on the product page instead of the purchase button.

I haven’t had any success with the API code because I haven’t yet seen the full set of code lines I’d need (there are a lot of assumptions in the help files about how much knowledge I bring to the table). If you’re able to help, please include everything I need in the page, opening the connection to closing it.

Thanks so much for any help!