1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "urls": [
10 "https://upload.wikimedia.org/wikipedia/commons/thumb/4/46/F._Scott_Fitzgerald%2C_The_Great_Gatsby%2C_1925%2C_title_page.jpg/960px-F._Scott_Fitzgerald%2C_The_Great_Gatsby%2C_1925%2C_title_page.jpg",
11 "https://upload.wikimedia.org/wikipedia/commons/thumb/3/3b/A_Few_Notes_on_Cruelty_to_Animals_%28title_page%29.png/960px-A_Few_Notes_on_Cruelty_to_Animals_%28title_page%29.png",
12 "https://upload.wikimedia.org/wikipedia/commons/thumb/2/22/On_the_Origin_of_Species_1859_-_Titlepage.png/960px-On_the_Origin_of_Species_1859_-_Titlepage.png",
13 ],
14 "urlField": "url",
15 "languages": ["eng"],
16 "outputLevel": "text",
17 "minWordConfidence": 0,
18 "layout": "auto",
19 "grayscale": True,
20 "enhanceContrast": False,
21 "upscale": "auto",
22 "straighten": False,
23 "rotate": "0",
24 "dedupe": True,
25 "maxFileMegabytes": 15,
26 "respectRobotsTxt": True,
27 "requestsPerSecond": 2,
28 "maxConcurrency": 3,
29 "timeoutSecs": 30,
30}
31
32
33run = client.actor("far003/image-ocr-text").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