Link preview / metadata
POST https://tools.yukai.uk/api/v1/metadata
Get link-preview metadata for a URL. Reads the page's head (Open Graph, Twitter Card, icons, feeds, JSON-LD) and returns normalized preview fields. Missing Open Graph fields fall back to JSON-LD (image, author, dates, publisher, logo); socialProfiles lists the site's own profile links; warning is login_wall or no_metadata when the answer is not a useful preview (e.g. a login redirect, or only the site name as title).
Cost
Credits: 18 ($0.0018) per successful call. Failed calls are free. Source price: link-preview-metadata/url-previewed.
Input
Send a JSON body (POST) or the same fields as a query string (GET).
Required: url.
| Field | Type | Default | Description |
|---|---|---|---|
url required | string | Page URL. A bare domain such as example.com is accepted (https is assumed). Private, local and cloud-metadata addresses are refused. | |
render | string | "never" | never (default): plain HTTP only, fast and cheap. auto: a real Chrome browser when the site blocks plain requests or needs JavaScript. always: browser only. |
timeoutMs | integer | 15000 | Page-load timeout in milliseconds. |
Examples
Replace tt_live_XXXX with your key from the pricing page.
curl
curl -i -X POST "https://tools.yukai.uk/api/v1/metadata" \
-H "Authorization: Bearer tt_live_XXXX" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'JavaScript (fetch)
const res = await fetch("https://tools.yukai.uk/api/v1/metadata", {
method: "POST",
headers: { "Authorization": "Bearer tt_live_XXXX", "Content-Type": "application/json" },
body: JSON.stringify({"url":"https://example.com"}),
});
console.log(res.status, res.headers.get("x-credits-charged"), res.headers.get("x-credits-balance"));
console.log(await res.json());Python (requests)
import requests
r = requests.post(
"https://tools.yukai.uk/api/v1/metadata",
headers={"Authorization": "Bearer tt_live_XXXX"},
json={"url": "https://example.com"},
timeout=120,
)
print(r.status_code, r.headers.get("x-credits-charged"), r.headers.get("x-credits-balance"))
print(r.json())
Response
JSON with "success": true and the result fields; on failure {"success": false, "error": {"code", "message", "retryable"}} and no credits are used. Every answer carries x-credits-charged (credits used) and x-credits-balance (balance after the call); check the balance any time with GET https://tools.yukai.uk/v1/billing/balance.
Full field list and response schema: OpenAPI spec link-preview (its servers entry is the marketplace gateway; call https://tools.yukai.uk with your key).