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 Needed)

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

import asyncio
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)

asyncio.run(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.1.tar.gz (5.5 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.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file duckduckgo_async_search-0.0.1.tar.gz.

File metadata

  • Download URL: duckduckgo_async_search-0.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for duckduckgo_async_search-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2c071460176bfbdf5d69c0a3432a1ce53d0483424766237420f4e660e64d534e
MD5 f9e74a642c81dc81dade83eee3b18ab4
BLAKE2b-256 619871bbfd41c98387c31e304dafc44f6380a9d39bff98c1dcd471088ed28d19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for duckduckgo_async_search-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa6685abce508147097b5f97263c433b1daef5f706ce340397b82ba23740cb72
MD5 9c9f96c7673798b41e23316692e03ca7
BLAKE2b-256 68a7f4b932acd7db013f51a4a24b1fadf7a2ef2cc5a2814246b65ab8f9d483f2

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