All links on a page (with broken-link check)

GET https://api.api.sh/web/v1/links
1 credit / call web data try it in the playground →

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

nametypedescription
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).

Every endpoint also takes fresh, raw, fields (see lean responses and caching).

Example

curl "https://api.api.sh/web/v1/links?url=https%3A%2F%2Fnews.ycombinator.com%2F" \
  -H "x-api-key: $APISH_KEY"

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.