# Changelog of URL to Markdown: Web Page to Markdown for LLMs & RAG (`fecklesspleb/url-to-markdown`) Actor

- **URL**: https://apify.com/fecklesspleb/url-to-markdown/changelog.md
- **Full Actor documentation**: https://apify.com/fecklesspleb/url-to-markdown.md

## Changelog

### Unreleased: invalid input no longer crashes (2026-11-04, local, not built or pushed; based on cloud build 1.0.7)

- **Fix:** input that is not a JSON object (a string, number, `null` or list) crashed the run with exit 91. It now ends with exit 0 and one free status row: `Invalid input, nothing was fetched and no results were charged: the input must be a JSON object, got <type>.`
- **Fix:** wrong-type or unusable values that crashed with exit 91 before anything was fetched now end the same way (exit 0, one free status row with `charged: false`, no `RUN_SUMMARY`, no charged event) with the reason `<field> has the wrong type (<error>).` Covered: `urls` and `sitemapUrls` (a number, boolean or a list with numbers), `maxCharsPerPage`, `maxResults`, `maxSitemapUrls`, `maxConcurrency`.
- The check repeats the exact conversions the run makes, before any request; valid input behaves exactly as before. Network, HTTP and upstream errors are unchanged.
- The existing free "Not charged: sitemap ... yielded no page URLs" status rows are unchanged.
- Memory unchanged: default 256, min 128, max 4096.
- `requirements.txt`: `apify` pinned to `>= 4.1.0, < 4.2.0` (was `>= 4.0.0, < 5.0.0`).
- New unit tests: `tests/test_invalid_input.py`.

### 2026-11-02 (actor.json version unchanged: 1.0): private-address (SSRF) guard

- On the Apify platform, every request (page URLs, sitemaps, child sitemaps and page URLs listed in sitemaps, each
  redirect hop, and robots.txt) is refused when the host resolves to a private, loopback, link-local, carrier-grade
  NAT, reserved, multicast or unspecified address (including IPv4-mapped IPv6), or when any of the host's addresses
  is one. Same rules as Bulk HTTP Request.
- Such a page gets a free row (like other failed pages): `error: "not fetched: private, loopback and link-local
  addresses are not allowed"`, counted in `failed`. Such a sitemap gets that error in `RUN_SUMMARY.sitemaps`; a
  sitemap from `sitemapUrls` that yields nothing therefore gets the usual free status row
  (`recordType: "status"`, `reason: "sitemapFailed"`, `message: "Not charged: sitemap ... yielded no page URLs:
  not fetched: private, ..."`).
- A host the guard cannot resolve fails as before ("DNS or connection error").
- A robots.txt that redirects to a private address counts as unavailable (no robots.txt rules), like a robots.txt
  that cannot be fetched.
- Local runs (APIFY_IS_AT_HOME not set) are unchanged.
- Files: `my_actor/common.py` (guard helpers; `Http._robots_for` checks the site first), `my_actor/main.py` (hook
  on the httpx client, `Blocked` handled), `my_actor/sitemap.py` (`Blocked` handled), `tests/test_ssrf_guard_1102t.py`
  (new), README Limits (one line).

### Unreleased

- Added: sitemap input via the new optional `sitemapUrls` field (the only way sitemaps are expanded). Sitemap index files are followed up to 3 levels, `.xml.gz` files are unpacked, plain-text URL lists work. At most 100 sitemap files are read per run. Reading sitemaps is free; converted pages are charged with the existing `page` event.
- Added: `maxSitemapUrls` input (default 100, min 1, max 10,000): the most page URLs taken from all `sitemapUrls` together in one run, so a large sitemap cannot cause a surprise charge (default: at most 100 pages = $0.05). The effective cap is `min(maxResults, maxSitemapUrls)` when `maxResults` is above 0, otherwise `maxSitemapUrls`.
- Added: a sitemap that yields no page URLs (empty, HTTP error, blocked by robots.txt, nested too deep) adds one free status row (`recordType: "status"`, `statusRow: true`, `status` `error` or `warning`, message starting `Not charged:`).
- Unchanged: `urls` behaves as in 1.0.4. Every URL in `urls` is converted as one page, including URLs that are, or are named like, sitemaps; they are not expanded.
- Changed: `urls` is no longer `required` in the input schema, so an input with only `sitemapUrls` is valid. Its default and prefill are unchanged, and `{}` still converts the sample page. When `sitemapUrls` is given and `urls` is exactly the sample default (which the platform fills in), the sample page is skipped.
- **Changed (behaviour, affects `urls` too): robots.txt answering HTTP 429 or 5xx now means disallow all for that host (before: treated as no robots.txt, so allowed).** Pages there are not fetched and not charged; their row has `error: "not fetched: robots.txt returned HTTP 429, treated as disallow all"` (or the 5xx code). A network error fetching robots.txt is still treated as allow, as before.
- Added: `RUN_SUMMARY` gains `statusRows`, `sitemapsGiven`, `pageUrlsFromSitemaps`, `maxSitemapUrls`, `sitemapUrlCap`, `sitemapUrlsCapped` and per-file `sitemaps` reports.
- Console: the "Pages" dataset view also shows `recordType`, `status` ("Row status") and `message`, so free status rows are readable there.
- Tests: offline sitemap tests (`tests/test_sitemap.py`, mock transport in `tests/mock_web.py`, fixtures in `tests/fixtures/`), run with `pytest` from this folder.
