1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [{ "url": "https://apify.com/pricing" }],
10 "instructions": "List each pricing plan with its name and monthly price in USD.",
11 "outputSchema": {
12 "type": "object",
13 "properties": { "plans": {
14 "type": "array",
15 "items": {
16 "type": "object",
17 "properties": {
18 "name": { "type": "string" },
19 "monthlyPriceUsd": { "type": [
20 "number",
21 "null",
22 ] },
23 },
24 "required": ["name"],
25 },
26 } },
27 "required": ["plans"],
28 },
29 "maxPages": 3,
30}
31
32
33run = client.actor("conserving_celerytop/ai-web-scraper").call(run_input=run_input)
34
35
36print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
37for item in client.dataset(run.default_dataset_id).iterate_items():
38 print(item)
39
40