Skip to content
POST
/api/v1/extract/links

Extract links API

Every link with kind + status.

POST /api/v1/extract/links audits every markdown link — anchor, external, relative, mailto, image — and flags broken in-document anchors, empty labels, and missing alt text. Designed for CI link checks.

Overview

Classify every link in a document — anchor / external / relative / mailto / image / empty — and flag structural issues like broken in-document anchors, missing alt text on images, and empty link labels.

Request

Authenticate with Authorization: Bearer YOUR_API_KEY and send a JSON body containing the parameters below. Pick your language:

curl -X POST 'https://trymarkdownviewer.com/api/v1/extract/links' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown":"See [docs](#docs) and [home](https://example.com)."}'

Body parameters

FieldTypeRequiredDescription
markdownstring
required
Markdown source.

Response

Success responses are wrapped in a data field. Errors use { error: { code, message } } with an appropriate HTTP status — see the error reference.

{
  "data": {
    "links": [
      {
        "line": 1,
        "text": "docs",
        "url": "#docs",
        "kind": "anchor",
        "status": "error",
        "note": "Anchor #docs does not match any heading in this document."
      },
      {
        "line": 1,
        "text": "home",
        "url": "https://example.com",
        "kind": "external",
        "status": "ok"
      }
    ],
    "totals": {
      "count": 2,
      "ok": 1,
      "warn": 0,
      "error": 1
    }
  }
}

Use cases

CI link check

Fail builds when in-doc anchors no longer resolve after a refactor.

SEO maintenance

Track external link counts and outbound destinations.

Try in browser

Free tools that run the same logic locally — no API key, no upload.

Try it

Send a real request against your account in the API playground. Errors there link straight back to the error reference.