Make `async: True` batch searches work out of the box
還沒有人認領這個 Issue。
評估
研究方向
Start by reading the implementations of Client.search and Client.search_archive, then check the README examples. Decide whether the contribution will add a helper that submits, polls, and re-queues searches or document that workflow. Done means bulk async searches can be handled with less setup, and archive polling does not reuse the initial search parameters such as q.
由索引模型根據 Issue 內容生成。
描述
Moved from the deprecated google-search-results-python package: https://github.com/serpapi/google-search-results-python/issues/51 (originally reported by dimitryzub).
Original request
From a user perspective, the less setup required the better. [...] The user has to just add an
async: Trueand don't bother tinkering/figuring out stuff for another ~hour about howQueueor something else works.
Today, running async searches in bulk means submitting each search with async: True, keeping the search IDs in a queue, polling the Search Archive API, and re-queueing searches that aren't finished (status other than Cached or Success).
Applies to serpapi-python: Client.search and Client.search_archive expose the building blocks, but the queue and polling logic is left to the user and the README has no helper or example for it.
Proposal: a helper that does this under the hood. The original issue suggested an API along these lines (adapted to the new client):
import serpapi
client = serpapi.Client(api_key="...")
# hypothetical API
results = client.async_search(
queries=["burly", "creator", "doubtful", "minecraft"],
engine="youtube",
device="desktop",
)
Alternatively, a documented README example of the submit, poll and re-queue loop would already help.
One thing to keep in mind from the original thread: when polling the archive, don't reuse the params from the initial search, because passing q to the Search Archive API returns an error.
- 主要語言
- Python
- 星號
- 183
- 分支
- 28
- 平均合併
- 8 天 14 小時
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
serpapi/serpapi-python 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 48/100
serpapi/serpapi-python#54 ·
-
improvement
難度 3/5 1-2 天 新手友好度 35/100
serpapi/serpapi-python#17 · 2 則留言 · 1 個 reaction ·
查看 serpapi/serpapi-python 的全部 Issue
相似的 Issue
-
todo
難度 1/5 1 小時以內 新手友好度 72/100
tonybaloney/CSnakes#864 ·
-
infra
難度 1/5 1 小時以內 新手友好度 90/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
libre-embedded/svgen#72 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
Genesis-Embodied-AI/genesis-world#3950 ·
維護者通常 1 天內回覆
-
accessibility
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆