1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "beforeJson": "[{\"id\": 0, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 1, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 2, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 3, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 4, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 5, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 6, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 7, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 8, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}, {\"id\": 9, \"price\": 10, \"rating\": 5, \"title\": \"Product\", \"details\": {\"stock\": 5}}]",
10 "afterJson": "[{\"id\": 0, \"price\": \"10\", \"title\": \"\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 1, \"price\": \"10\", \"title\": \"\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 2, \"price\": \"10\", \"title\": \"\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 3, \"price\": \"10\", \"title\": \"\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 4, \"price\": \"10\", \"title\": \"Product\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 5, \"price\": \"10\", \"title\": \"Product\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 6, \"price\": \"10\", \"title\": \"Product\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 7, \"price\": \"10\", \"title\": \"Product\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 8, \"price\": \"10\", \"title\": \"Product\", \"details\": {\"stock\": 5}, \"promo\": true}, {\"id\": 9, \"price\": \"10\", \"title\": \"Product\", \"details\": {\"stock\": 5}, \"promo\": true}]",
11}
12
13
14run = client.actor("witforsurprise/json-drift-brief").call(run_input=run_input)
15
16
17print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
18for item in client.dataset(run.default_dataset_id).iterate_items():
19 print(item)
20
21