1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "sourceText": "Dr. Clara Müller signed Service Agreement SA-2026-04 on 15 March 2026 in München for EUR 48,500.",
10 "promptDescription": "Extract person names, agreement identifiers, dates, locations, and monetary amounts using exact verbatim text from the document.",
11 "exampleText": "Max Weber executed Contract C-101 on 2 January 2025 in Berlin for USD 12,000.",
12 "exampleExtractions": [
13 {
14 "key": "person",
15 "value": "Max Weber",
16 },
17 {
18 "key": "agreement_id",
19 "value": "Contract C-101",
20 },
21 {
22 "key": "date",
23 "value": "2 January 2025",
24 },
25 {
26 "key": "location",
27 "value": "Berlin",
28 },
29 {
30 "key": "amount",
31 "value": "USD 12,000",
32 },
33 ],
34}
35
36
37run = client.actor("solutionssmart/langextract-grounded-extractor").call(run_input=run_input)
38
39
40print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
41for item in client.dataset(run.default_dataset_id).iterate_items():
42 print(item)
43
44