Overview


Making Requests in the Browser

Once you've generated api token, you can make api requests easily. Here are some examples in client side java script:

Note- Use https:// in the url.

JQuery AJAX

$.ajax({
  url: 'https://unfurl.io/api/v2/preview?api_token=yourapitoken&url=https://www.google.com',
  success: function (result) {
    console.log(result);
  },
});

Fetch Using POST request

fetch('https://unfurl.io/api/v1/api_token=yourapitoken&preview?url=https://www.google.com', {
  method: 'get',
  mode: 'cors',
})
  .then((res) => res.json())
  .then((response) => console.log(response));

A GET request Using Node JS (Axios)

A nodeJS https request using axios.

const axios = require('axios');
axios
  .get('https://unfurl.io/api/preview?api_token=yourapitoken&url=https://www.google.com')
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error);
  });