Add your YouTube URL as a query parameter:
https://chan.dev/get-thumbnail?url=https://www.youtube.com/watch?v=SPwPpsXpZfg
This will redirect you to the maximum resolution thumbnail for that video.
https://www.youtube.com/watch?v=VIDEO_ID
https://youtu.be/VIDEO_ID
https://www.youtube.com/embed/VIDEO_ID