Skip to main content

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

  1. Fork the repository to your own GitHub account
  2. Create a new branch for your changes
  3. Make your changes and commit them with clear messages
  4. Push the branch to your fork
  5. 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

duckduckgo_async_search-0.0.2.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

duckduckgo_async_search-0.0.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for duckduckgo_async_search-0.0.2.tar.gz
Algorithm Hash digest
SHA256 1bc8cf997b81b50fef5e9ac7e063fb8a4d94155b0633386eb2c0574c69ceeee0
MD5 52157b69ef1e8b9a480077ff5d42f90a
BLAKE2b-256 21ad8a7713ce058cb9ff89cefadf962f505490e0d692b94423069c85687cbbcc

See more details on using hashes here.

File details

Details for the file duckduckgo_async_search-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for duckduckgo_async_search-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 578a6db1102e8b641b8eabcbe86db5e5904ba0f102ef0707ddf7586e5df07430
MD5 2b3e2c6c4ab971bdb1497f7d8b913d33
BLAKE2b-256 10cd3bec2a5cff0e5c2c704a5635554e249861e96ac7d5d6d568369c9a374eed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page