Every link on a page: absolute URL, anchor text (or image alt / aria-label), internal or external, scheme (https, mailto, tel ...), rel, nofollow (nofollow, ugc or sponsored), target and how often it occurs. type keeps internal or external links only. check=true also requests each http(s) link (up to check_limit) and adds its HTTP status, final URL after redirects, response time and broken (4xx/5xx; null when the site rate-limited or could not be reached); checked and broken count them.
Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
urlrequired
string
Public http(s) URL of the page (a bare domain works too). Example: https://news.ycombinator.com/
type
all | internal | external
Which links to return. Default: all
check
boolean
Check each link's HTTP status. Default: false
check_limit
integer
Links checked at most (default 50, max 200). Default: 50
country
string
Two-letter country to view the page from (default US).
import os, requests
res = requests.get(
"https://api.api.sh/web/v1/links",
params={"url": "https://news.ycombinator.com/"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/web/v1/links");
url.searchParams.set("url", "https://news.ycombinator.com/");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.