Links

Links

A link is an outbound <a href> extracted from a page's latest crawl (source: page_links, keyed to the page as the link's origin). This is crawl-derived data — it reflects what was on the page the last time MetaMonster crawled it, not a live re-check.

Only the latest crawl's links are returned — earlier crawls' rows are never merged in, so you won't see the same href repeated once per crawl. Links captured before crawl attribution existed carry no crawl id; for a page whose links are all legacy rows like that, every row is returned.

Scope: sites:read


GET /pages/{pageId}/links

Path parameters

Parameter Type Description
pageId integer The page's ID

Request

curl -s https://new.metamonster.ai/api/v1/pages/5001/links \
  -H "Authorization: Bearer mm_YOUR_API_KEY"

Field meanings

Field Description
href The link target, resolved to an absolute URL and normalized (relative hrefs are resolved against the page's URL; the host and path are lowercased; a trailing slash is added to extensionless paths; the query string and fragment are stripped — they do not survive normalization, so a raw href="/pricing?ref=nav#plans" on the page comes back as https://example.com/pricing/).
anchor_text The link's visible text, or null if empty/image-only.
context Surrounding text near the link — enough to locate it in the page's content without re-fetching the page.
location The page region the link was found in, e.g. nav, body, footer.
position Document order (0-indexed) among all links on the page. Rows are returned ordered by position, then id.
target_page_id The MetaMonster page id the href resolves to, if it's an internal link to a page you track. null for external links or internal links to untracked URLs.
target_path The target page's path, resolved alongside target_page_id. null whenever target_page_id is null.

Ordering and the row cap

Results are ordered by position (document order on the page), then id as a tiebreaker. There's a hard cap of 1000 rows per response — if the page has more outbound links than that, only the first 1000 (by the ordering above) come back.

meta.total is the count of rows actually returned in this response (so it's always ≤ 1000) — it is not the page's true total link count when truncation happened. meta.truncated is the trust signal: check it, not meta.total, to know whether you're looking at everything.

Response 200

{
  "data": [
    {
      "id": 88001,
      "href": "https://example.com/pricing/",
      "anchor_text": "See pricing",
      "target_page_id": 5001,
      "target_path": "/pricing",
      "context": "Ready to get started? See pricing and pick the plan that fits your team.",
      "location": "body",
      "position": 4
    },
    {
      "id": 88002,
      "href": "https://twitter.com/example/",
      "anchor_text": null,
      "target_page_id": null,
      "target_path": null,
      "context": null,
      "location": "footer",
      "position": 5
    }
  ],
  "meta": { "total": 2, "truncated": false }
}

Errors

Status When
401 unauthorized Missing/invalid key
403 forbidden Key lacks sites:read
404 not_found No such page in your organization
429 rate_limited Rate limit exceeded