How to add link previews in django?

720 Views Asked by At

I'm doing a chat app in python Django and I Want to implement Link preview while typing that ink in chat box. Anybody familiar with this please help.

1

There are 1 best solutions below

0
On BEST ANSWER

You can use a Link preview API service - [1]: https://www.linkpreview.net/ Try this code .

$.ajax({
            url: "https://api.linkpreview.net",
            dataType: 'jsonp',
            data: {q: "message URL", key: 'your API key'},
            success: function (response) {
                let data=response;        
                console.log(data);
            }
        });