This task can be performed using SCRNIFY
Powerful screenshot API: From URLs to pixels, made simple.
Best product for this task

SCRNIFY
tech
SCRNIFY is a developer-friendly API service for capturing website screenshots and videos. With features like signed API keys for security and intelligent caching for cost efficiency, it handles the complexities of web page rendering while providing high-quality results. Supporting various output formats and customization options, SCRNIFY makes it easy to integrate automated captures into any workflow, from social media cards to automated testing solutions.

What to expect from an ideal product
- Simply pass any URL to the API, and it returns a perfect social preview image of the webpage
- Smart caching means you don't need to re-generate previews for pages that haven't changed
- Customize the size and format of preview cards to match different social media platforms
- One API call handles all the tricky parts like rendering JavaScript and waiting for content to load
- Preview cards are automatically generated and stored, ready to use whenever you share your links