1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "jsonInput": "{\"store\":{\"book\":[{\"category\":\"reference\",\"author\":\"Nigel Rees\",\"title\":\"Sayings of the Century\",\"price\":8.95},{\"category\":\"fiction\",\"author\":\"Evelyn Waugh\",\"title\":\"Sword of Honour\",\"price\":12.99},{\"category\":\"fiction\",\"author\":\"Herman Melville\",\"title\":\"Moby Dick\",\"isbn\":\"0-553-21311-3\",\"price\":8.99}],\"bicycle\":{\"color\":\"red\",\"price\":19.95}}}",
10 "expressions": [
11 "$.store.book[*].author",
12 "$..price",
13 "$.store.book[?(@.price < 10)].title",
14 ],
15}
16
17
18run = client.actor("automation-lab/jsonpath-extractor").call(run_input=run_input)
19
20
21print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
22for item in client.dataset(run["defaultDatasetId"]).iterate_items():
23 print(item)
24
25