1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "search": "harry potter",
10 "startUrls": [
11 "https://www.goodreads.com/search?q=game+of+thrones&qid=",
12 "https://www.goodreads.com/book/show/59576065-acceptance",
13 "https://www.goodreads.com/list/show/1362.Best_History_Books_",
14 "https://www.goodreads.com/shelf/show/fiction",
15 "https://www.goodreads.com/genres/business",
16 "https://www.goodreads.com/author/list/1221698.Neil_Gaiman",
17 ],
18 "maxItems": 1,
19 "endPage": 1,
20 "extendOutputFunction": "($) => { return {} }",
21 "customMapFunction": "(object) => { return {...object} }",
22 "proxy": {
23 "useApifyProxy": True,
24 "apifyProxyGroups": ["RESIDENTIAL"],
25 },
26}
27
28
29run = client.actor("epctex/goodreads-scraper").call(run_input=run_input)
30
31
32print("๐พ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
33for item in client.dataset(run["defaultDatasetId"]).iterate_items():
34 print(item)
35
36