# 2s.io URL Map — Link & Sitemap Extractor

> 2s.io URL Map — Link & Sitemap Extractor is a paid API for AI agents from 2s.io, paid per call via x402, $0.00108/call, status unknown (last checked 2026-09-15).

Fetches a URL (HTML page or XML sitemap/sitemap-index) and returns all discovered links or <loc> URLs, resolved to absolute, deduplicated, and filtered to http(s) only.

## Facts

- Endpoint: GET https://2s.io/api/url/map
- Price: $0.00108/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-url-map-link-sitemap-extractor-1f6c3406
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BjlN0rZCmbiDfw_0G4iw0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 2s-io-url-map-link-sitemap-extractor-1f6c3406
```

Example prompt: Can you fetch https://example.com/sitemap.xml and give me the list of all URLs it contains — up to 500 of them, same host only?

## When to prefer this

Use this endpoint when you need a single-hop extraction of all links from an HTML page or all <loc> URLs from an XML sitemap or sitemap-index, with auto-detection of the content type. Prefer this over a full crawler when you want a fast, stateless, non-recursive snapshot of outbound links or sitemap entries. Ideal for seeding a crawl queue, auditing a sitemap, or discovering pages for further processing.

## Known failure modes

- SSRF guard blocks private/internal IP ranges — returns error for localhost or RFC1918 addresses
- URL unreachable or times out — returns fetch error
- Non-HTML, non-XML content type — may return empty urls array
- limit out of range (< 1 or > 2000) — validation error
- Missing required url param — returns 400 bad request
- Redirects to disallowed resource — blocked by SSRF guard

## How this service works

Discover the URLs a page or sitemap points at in a single fetch. Point it at an XML sitemap or sitemap-index and it returns the <loc> URLs; point it at an HTML page and it returns the <a href> links — auto-detected. URLs are resolved to absolute, de-duplicated, fragment-stripped, and http(s)-only. `limit` (1-2000, default 200) caps the count; `sameHostOnly` keeps only links on the same host. Single SSRF-guarded fetch, no JavaScript, stateless — NOT a recursive crawler: to go deeper, call map again on a child sitemap or a discovered page. Returns { url, finalUrl, source: "sitemap"|"links", count, capped, urls }.

## Output

Returns a JSON object with: the input url, finalUrl (after any redirects), source ('sitemap' or 'links'), count of URLs found, capped boolean indicating if limit was hit, and urls array of absolute deduplicated http(s) URLs.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "url": "https://www.wikipedia.org/",
   "limit": 100,
   "sameHostOnly": false
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string"
      },
      "limit": {
       "type": "integer",
       "default": 200,
       "maximum": 2000,
       "minimum": 1
      },
      "sameHostOnly": {
       "type": "boolean",
       "default": false
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-url-map-link-sitemap-extractor-1f6c3406/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
