1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "recordsJson": "[{\"id\":\"001\",\"quantity\":2},{\"id\":\"002\",\"quantity\":\"invalid\"}]",
10 "schemaJson": "{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"quantity\":{\"type\":\"integer\"}},\"required\":[\"id\",\"quantity\"],\"additionalProperties\":false}",
11}
12
13
14run = client.actor("grounded_goldeneye/json-schema-record-validator").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