Access OpenSea 'collection' names of NFTs in a wallet

I’d like to work write code that applies conditional logic on a website if an NFT from a certain collection is held in a specific wallet (for example, I own a punk so the website detects this).

It’s been hard to follow the metamask documentation to see if this is possible. Any recommendations on how to get started?