Free plan

Link Preview

See the title and picture a shared link will show
POST
/v1/documents/link-preview

About this tool

When you share a web address in a chat or on social media, it often shows a small card with a title, a short description and a picture. This tool shows what that card will contain for any public page. Give a web address, or paste the code of the page. It reads the page only and does not change it.
For example, you want to check how your new blog post will look when someone shares it in a chat.

How to use it

  1. Choose this tool.
  2. Type the web address of the page, or paste the page code instead.
  3. Press Generate.
  4. Read the title, description and picture shown.

What you get back

You get the title, description, picture address, site name and icon on screen. You can copy them.
GOOD TO KNOW
No result file: the answer is data. The page is only read as text: no script runs and the picture is not downloaded. Counts as one document.
TEST IT LIVE

Try Link Preview in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/link-preview
Tool ID
documents.link-preview
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/link-preview" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'url=https://example.com/blog/my-post' \
  -F 'html=<h1>Hello</h1>' \
  -F 'base_url=https://example.com/blog/'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.linkPreview({
    "url": "https://example.com/blog/my-post",
    "html": "<h1>Hello</h1>",
    "base_url": "https://example.com/blog/"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->linkPreview([
    'url' => 'https://example.com/blog/my-post',
    'html' => '<h1>Hello</h1>',
    'base_url' => 'https://example.com/blog/',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Get what a chat app or social network shows for a web address: the title, description, picture, site name, icon, type and the address the page really lives at. Give a web address or the page source.

Link Preview works from text and settings, so no file is needed. Every input is optional.

Link Preview is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/documents/link-preview with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.