I've tried to create embed youtube links feature for my site with 3-5+ options but it seems to be trickier than that.
It doesn't stick the same way it does in whatsapp or discord.
How to get links to transfer the thumbnail and meta data successfully?
It sounds like you're hitting the "metadata wall." Getting those links to "stick" with a nice preview, just like they do on Discord or WhatsApp is actually a lot sneakier than it looks.
The main reason your 3-5 options aren't pulling the thumbnail is because of CORS. If your site tries to "ask" YouTube for that data directly from the user's browser, YouTube's security blocks it. Discord gets around this by using a Back-end Crawler to fetch the data for you.
Here is the breakdown of how to actually make those previews show up:
1. The "Official" Way (oEmbed)
YouTube has a specific "handshake" protocol called oEmbed. You don’t even need an API key for this.
The URL:
https://www.youtube.com/oembed?url=[VIDEO_URL]&format=json
The Result: If you fetch this URL from your server, it returns a clean JSON package with the title, author_name, and most importantly, the thumbnail_url.
2. The "Easy" Way (Metadata APIs)
If you don't want to build a scraper from scratch, you can use a service like Microlink or Iframely.
You send them the link, and they send you back the "unfurled" data (title, description, and image) ready to be styled. It's basically a "Preview as a Service" and handles all the edge cases for you.