Paste a link into Slack, WhatsApp or Twitter and a tidy preview card appears — title, description, image. Try to build that yourself and it falls apart fast: you write a scraper, and then discover redirects, gzip and brotli encoding, HTML entities, relative image paths, pages with no Open Graph tags at all, and sites that block datacenter IPs outright. What started as "just parse two meta tags" becomes a maintenance burden that breaks on the exact URLs your users care about.
This API collapses all of that into a single GET request. Call /preview?url=... and get back a clean JSON object with the page title, description, Open Graph and Twitter card tags, favicon, canonical URL and the best preview image — with relative URLs already resolved to absolute ones. It follows redirects, decodes entities, applies a smart fallback chain (Open Graph → Twitter card → plain HTML) and can route through residential proxies when a site blocks cloud traffic.
Use it for:
- Chat apps and comment sections — unfurl pasted links into cards, like Slack or Discord
- CMS and newsletter tooling — auto-generate link embeds from a URL
- Bookmarking and read-it-later tools — store title, image and description alongside every saved link
- Social feeds — render consistent preview cards even for pages with messy or missing metadata
Batch up to 10 URLs per call with /batch, or validate URLs for free with /validate.
- Subscribe (free tier available) on RapidAPI and copy your
X-RapidAPI-Key. - Call the API — here's the primary endpoint in every major language.
Base URL:
https://link-preview-open-graph-scraper.p.rapidapi.com
curl --request GET \
--url 'https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F' \
--header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header 'X-RapidAPI-Host: link-preview-open-graph-scraper.p.rapidapi.com'import requests
url = "https://link-preview-open-graph-scraper.p.rapidapi.com/preview"
querystring = {"url": "https://www.wikipedia.org/"}
headers = {
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host": "link-preview-open-graph-scraper.p.rapidapi.com",
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json())const url = 'https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F';
const options = {
method: 'GET',
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'link-preview-open-graph-scraper.p.rapidapi.com',
},
};
const response = await fetch(url, options);
console.log(await response.json());import axios from 'axios';
const options = {
method: 'GET',
url: 'https://link-preview-open-graph-scraper.p.rapidapi.com/preview',
params: {url: 'https://www.wikipedia.org/'},
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'link-preview-open-graph-scraper.p.rapidapi.com',
},
};
const { data } = await axios.request(options);
console.log(data);const url = 'https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F';
const response = await fetch(url, {
method: 'GET',
headers: {
'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
'X-RapidAPI-Host': 'link-preview-open-graph-scraper.p.rapidapi.com',
} as Record<string, string>,
});
const data: unknown = await response.json();
console.log(data);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-RapidAPI-Key: YOUR_RAPIDAPI_KEY",
"X-RapidAPI-Host: link-preview-open-graph-scraper.p.rapidapi.com",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;require 'uri'
require 'net/http'
url = URI("https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-RapidAPI-Key"] = 'YOUR_RAPIDAPI_KEY'
request["X-RapidAPI-Host"] = 'link-preview-open-graph-scraper.p.rapidapi.com'
response = http.request(request)
puts response.read_bodyOkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F")
.get()
.addHeader("X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY")
.addHeader("X-RapidAPI-Host", "link-preview-open-graph-scraper.p.rapidapi.com")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());using var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F"),
Headers =
{
{ "X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY" },
{ "X-RapidAPI-Host", "link-preview-open-graph-scraper.p.rapidapi.com" },
},
};
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F", nil)
req.Header.Add("X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY")
req.Header.Add("X-RapidAPI-Host", "link-preview-open-graph-scraper.p.rapidapi.com")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}use reqwest::header::{HeaderMap, HeaderValue};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut headers = HeaderMap::new();
headers.insert("X-RapidAPI-Key", HeaderValue::from_static("YOUR_RAPIDAPI_KEY"));
headers.insert("X-RapidAPI-Host", HeaderValue::from_static("link-preview-open-graph-scraper.p.rapidapi.com"));
let client = reqwest::Client::new();
let res = client.get("https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F").headers(headers).send().await?;
println!("{}", res.text().await?);
Ok(())
}import Foundation
var request = URLRequest(url: URL(string: "https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F")!)
request.httpMethod = "GET"
request.setValue("YOUR_RAPIDAPI_KEY", forHTTPHeaderField: "X-RapidAPI-Key")
request.setValue("link-preview-open-graph-scraper.p.rapidapi.com", forHTTPHeaderField: "X-RapidAPI-Host")
let (data, _) = try await URLSession.shared.data(for: request)
print(String(data: data, encoding: .utf8)!)val client = OkHttpClient()
val request = Request.Builder()
.url("https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F")
.get()
.addHeader("X-RapidAPI-Key", "YOUR_RAPIDAPI_KEY")
.addHeader("X-RapidAPI-Host", "link-preview-open-graph-scraper.p.rapidapi.com")
.build()
val response = client.newCall(request).execute()
println(response.body?.string())wget -qO- \
--header='X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
--header='X-RapidAPI-Host: link-preview-open-graph-scraper.p.rapidapi.com' \
'https://link-preview-open-graph-scraper.p.rapidapi.com/preview?url=https%3A%2F%2Fwww.wikipedia.org%2F'| Method | Path | Description |
|---|---|---|
GET |
/preview |
Get a ready-to-render link preview for a URL |
GET |
/og |
Extract only the Open Graph tags from a URL |
GET |
/twitter |
Extract only the Twitter card tags from a URL |
GET |
/metadata |
Get every raw meta and link tag from a URL |
GET |
/validate |
Validate and dissect a URL without fetching it |
POST |
/batch |
Preview up to 10 URLs in a single request |
Read the full guide: How to build Slack-style link previews from any URL with one GET request
⭐ Powered by the Link Preview & Open Graph Scraper API on RapidAPI.