Async DuckDuckGo search helper with SERP wrapper + Instant Answer API fallback.
Project description
duckduckgo-async-search - PIP Package
Async DuckDuckGo search helper:
- Tries
duckduckgo-search(DDGS SERP wrapper) first - Falls back to DuckDuckGo Instant Answer API JSON if SERP is rate-limited or unavailable
Install
pip install duckduckgo-async-search
Usage
No config/API is needed to use this library.
Simple Import
import asyncio
from DuckDuckGoAsyncSearch import top_n_result
async def main():
query = "Capital of Bangladesh"
items = await top_n_result(query, n=5)
for it in items:
print(it.title, it.url)
asyncio.run(main())
Standard Import
!pip install duckduckgo-async-search
from duckduckgo_async_search import DuckDuckGoSearch
async def main():
client = DuckDuckGoSearch()
items = await client.top_n_result("Capital of Bangladesh", n=5)
for it in items:
print(it.title, it.url, "|", it.source)
print("--------------------------")
await main()
Notes
- SERP wrappers can be rate-limited depending on your IP/network.
- Instant Answer API is more reliable but does not always reflect “top web results”.
Contribution
Contributions are welcome and encouraged 🎉
The source code is publicly available here:
👉 https://github.com/AbrarJahin/pip-duckduckgo_async_search
How to contribute
- Fork the repository to your own GitHub account
- Create a new branch for your changes
- Make your changes and commit them with clear messages
- Push the branch to your fork
- Open a Pull Request (PR) to this repository
All PRs will be reviewed and tested. If everything looks good, the changes will be merged.
What you can contribute
- Bug fixes
- Performance or reliability improvements
- Documentation improvements
- New features or enhancements
- Test coverage
By contributing, you agree that your contributions will be licensed under the same open-source license as this project.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duckduckgo_async_search-0.0.2.tar.gz.
File metadata
- Download URL: duckduckgo_async_search-0.0.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bc8cf997b81b50fef5e9ac7e063fb8a4d94155b0633386eb2c0574c69ceeee0
|
|
| MD5 |
52157b69ef1e8b9a480077ff5d42f90a
|
|
| BLAKE2b-256 |
21ad8a7713ce058cb9ff89cefadf962f505490e0d692b94423069c85687cbbcc
|
File details
Details for the file duckduckgo_async_search-0.0.2-py3-none-any.whl.
File metadata
- Download URL: duckduckgo_async_search-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
578a6db1102e8b641b8eabcbe86db5e5904ba0f102ef0707ddf7586e5df07430
|
|
| MD5 |
2b3e2c6c4ab971bdb1497f7d8b913d33
|
|
| BLAKE2b-256 |
10cd3bec2a5cff0e5c2c704a5635554e249861e96ac7d5d6d568369c9a374eed
|