Make `async: True` batch searches work out of the box
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 55/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 183
- Forks
- 28
- Merge médio
- 8d 14h
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de serpapi/serpapi-python
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
serpapi/serpapi-python#54 ·
-
improvement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
serpapi/serpapi-python#17 · 2 comentários · 1 reação ·
Todas as issues de serpapi/serpapi-python
Issues semelhantes
-
todo
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
tonybaloney/CSnakes#864 ·
-
infra
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
libre-embedded/svgen#72 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Genesis-Embodied-AI/genesis-world#3950 ·
Mantenedores costumam responder em até 1 dia
-
accessibility
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia