1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "contracts": [{
9 "actorId": "example-actor-id",
10 "ownerUsername": "example_owner",
11 "slug": "page-metadata-extractor",
12 "name": "Page Metadata Extractor",
13 "description": "Turn public webpage URLs into structured metadata records.",
14 "inputSchema": {
15 "type": "object",
16 "properties": { "urls": {
17 "type": "array",
18 "items": { "type": "string" },
19 } },
20 "required": ["urls"],
21 "additionalProperties": False,
22 },
23 "outputContract": None,
24 "datasetSchema": None,
25 "provides": [],
26 "useCases": [],
27 "repairHints": {
28 "outputProperties": {
29 "url": {
30 "type": "string",
31 "format": "uri",
32 },
33 "title": { "type": "string" },
34 "status": { "type": "string" },
35 },
36 "requiredOutputs": [
37 "url",
38 "status",
39 ],
40 "capabilities": ["web-metadata-extraction"],
41 "useCases": [{
42 "slug": "extract-page-metadata",
43 "title": "Extract metadata from a webpage",
44 "description": "Extract structured metadata from a public webpage.",
45 "seoTitle": "Extract Webpage Metadata as JSON",
46 "seoDescription": "Turn public webpage URLs into structured metadata records for APIs and AI agents.",
47 "searchIntents": ["extract webpage metadata"],
48 "exampleInput": { "urls": ["https://example.com"] },
49 "visibleInputFields": ["urls"],
50 "datasetView": "overview",
51 }],
52 },
53 }] }
54
55
56run = client.actor("skilled_glee/echoempire-machine-foundry-1").call(run_input=run_input)
57
58
59print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
60for item in client.dataset(run.default_dataset_id).iterate_items():
61 print(item)
62
63