# Sitemap API
> Fetch and parse an XML sitemap (the sitemaps.org protocol). Pass a sitemap URL and the parse endpoint fetches it — following redirects and transparently gunzipping .gz sitemaps — and returns its type: a urlset with every URL and its lastmod, changefreq and priority, or a sitemapindex listing the child sitemaps, with offset/limit paging for large files. The urls endpoint goes further: when the sitemap is an index it fetches the child sitemaps too and flattens every page URL into a single list, with a configurable cap on URLs and child sitemaps and a truncated flag so you stay in control. The request is made server-side and private or internal targets are refused (SSRF-guarded). Built for SEO audits, building crawl queues and content inventories, change monitoring and migration checks. A sitemap fetcher and parser — distinct from generic XML-to-JSON conversion (xml), the robots.txt evaluator (robots) and the on-page SEO audit (seo). No upstream key, no cache.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/sitemap-api/..."
```

## Pricing
- **Free** (Free) — 1,980 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 37,000 calls/Mo, 8 req/s
- **Pro** ($20/Mo) — 200,000 calls/Mo, 20 req/s
- **Mega** ($51/Mo) — 780,000 calls/Mo, 50 req/s

## Endpoints

### Sitemap

#### `GET /v1/parse` — Parse a sitemap (urlset/index)

**Parameters:**
- `url` (query, required, string) — Sitemap URL Example: `https://www.oanor.com/sitemap.xml`
- `limit` (query, optional, string) — 1-50000 (default 1000) Example: `10`
- `offset` (query, optional, string) — Paging offset

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sitemap-api/v1/parse?url=https%3A%2F%2Fwww.oanor.com%2Fsitemap.xml&limit=10"
```

#### `GET /v1/urls` — Flatten all URLs (follow index)

**Parameters:**
- `url` (query, required, string) — Sitemap URL Example: `https://www.oanor.com/sitemap.xml`
- `limit` (query, optional, string) — Max URLs (default 2000) Example: `10`
- `max_sitemaps` (query, optional, string) — Max child sitemaps (default 50) Example: `1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sitemap-api/v1/urls?url=https%3A%2F%2Fwww.oanor.com%2Fsitemap.xml&limit=10&max_sitemaps=1"
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/sitemap-api/v1/meta"
```


---
Marketplace page: https://www.oanor.com/api/sitemap-api
OpenAPI spec: https://www.oanor.com/api/sitemap-api/openapi.json
