Diff Datasets

Diff Datasets

by pocesar

Compare two Apify datasets to instantly find new, changed, or missing items. Perfect for monitoring prices, listings, or inventory without manual work.

81 runs
18 users
Try This Actor

Opens on Apify.com

About Diff Datasets

Ever needed to quickly spot what's new or missing between two datasets? That's exactly what the Diff Datasets actor does. You give it two Apify datasets—maybe one from a scrape you ran yesterday and another from today—and it compares them line by line. The core job is to output the items that are in one dataset but not the other, showing you exactly what's changed. This is super handy for monitoring. Think tracking price changes on an e-commerce site, watching for new job listings, or checking if product inventory has been updated. You can even use a compound key, which is just a fancy way of saying you can define a unique identifier (like combining a product ID and a store name) to make the comparison smarter and more accurate. Instead of manually sifting through spreadsheets or writing a custom script, this actor automates the diffing process right on the Apify platform. It saves a ton of time and helps you catch the data that actually matters for your project. I use it regularly to validate scrapes and ensure my data pipelines are picking up fresh information.

What does this actor do?

Diff Datasets is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.

Key Features

  • Cloud-based execution - no local setup required
  • Scalable infrastructure for large-scale operations
  • API access for integration with your applications
  • Built-in proxy rotation and anti-blocking measures
  • Scheduled runs and webhooks for automation

How to Use

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

Diff Datasets

Overview

An Apify actor that compares two datasets on the Apify platform. It identifies items present in one dataset but missing from another, and can also detect changed items using a compound key. Useful for data synchronization, change detection, and deduplication workflows.

Key Features

  • Dataset Comparison: Compares a base dataset against an other dataset.
  • Flexible Key Definition: Uses uniqueFields to create a compound key for comparison. Supports:
    • Simple primitive fields (string, number, boolean).
    • Nested object paths using lodash.get notation (e.g., sub.fields.0).
    • Array or string lengths (e.g., sub.fields.length).
  • Handles Nested Objects: Automatically hashes nested object values for comparison using JSON.stringify.
  • Output: Returns only the items from the other dataset that are not found in the base dataset.

How to Use

Call the actor via the Apify API, providing the IDs of your datasets and the fields to use for comparison.

await Apify.call('pocesar/diff-datasets', {
    baseDatasetId: 'LdNAlaOY1aKGhwAah', // The reference dataset
    otherDatasetId: 'Bzu1pgOjenN43VhPY', // The dataset to check for new/changed items
    uniqueFields: [ // Defines the compound key
        "pageUrl",
        "sub.fields.0",
        "sub.fields.length"
    ],
});

Important: The order of baseDatasetId and otherDatasetId matters. Items already present in the base dataset will not appear in the output; only unique items from the other dataset are returned.

Input/Output

Input Parameters:
* baseDatasetId (String, required): The ID of the reference dataset.
* otherDatasetId (String, required): The ID of the dataset to compare against the base.
* uniqueFields (Array, required): An array of field paths that together form a unique key for each item.

Output:
The actor outputs a new dataset containing items from the other dataset that were not found in the base dataset, based on the defined uniqueFields.

Limitations

  • Memory Usage: All unique key values from the base dataset are held in memory. Larger datasets require more memory.
  • Storage Limits: Saving the internal data structure to the key-value store may fail if the set of unique keys becomes extremely large.

License

Apache 2.0

Common Use Cases

Market Research

Gather competitive intelligence and market data

Lead Generation

Extract contact information for sales outreach

Price Monitoring

Track competitor pricing and product changes

Content Aggregation

Collect and organize content from multiple sources

Ready to Get Started?

Try Diff Datasets now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
pocesar
Pricing
Paid
Total Runs
81
Active Users
18
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support