1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "fileUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"],
10 "schema": {
11 "type": "object",
12 "properties": {
13 "vendor": { "type": "string" },
14 "invoice_number": { "type": "string" },
15 "date": {
16 "type": "string",
17 "description": "YYYY-MM-DD",
18 },
19 "total": { "type": "number" },
20 "currency": { "type": "string" },
21 },
22 },
23}
24
25
26run = client.actor("halrohm/document-to-markdown-ocr").call(run_input=run_input)
27
28
29print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
30for item in client.dataset(run.default_dataset_id).iterate_items():
31 print(item)
32
33