# Sitemap Discovery & URL Extraction API

> Sitemap Discovery & URL Extraction API is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-20).

Fetches and parses XML sitemaps for a given site or sitemap URL, returning a structured list of URLs with metadata like lastmod, priority, and alternates.

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/sitemap?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-20
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sitemap-discovery-url-extraction-api-fdf63d65
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_i8iDdLl-nHxLUhjx8FSpZ

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 sitemap-discovery-url-extraction-api-fdf63d65
```

Example prompt: Can you pull all the URLs from cloudflare.com's sitemap, only show me ones updated since 2025-01-01, and limit the results to 500?

## When to prefer this

Choose this endpoint when you need to programmatically discover all indexed URLs on a website without crawling every page manually — especially useful for RAG ingestion pipelines, SEO audits, content monitoring, or competitive research. It auto-discovers sitemaps via robots.txt, handles sitemap index files with multiple children, and supports filtering by date or URL pattern. Prefer it over raw HTTP crawling when you want structured, metadata-rich URL lists quickly and cheaply at $0.003/call with no API key needed.

## Known failure modes

- Invalid or unreachable sitemap URL returns an error or empty URL list
- Site has no sitemap.xml and robots.txt does not reference one — found_via may be null
- Sitemap index with many children: only up to max_sitemaps (default 5) are fetched, remainder counted in sitemaps_not_fetched
- Malformed XML sitemap may result in partial parsing
- limit param out of range (must be 1–5000) causes validation error
- since date in wrong format (non-ISO) may be ignored or cause error
- Payment failure via x402 (insufficient USDC balance or wrong network) blocks the call

## How this service works

Sitemap to URL list: give a sitemap URL or just a domain (sitemaps found via robots.txt, then /sitemap.xml). Follows sitemap indexes (newest first, up to 10 child sitemaps), reads .xml, .xml.gz and text sitemaps, and returns every URL with lastmod, changefreq, priority, hreflang alternates, image and news counts. Filter by contains= and since= (lastmod).

## Output

Returns a JSON object containing a list of URLs with their lastmod date, priority, changefreq, and alternate hreflang links; metadata about how many URLs were found, returned, and whether results were truncated; which sitemaps were fetched and their types; how the sitemap was discovered (direct or via robots.txt); and optional notes about full dataset availability.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "sitemap URL, or a site / domain to discover its sitemaps via robots.txt"
      },
      "limit": {
       "type": "string",
       "description": "max URLs returned, 1-5000, default 1000"
      },
      "since": {
       "type": "string",
       "description": "only URLs with lastmod at/after this ISO date"
      },
      "contains": {
       "type": "string",
       "description": "only URLs containing this text, e.g. /blog/"
      },
      "max_sitemaps": {
       "type": "string",
       "description": "sitemap files to read per call, 1-10, default 5"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "more": {
       "type": "object",
       "properties": {
        "note": {
         "type": [
          "string",
          "null"
         ]
        },
        "full_datasets": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      },
      "note": {
       "type": [
        "string",
        "null"
       ]
      },
      "site": {
       "type": [
        "string",
        "null"
       ]
      },
      "urls": {
       "type": "array",
       "items": {
        "type": [
         "object",
         "null"
        ]
       }
      },
      "filters": {
       "type": "object",
       "properties": {
        "limit": {
         "type": [
          "number",
          "null"
         ]
        },
        "since": {},
        "contains": {}
       }
      },
      "returned": {
       "type": [
        "number",
        "null"
       ]
      },
      "found_via": {
       "type": [
        "string",
        "null"
       ]
      },
      "truncated": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "urls_seen": {
       "type": [
        "number",
        "null"
       ]
      },
     
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "more": {
   "note": "Full dataset downloads available by card",
   "full_datasets": "https://freetier-kits-shop.fourthwall.com"
  },
  "note": "Child sitemaps of an index are read newest-lastmod first, up to max_sitemaps (default 5, max 10) per call. lastmod is what the site declares, normalised to I...",
  "site": "https://cloudflare.com",
  "urls": [
   {
    "loc": "https://www.cloudflare.com/",
    "lastmod": "2026-10-26T00:00:00.000Z",
    "priority": 1,
    "alternates": [
     {
      "href": "https://www.cloudflare.com/",
      "hreflang": "x-default"
     },
     {
      "href": "https://www.cloudflare.com/",
      "hreflang": "en"
     }
    ],
    "changefreq": "daily"
   },
   {
    "loc": "https://www.cloudflare.com/plans",
    "lastmod": "2026-10-26T00:00:00.000Z",
    "priority": 0.9,
    "alternates": [
     {
      "href": "https://www.cloudflare.com/plans",
      "hreflang": "x-default"
     },
     {
      "href": "https://www.cloudflare.com/plans",
      "hreflang": "en"
     }
    ],
    "changefreq": "weekly"
   }
  ],
  "filters": {
   "limit": 2,
   "since": null,
   "contains": null
  },
  "returned": 2,
  "found_via": "robots.txt",
  "truncated": true,
  "urls_seen": 1013,
  "fetched_at": "2026-10-26T12:40:41.543Z",
  "newest_lastmod": "2026-10-26T00:00:00.000Z",
  "sitemaps_fetched": [
   {
    "url": "https://www.cloudflare.com/sitemap.xml",
    "type": "urlset",
    "urls": 1013,
    "status": 200
   }
  ],
  "sitemaps_not_fetched": 0,
  "sitemaps_not_fetched_sample": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sitemap-discovery-url-extraction-api-fdf63d65/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
