# HTML link extractor

List every link and image in HTML, with link text, resolved address, rel values and internal or external.

- Endpoint: `POST https://setget.net/v1/tools/html-extract-links` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `html-extract-links`
- Page: https://setget.net/tools/html-extract-links

## Inputs

- `text` (required, string): The HTML to scan.
- `base_url` (optional, string): The address of the page, used to resolve relative links and to tell internal from external.

## Example

```json
{"input":{"text":"<a href=\"/about\">About us</a> <a href=\"https://other.example/\" rel=\"nofollow noopener\">Partner</a><img src=\"logo.png\"><img src=\"team.jpg\" alt=\"The team\">","base_url":"https://example.com/blog/"}}
```

Result:

```json
{"links":[{"text":"About us","href":"/about","url":"https://example.com/about","rel":[],"nofollow":false,"kind":"internal"},{"text":"Partner","href":"https://other.example/","url":"https://other.example/","rel":["nofollow","noopener"],"nofollow":true,"kind":"external"}],"images":[{"src":"logo.png","url":"https://example.com/blog/logo.png","alt":null,"missing_alt":true},{"src":"team.jpg","url":"https://example.com/blog/team.jpg","alt":"The team","missing_alt":false}],"counts":{"links":2,"internal":1,"external":1,"images":2,"images_missing_alt":1},"truncated":false}
```

**What are the link kinds?** internal (same site as base_url, ignoring a leading www.), external, anchor (starts with #), other (mailto:, tel:, javascript: and similar) and unknown (an absolute link when no base_url was given).

**Is alt="" reported as missing?** No. An empty alt is the correct way to mark a decorative image. Only images with no alt attribute are flagged.

**Are the links checked?** No. Nothing is requested, so broken links are not detected.
