Sitemap to RAG Dataset avatar

Sitemap to RAG Dataset

Pricing

from $0.80 / 1,000 page extracteds

Go to Apify Store
Sitemap to RAG Dataset

Sitemap to RAG Dataset

Convert any website sitemap into an LLM-ready dataset for RAG pipelines.

Pricing

from $0.80 / 1,000 page extracteds

Rating

0.0

(0)

Developer

GhostGrid

GhostGrid

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Share

Feed it a sitemap URL (or just a homepage), get back clean text content from every page, formatted for RAG pipelines and LLM training.

What it does

  • Parses sitemap.xml files (including sitemap indexes, gzipped sitemaps, and auto-discovery from robots.txt)
  • Crawls each page and strips out navigation, footers, sidebars, ads, and other boilerplate
  • Outputs clean text and markdown versions of the main content
  • Extracts metadata (title, description, keywords, Open Graph image)
  • Detects page language and counts words
  • Splits content into RAG-ready chunks with stable chunk IDs (UUID5 based on URL + index)
  • Estimates token counts per chunk (len/4 heuristic)
  • Computes SHA-256 content hashes for pages and chunks
  • Supports diff mode to detect new, changed, and removed pages between crawls

Input

ParameterTypeDefaultDescription
sitemap_urlstringrequiredURL to a sitemap.xml or a website homepage (auto-detects sitemap)
max_pagesinteger100Max pages to crawl (1 - 10,000)
include_linked_pagesbooleanfalseAlso crawl pages linked from sitemap pages
chunk_strategystringfixed_sizeHow to split text: fixed_size, sentence, or paragraph
chunk_token_limitinteger512Max tokens per chunk (100 - 4,096)
diff_modebooleanfalseCompare with previous crawl, report new/changed/removed pages
include_chunksbooleantrueOutput RAG chunks as separate dataset items

Output

The dataset contains two types of records:

Page records (type: "page")

One per crawled page:

FieldTypeDescription
typestringAlways "page"
urlstringPage URL
titlestringPage title
textstringClean main content as plain text
markdownstringContent formatted as markdown
content_hashstringSHA-256 hex digest of the page text
metadataobjectDescription, keywords, OG image, canonical URL
crawled_atstringISO 8601 timestamp
word_countintegerWord count of the extracted text
languagestringDetected language code (e.g. en)

Chunk records (type: "chunk")

One per RAG chunk (when include_chunks is true):

FieldTypeDescription
typestringAlways "chunk"
urlstringSource page URL
titlestringSource page title
chunk_idstringStable UUID5 (based on url:chunk_index)
chunk_indexinteger0-based index within the page
total_chunksintegerTotal chunks for this page
textstringThe chunk text
start_charintegerCharacter offset in full page text
end_charintegerEnd character offset
token_estimateintegerEstimated tokens (len/4)
content_hashstringSHA-256 of the chunk text
page_content_hashstringSHA-256 of the full page text
languagestringPage language code

Diff records (type: "diff")

One per run when diff_mode is true:

FieldTypeDescription
typestringAlways "diff"
newlistURLs found in this crawl but not the previous one
changedlistURLs present in both but with different content hash
removedlistURLs in the previous crawl but not this one
crawl_timestringISO 8601 timestamp of this crawl
previous_crawl_timestringISO 8601 timestamp of the previous crawl
total_newintegerCount of new URLs
total_changedintegerCount of changed URLs
total_removedintegerCount of removed URLs

How to use

Run locally:

$apify run --input '{"sitemap_url": "https://example.com/sitemap.xml"}'

With chunking and diff mode:

$apify run --input '{"sitemap_url": "https://example.com/sitemap.xml", "max_pages": 50, "chunk_strategy": "paragraph", "chunk_token_limit": 256, "diff_mode": true}'

Deploy to Apify:

$apify push

Pricing

This actor uses pay-per-event (PPE) pricing. You are charged 1 event per page successfully crawled and extracted. Chunk records and diff records do not incur additional charges.