Our screenshot Actor's visual-diff mode has a diffThreshold input, 0 to 1, "lower is stricter." We wrote the FAQ entry on intuition β strict catches more, loose catches less, pick something in the middle if unsure. We hadn't actually run the same comparison at more than one setting. So we picked two pages that have nothing in common (Hacker News and example.com ) and diffed them three times, same pair, only the threshold changed.
The setup
Same Actor, same compareUrl pair, one input changed per run β the three values the FAQ already suggests as "strict / default / loose":
$ curl -s -X POST "https://api.apify.com/v2/acts/<actor>/run-sync-get-dataset-items" \ -H 'Content-Type: application/json' \ -d '{"urls":["https://news.ycombinator.com"],"compareUrl":"https://example.com","diffThreshold":0.1}'
Enter fullscreen mode
Exit fullscreen mode
diffPercent and diffPixels come straight off the output row ( comparedPixels is the overlap region used as the denominator β the two pages render at different heights,β¦