# Changelog of TDnet Timely Disclosures (`stone_jadex/tdnet-timely-disclosures`) Actor

- **URL**: https://apify.com/stone_jadex/tdnet-timely-disclosures/changelog.md
- **Full Actor documentation**: https://apify.com/stone_jadex/tdnet-timely-disclosures.md

## Changelog

All notable changes to the TDnet Timely Disclosure Scraper. Version 0.1 (Apify build tag 0.1).

### 2026-11-21

- Renamed incremental input field `stateKey` to `stateRecordName` in `input_schema.json` to remove secret-field false positives; `src/scraper.js` accepts `stateRecordName` as primary with full backward-compatible fallback to legacy `stateKey`.
- Organized `input_schema.json` with clean `sectionCaption` groupings and added explicit `prefill` defaults for `maxItems` and `order`.
- Updated `README.md` with `stateRecordName` incremental documentation, Apify Store subscription tier discount note (Bronze, Silver, Gold, Platinum), JavaScript and Python `ApifyClient` SDK quickstart examples, and a 2026-11-21 changelog entry.

### Unreleased

- Once a block code (403, 412 or 429) has been seen on a request, any later answer other than 200 now ends that request as blocked with the most recent block code and stops the run, not only a 5xx or a network error. This covers 4xx such as 401, 400 or 404, and redirects. Before, a 401 or 400 after a 403 was recorded as a date error and later dates were still crawled, and a 404 after a 403 or 429 was read as "no more pages" (or as "no rules" for robots.txt). OUTPUT.blocked.lastFailure holds that real last status, and the notice reads e.g. "blocked this run with HTTP 403 earlier in the same request; the last attempt ended with HTTP 401 (2 attempts, 30 s back-off)". A 401 or other status without an earlier block is unchanged. Back-off and retry logic, prices and events are unchanged.
- Run notices now state every retry and wait. Where a 5xx or a network error was retried before or around a block (for example HTTP 500, 500, then 403), the notice lists each retry with its wait and what it followed, e.g. "still blocked on attempt 5 of 5, after 4 retries: 1 s and 2 s after HTTP 500, 30 s and 60 s after HTTP 403". The same goes for the "earlier in the same request" block notice and for a challenge that came after a retry. The former texts "still blocked after 1 retry with 30 s back-off, on the last of 5 attempts" and "still blocked on the last of 5 attempts, no back-off retry left" are gone: they only occurred on such paths and left out the 5xx or network waits. Pure block paths (403/412/429 only) keep their wording. OUTPUT.blocked.retries and backoffMs still count block back-off only. Retry and back-off logic is unchanged.
- The error text for a 5xx after 5 attempts says how the attempts ended when they were not all the same, e.g. "HTTP 503 after 5 attempts (1 network error, 4 × HTTP 503)". With 5 identical answers it stays "HTTP 503 after 5 attempts".
- A given dateFrom or dateTo now always wins: no look-back to the latest day with disclosures, whatever an internal latestTradingDay value in the input says.
- A disclosure row without a PDF link is now skipped instead of failing the whole run. OUTPUT.skippedMissingPdf counts the skipped rows and OUTPUT.missingPdfSample shows the first one (page URL, date, time, company code and name, title).
- HTTP 403, 412 and 429 are retried at most twice, after 30 s and then 60 s. When the attempts run out there is no further wait. Once a block code has been seen on a request, the next 5xx or network error ends that request at once as blocked with the most recent block code (no further retries); OUTPUT.blocked.lastFailure records what the last attempt ended with (the HTTP status number, or "network-error"). If the site still blocks, the whole run stops and ends SUCCEEDED with stopReason blocked-403, blocked-412 or blocked-429. This also applies with 0 rows. Rows already saved are kept, and only they are charged (the usual Actor start fee still applies). OUTPUT.blocked holds the status, URL, retries and the waits actually made (backoffMs), and OUTPUT.runNotice and the run status message explain the stop. For 429 with a Retry-After header (seconds or HTTP date), each wait is the longer of Retry-After and the 30 s or 60 s step, capped at 120 s. 403 and 412 always wait 30 s, then 60 s.
- Site errors no longer throw on the first failure. Site errors are 5xx after 5 attempts (reported as "HTTP 503 after 5 attempts"), network errors with no status code, such as ECONNRESET or ETIMEDOUT, that still fail after one retry about 5 s later ("network error (ECONNRESET)"), and other non-200 list responses except redirects. Each one is recorded in OUTPUT.errors, that date's paging stops, and later dates still run. If rows were saved, the run ends SUCCEEDED with failed=true, stopReason errors and a runNotice. If 0 rows were saved, OUTPUT (failed=true, stopReason errors, runNotice) is written first and then the run fails.
- A redirect (3xx, e.g. to a login or challenge page) or a 200 page that is not a disclosure list stops the whole run as stopReason blocked-challenge, without retrying. It ends SUCCEEDED, also with 0 rows; rows already saved are kept and charged. "Not a list" means no disclosure rows and none of the list page markers; an empty day keeps those markers and stays completed. robots.txt answered with a redirect or an HTML page is handled the same way.
- A list page whose rows all lack a PDF link (TDnet shows these as deleted disclosures) now produces a runNotice and status message; the run stays completed (or maxItems).
- Without dateFrom and dateTo the Actor now scrapes the most recent day with disclosures, looking back from today (JST) at most 7 days, instead of today only. OUTPUT.dateFrom is that day. Explicit dates keep their meaning.
- robots.txt only stops the run for a block code or a challenge. A network error (after its one retry), a 5xx or any other status is logged as a warning and the crawl continues without robots rules at the default pacing (one request per second).
- New OUTPUT fields (add-only): stopReason (completed, maxItems, errors, blocked-403, blocked-412, blocked-429, blocked-challenge, invalid-input), failed, runNotice, errors, blocked (status, url, retries, attempts, backoffMs, lastFailure; status is "challenge" for blocked-challenge), skippedMissingPdf, missingPdfSample. An empty result ends SUCCEEDED with 0 rows and stopReason completed. Invalid input writes stopReason invalid-input and then fails.
- Incremental mode: after a date with an error, the seen list is kept but no catch-up watermark is written over the gap.
- Buyer-configured proxy: one fixed session (tdnet_fixed) for the whole run. The IP no longer changes on every request or retry.
- Prices and charged events are unchanged. Only disclosure rows are written to the dataset; notices go to OUTPUT and the status message.
- This build also ships the 2026-10-26 robots.txt changes below. They were committed after the last build (0.1.8, 2026-10-19). Crawl-delay from robots.txt is still honored on every request; a Disallow match only warns and counts.

### 2026-10-26

- README: operator named as Tokyo Stock Exchange, Inc. (Japan Exchange Group); added "Is it legal to scrape TDnet?" section; README is English-only.
- robots.txt: each Disallow-matched list request is warned and counted in OUTPUT.robotsDisallowedHits and still fetched; a robots.txt 5xx no longer stops the run.

### 2026-10-19

- README: price section.

### 2026-10-14

- First release: TDnet disclosure list scraper, newest first, with truncation report and company filter.
- Incremental mode with a named key-value store watermark; code4, disclosureId, category and sourcePageUrl fields; OUTPUT summary.
- Input schema descriptions and output schema for Store publishing.
