Diff Dataset Fields
Pricing
Pay per usage
Diff Dataset Fields
Compare changes in text fields between two datasets. Monitor new and updated content on websites.
0.0 (0)
Pricing
Pay per usage
1
Monthly users
4
Runs succeeded
>99%
Last modified
6 months ago
Compare items of two datasets to see changes in their fields. You match the items by a key field and then compare the any number of textual fields.
Diff
You can choose one or more fields to diff between two items that are matched by a key field. The diff is computed using the fast-diff package where the output is a list of text parts that are marked with a number depending if they are inserted (1), deleted (-1) or unchanged (0).
Output
The output is a JSON object with the following properties:
type
: Representing how the items were compared. Can benew
,removed
,unchanged
orupdated
.oldItem
: The item from the old datasetnewItem
: The item from the new datasetdiff
: The diff between the two items. Only present if the type isupdated
.
Example input
1{ 2 "oldDatasetId": "0Azg4BxggC3RmcPpY", 3 "newDatasetId": "i4mfnrQEP8QmQAbHu", 4 "fieldToMapBy": "url", 5 "fieldsToDiff": ["text", "markdown"], 6 "outputTypes": ["new", "removed", "updated", "unchanged"], 7}
Example output
This is one item that was matched in both datasets, the real output will have all items from both datasets.
1{ 2 "type": "updated", 3 "oldItem": { 4 "url": "https://www.peacocktv.com/start", 5 "text": "PeacockAdobe AudienceManagerBack ButtonSearch IconFilter Icon\nEnter your email to get started", 6 "markdown": "# PeacockAdobe AudienceManagerBack ButtonSearch IconFilter Icon\n\n## \n\nEnter your email to get started", 7 }, 8 "newItem": { 9 "url": "https://www.peacocktv.com/start", 10 "text": "PeacockBack ButtonSearch IconFilter Icon\nEnter your email to get started", 11 "markdown": "# PeacockBack ButtonSearch IconFilter Icon\n\n## \n\nEnter your email to get started", 12 } 13 , 14 "diff":{ 15 "text": [ 16 [ 17 0, 18 "Peacock" 19 ], 20 [ 21 -1, 22 "Adobe AudienceManager" 23 ], 24 [ 25 0, 26 "Back ButtonSearch IconFilter Icon\nEnter your email to get started" 27 ] 28 ], 29 "markdown": [ 30 [ 31 0, 32 "# Peacock" 33 ], 34 [ 35 -1, 36 "Adobe AudienceManager" 37 ], 38 [ 39 0, 40 "Back ButtonSearch IconFilter Icon\n\n## \n\nEnter your email to get started" 41 ] 42 ] 43 } 44}
Pricing
Pricing model
Pay per usageThis Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage.