Link preview data is not always available—sadly.
Maybe you need to get the header image from a WordPress post, or you’re building a Notion database with links, and would like to enrich it? If so, then this guide is for you. Here’s a few easy steps on how to set that up, with the help of a free API.
This is the data that we’ll retrieve:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/f2697c49-66e8-46bf-8366-c051d893f555.png)
Let’s go!
1) Creating an API key
Scouring the internet, I found a couple of APIs that return link preview data. The one I landed on is called URL Meta
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/4726e418-8b6f-4d42-887d-efada61b0ef7.png)
Create an API key on https://urlmeta.org/.
Once an account has been created, you’ll be able to copy your API key:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/54970164-11d8-4613-968c-00e4bb41ed9b.png)
2) Base 64 encode your credentials
As per the API docs, we’ll need to base encode the:
email:apiKeyHere
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/c34773d7-e549-4623-9d34-97d28e3c024e.png)
And use the Authorization Basic header (more on that later). We’ll head to this link first:
Then fill out the following details—and take these steps:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/7ea51829-0443-454d-a718-5732bb31a021.png)
- Add your email address, followed by a colon, then the API key
- Click on the ENCODE button
- Copy everything that appears in the box
3) Setting up a custom request in Webhooks by Zapier
Now comes the easiest part! Here’s how it’s going to look:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/11836c92-b167-4f7f-bc92-d65b6e768572.png)
- We’ll select the Custom Request in Webhooks by Zapier action
- Select GET
- Add the URL https://api.urlmeta.org/?url=XXX (and replace XXX with a mapped object from a previous step/or hard code it by manually typing something out)
- Add the `Authorization` header, then use `Basic baseEncodedValueHere`)
- Ready for testing!
The output:
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/06df0206-e516-42e8-addf-b964478a0d9e.png)
And there you have it! We have a solution to dynamically retrieve link preview data.
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/f8972c3b-05ef-4ced-9fc8-7e477154efde.png)
Hope that helps!