1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "texts": ["<h1> Stellar Gooseneck Kettle 1.0L </h1><span class=\"price\">$49.99</span> In stock"],
10 "outputSchema": {
11 "type": "object",
12 "properties": {
13 "name": { "type": "string" },
14 "price": { "type": [
15 "number",
16 "null",
17 ] },
18 "currency": {
19 "type": [
20 "string",
21 "null",
22 ],
23 "description": "ISO 4217 code, e.g. USD",
24 },
25 "in_stock": { "type": [
26 "boolean",
27 "null",
28 ] },
29 },
30 "required": [
31 "name",
32 "price",
33 "currency",
34 "in_stock",
35 ],
36 },
37}
38
39
40run = client.actor("sprucethedata/clean-json").call(run_input=run_input)
41
42
43print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
44for item in client.dataset(run.default_dataset_id).iterate_items():
45 print(item)
46
47