DuckDuckGoSearchApi
DuckDuckGoSearchApi is a Python library that provides a simple and direct interface for interacting with the DuckDuckGo API. This library is designed to simplify searches and the analysis of results from DuckDuckGo.
Instalation
To install run the following:
pip install duckduckgo_search_api
Available Methods
The Duckduckgo class offers the following main methods:
search(query): Accepts a query string and returns search results ( ~ 20 results per input ~ )
Usage
Here's an example of how to use the DuckDuckGoSearchApi:
from ddg import Duckduckgo
ddg_api = Duckduckgo()
results = ddg_api.search("Google")
Success request
Search results are returned as a Python dictionary. Each result contains the page title, URL, and a description
{
"success": true,
"data": [
{
"title": "Page Title",
"url": "https://www.example.com",
"description": "Short description of the page"
},
]
}
Error request
In case of an error the returned object will contain the success field set to false
{
"success": false,
"statusCode": 404,
"message": "Failed to fetch data"
}
Release files for duckduckgo-search-api 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| duckduckgo_search_api-0.1.5.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| duckduckgo_search_api-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / duckduckgo_search_api-0.1.5.tar.gz
| Download URL | duckduckgo_search_api-0.1.5.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4e0336b5c9ca376a1ee21a5680a37a391ad3e0cec58fc2aebe7628646d9a16a
|
|
BLAKE2b-256 checksum How to use checksums |
a3b8bf1da7d45e7e556f1d5ba8d115758c1dd6693cf1d69d343ce8eaa5b55826
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|
Release files / duckduckgo_search_api-0.1.5-py3-none-any.whl
| Download URL | duckduckgo_search_api-0.1.5-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d08c59db31adc1ff68353339e618b100fdebf9ac7ffee987bf1960dfdca548a4
|
|
BLAKE2b-256 checksum How to use checksums |
76c5f1956a1d81634632e1841e5b0298e5051e3edf3c751671eb639bca41d81e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.19
|