ddgs


Nameddgs JSON
Version 9.1.0 PyPI version JSON
download
home_pageNone
SummaryDux Distributed Global Search. A metasearch library that aggregates results from diverse web search services.
upload_time2025-07-12 17:40:04
maintainerNone
docs_urlNone
authordeedy5
requires_python>=3.9
licenseMIT License
keywords python search metasearch
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Python >= 3.9](https://img.shields.io/badge/python->=3.9-red.svg) [![](https://badgen.net/github/release/deedy5/ddgs)](https://github.com/deedy5/ddgs/releases) [![](https://badge.fury.io/py/ddgs.svg)](https://pypi.org/project/ddgs)
# D.D.G.S. | Dux Distributed Global Search<a name="TOP"></a>

A metasearch library that aggregates results from diverse web search services.


## Table of Contents
* [Install](#install)
* [CLI version](#cli-version)
* [DDGS search operators](#ddgs-search-operators)
* [Regions](#regions)
* [DDGS class](#ddgs-class)
* [Proxy](#proxy)
* [Exceptions](#exceptions)
* [1. text()](#1-text)
* [2. images()](#2-images)
* [3. videos()](#3-videos)
* [4. news()](#4-news)
* [Disclaimer](#disclaimer)

## Install
```python
pip install -U ddgs
```

## CLI version

```python3
ddgs --help
```
CLI examples:
```python3
# text search
ddgs text -q "Assyrian siege of Jerusalem"
# find and download pdf files via proxy
ddgs text -q "Economics in one lesson filetype:pdf" -r us-en -n 50 -pr https://1.2.3.4:1234 -d -dd economics_reading
# using Tor Browser as a proxy (`tb` is an alias for `socks5h://127.0.0.1:9150`)
ddgs text -q "'The history of the Standard Oil Company' filetype:doc" -n 50 -d -pr tb
# find and save to csv
ddgs text -q "'neuroscience exploring the brain' filetype:pdf" -n 70 -o neuroscience_list.csv
# don't verify SSL when making the request
ddgs text -q "Mississippi Burning" -v false
# find and download images
ddgs images -q "beware of false prophets" -r ar-es -type photo -n 500 -d
# get news for the last day and save to json
ddgs news -q "sanctions" -n 100 -t d -o json
```
[Go To TOP](#TOP)

## DDGS search operators

| Query example |	Result|
| ---     | ---   |
| cats dogs |	Results about cats or dogs |
| "cats and dogs" |	Results for exact term "cats and dogs". If no results are found, related results are shown. |
| cats -dogs |	Fewer dogs in results |
| cats +dogs |	More dogs in results |
| cats filetype:pdf |	PDFs about cats. Supported file types: pdf, doc(x), xls(x), ppt(x), html |
| dogs site:example.com  |	Pages about dogs from example.com |
| cats -site:example.com |	Pages about cats, excluding example.com |
| intitle:dogs |	Page title includes the word "dogs" |
| inurl:cats  |	Page url includes the word "cats" |

[Go To TOP](#TOP)

## Regions
<details>
  <summary>expand</summary>

    xa-ar for Arabia
    xa-en for Arabia (en)
    ar-es for Argentina
    au-en for Australia
    at-de for Austria
    be-fr for Belgium (fr)
    be-nl for Belgium (nl)
    br-pt for Brazil
    bg-bg for Bulgaria
    ca-en for Canada
    ca-fr for Canada (fr)
    ct-ca for Catalan
    cl-es for Chile
    cn-zh for China
    co-es for Colombia
    hr-hr for Croatia
    cz-cs for Czech Republic
    dk-da for Denmark
    ee-et for Estonia
    fi-fi for Finland
    fr-fr for France
    de-de for Germany
    gr-el for Greece
    hk-tzh for Hong Kong
    hu-hu for Hungary
    in-en for India
    id-id for Indonesia
    id-en for Indonesia (en)
    ie-en for Ireland
    il-he for Israel
    it-it for Italy
    jp-jp for Japan
    kr-kr for Korea
    lv-lv for Latvia
    lt-lt for Lithuania
    xl-es for Latin America
    my-ms for Malaysia
    my-en for Malaysia (en)
    mx-es for Mexico
    nl-nl for Netherlands
    nz-en for New Zealand
    no-no for Norway
    pe-es for Peru
    ph-en for Philippines
    ph-tl for Philippines (tl)
    pl-pl for Poland
    pt-pt for Portugal
    ro-ro for Romania
    ru-ru for Russia
    sg-en for Singapore
    sk-sk for Slovak Republic
    sl-sl for Slovenia
    za-en for South Africa
    es-es for Spain
    se-sv for Sweden
    ch-de for Switzerland (de)
    ch-fr for Switzerland (fr)
    ch-it for Switzerland (it)
    tw-tzh for Taiwan
    th-th for Thailand
    tr-tr for Turkey
    ua-uk for Ukraine
    uk-en for United Kingdom
    us-en for United States
    ue-es for United States (es)
    ve-es for Venezuela
    vn-vi for Vietnam
___
</details>

[Go To TOP](#TOP)


## DDGS class

```python3
class DDGS:
    """Dux Distributed Global Search. A metasearch library that aggregates results from diverse web search services.

    Args:
        proxy (str, optional): proxy for the HTTP client, supports http/https/socks5 protocols.
            example: "http://user:pass@example.com:3128". Defaults to None.
        timeout (int, optional): Timeout value for the HTTP client. Defaults to 10.
        verify (bool): SSL verification when making the request. Defaults to True.
    """
```

Here is an example of initializing the DDGS class.
```python3
from ddgs import DDGS

results = DDGS().text("python programming", max_results=5)
print(results)
```

[Go To TOP](#TOP)

## Proxy

Package supports http/https/socks proxies. Example: `http://user:pass@example.com:3128`.
Use a rotating proxy. Otherwise, use a new proxy with each DDGS class initialization.

*1. The easiest way. Launch the Tor Browser*
```python3
ddgs = DDGS(proxy="tb", timeout=20)  # "tb" is an alias for "socks5h://127.0.0.1:9150"
results = ddgs.text("something you need", max_results=50)
```
*2. Use any proxy server* (*example with [iproyal rotating residential proxies](https://iproyal.com?r=residential_proxies)*)
```python3
ddgs = DDGS(proxy="socks5h://user:password@geo.iproyal.com:32325", timeout=20)
results = ddgs.text("something you need", max_results=50)
```
*3. The proxy can also be set using the `DDGS_PROXY` environment variable.*
```python3
export DDGS_PROXY="socks5h://user:password@geo.iproyal.com:32325"
```

[Go To TOP](#TOP)

## Exceptions

```python
from ddgs.exceptions import (
    DDGSException,
    RatelimitException,
    TimeoutException,
)
```

Exceptions:
- `DDGSException`: Base exception for ddgs errors.
- `RatelimitException`: Inherits from DDGSException, raised for exceeding API request rate limits.
- `TimeoutException`: Inherits from DDGSException, raised for API request timeouts.

[Go To TOP](#TOP)

## 1. text()

```python
def text(
    query: str,
    region: str = "us-en",
    safesearch: str = "moderate",
    timelimit: str | None = None,
    num_results: int | None = None,
    page: int = 1,
    backend: str | list[str] = "auto",
) -> list[dict[str, str]]:
    """DDGS text metasearch.

    Args:
        query: text search query.
        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.
        safesearch: on, moderate, off. Defaults to "moderate".
        timelimit: d, w, m, y. Defaults to None.
        num_results: number of results. Defaults to None.
        page: page of results. Defaults to 1.
        backend: A single or list of backends. Defaults to "auto" (first two).

    Returns:
        List of dictionaries with search results.
    """
```
***Example***
```python
results = DDGS().text('live free or die', region='us-en', safesearch='off', timelimit='y', page=1, backend="auto")
# Searching for pdf files
results = DDGS().text('russia filetype:pdf', region='us-en', safesearch='off', timelimit='y', page=1, backend="auto")
print(results)
[
    {
        "title": "News, sport, celebrities and gossip | The Sun",
        "href": "https://www.thesun.co.uk/",
        "body": "Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The Sun",
    }, ...
]
```

[Go To TOP](#TOP)

## 2. images()

```python
def images(
    query: str,
    region: str = "us-en",
    safesearch: str = "moderate",
    timelimit: str | None = None,
    num_results: int | None = None,
    page: int = 1,
    backend: str | list[str] = "auto",
    size: str | None = None,
    color: str | None = None,
    type_image: str | None = None,
    layout: str | None = None,
    license_image: str | None = None,
) -> list[dict[str, str]]:
    """DDGS images metasearch.

    Args:
        query: images search query.
        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.
        safesearch: on, moderate, off. Defaults to "moderate".
        timelimit: d, w, m, y. Defaults to None.
        num_results: number of results. Defaults to None.
        page: page of results. Defaults to 1.
        backend: A single or list of backends. Defaults to "auto" (first two).
        size: Small, Medium, Large, Wallpaper. Defaults to None.
        color: color, Monochrome, Red, Orange, Yellow, Green, Blue,
            Purple, Pink, Brown, Black, Gray, Teal, White. Defaults to None.
        type_image: photo, clipart, gif, transparent, line.
            Defaults to None.
        layout: Square, Tall, Wide. Defaults to None.
        license_image: any (All Creative Commons), Public (PublicDomain),
            Share (Free to Share and Use), ShareCommercially (Free to Share and Use Commercially),
            Modify (Free to Modify, Share, and Use), ModifyCommercially (Free to Modify, Share, and
            Use Commercially). Defaults to None.

    Returns:
        List of dictionaries with images search results.
    """
```
***Example***
```python
results = DDGS().images(
    query="butterfly",
    region="us-en",
    safesearch="off",
    timelimit="m",
    page=1,
    backend="auto",
    size=None,
    color="Monochrome",
    type_image=None,
    layout=None,
    license_image=None,
)
print(images)
[
    {
        "title": "File:The Sun by the Atmospheric Imaging Assembly of NASA's Solar ...",
        "image": "https://upload.wikimedia.org/wikipedia/commons/b/b4/The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA's_Solar_Dynamics_Observatory_-_20100819.jpg",
        "thumbnail": "https://tse4.mm.bing.net/th?id=OIP.lNgpqGl16U0ft3rS8TdFcgEsEe&pid=Api",
        "url": "https://en.wikipedia.org/wiki/File:The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA's_Solar_Dynamics_Observatory_-_20100819.jpg",
        "height": 3860,
        "width": 4044,
        "source": "Bing",
    }, ...
]
```

[Go To TOP](#TOP)

## 3. videos()

```python
def videos(
    query: str,
    region: str = "us-en",
    safesearch: str = "moderate",
    timelimit: str | None = None,
    num_results: int | None = None,
    page: int = 1,
    backend: str | list[str] = "auto",
    resolution: str | None = None,
    duration: str | None = None,
    license_videos: str | None = None,
) -> list[dict[str, str]]:
    """DDGS videos metasearch.

    Args:
        query: videos search query.
        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.
        safesearch: on, moderate, off. Defaults to "moderate".
        timelimit: d, w, m. Defaults to None.
        num_results: number of results. Defaults to None.
        page: page of results. Defaults to 1.
        backend: A single or list of backends. Defaults to "auto" (first two).
        resolution: high, standart. Defaults to None.
        duration: short, medium, long. Defaults to None.
        license_videos: creativeCommon, youtube. Defaults to None.

    Returns:
        List of dictionaries with videos search results.
    """
```
***Example***
```python
results = DDGS().videos(
    query="cars",
    region="us-en",
    safesearch="off",
    timelimit="w",
    page=1,
    backend="auto",
    resolution="high",
    duration="medium",
)
print(results)
[
    {
        "content": "https://www.youtube.com/watch?v=6901-C73P3g",
        "description": "Watch the Best Scenes of popular Tamil Serial #Meena that airs on Sun TV. Watch all Sun TV serials immediately after the TV telecast on Sun NXT app. *Free for Indian Users only Download here: Android - http://bit.ly/SunNxtAdroid iOS: India - http://bit.ly/sunNXT Watch on the web - https://www.sunnxt.com/ Two close friends, Chidambaram ...",
        "duration": "8:22",
        "embed_html": '<iframe width="1280" height="720" src="https://www.youtube.com/embed/6901-C73P3g?autoplay=1" frameborder="0" allowfullscreen></iframe>',
        "embed_url": "https://www.youtube.com/embed/6901-C73P3g?autoplay=1",
        "image_token": "6c070b5f0e24e5972e360d02ddeb69856202f97718ea6c5d5710e4e472310fa3",
        "images": {
            "large": "https://tse4.mm.bing.net/th?id=OVF.JWBFKm1u%2fHd%2bz2e1GitsQw&pid=Api",
            "medium": "https://tse4.mm.bing.net/th?id=OVF.JWBFKm1u%2fHd%2bz2e1GitsQw&pid=Api",
            "motion": "",
            "small": "https://tse4.mm.bing.net/th?id=OVF.JWBFKm1u%2fHd%2bz2e1GitsQw&pid=Api",
        },
        "provider": "Bing",
        "published": "2024-07-03T05:30:03.0000000",
        "publisher": "YouTube",
        "statistics": {"viewCount": 29059},
        "title": "Meena - Best Scenes | 02 July 2024 | Tamil Serial | Sun TV",
        "uploader": "Sun TV",
    }, ...
]
```

[Go To TOP](#TOP)

## 4. news()

```python
def news(
    query: str,
    region: str = "us-en",
    safesearch: str = "moderate",
    timelimit: str | None = None,
    num_results: int | None = None,
    page: int = 1,
    backend: str | list[str] = "auto",
) -> list[dict[str, str]]:
    """DDGS news metasearch.

    Args:
        query: news search query.
        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.
        safesearch: on, moderate, off. Defaults to "moderate".
        timelimit: d, w, m. Defaults to None.
        num_results: number of results. Defaults to None.
        page: page of results. Defaults to 1.
        backend: A single or list of backends. Defaults to "auto" (first two).

    Returns:
        List of dictionaries with news search results.
    """
```
***Example***
```python
results = DDGS().news(query="sun", region="us-en", safesearch="off", timelimit="m", page=1, backend="auto")
print(results)
[
    {
        "date": "2024-07-03T16:25:22+00:00",
        "title": "Murdoch's Sun Endorses Starmer's Labour Day Before UK Vote",
        "body": "Rupert Murdoch's Sun newspaper endorsed Keir Starmer and his opposition Labour Party to win the UK general election, a dramatic move in the British media landscape that illustrates the country's shifting political sands.",
        "url": "https://www.msn.com/en-us/money/other/murdoch-s-sun-endorses-starmer-s-labour-day-before-uk-vote/ar-BB1plQwl",
        "image": "https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1plZil.img?w=2000&h=1333&m=4&q=79",
        "source": "Bloomberg on MSN.com",
    }, ...
]
```

[Go To TOP](#TOP)

## Disclaimer

This library is for educational purposes only.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ddgs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "python, search, metasearch",
    "author": "deedy5",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/37/82/3a6030d4db4a2b48423654be80ec6fe8585ce18f97b7c502622acce542f5/ddgs-9.1.0.tar.gz",
    "platform": null,
    "description": "![Python >= 3.9](https://img.shields.io/badge/python->=3.9-red.svg) [![](https://badgen.net/github/release/deedy5/ddgs)](https://github.com/deedy5/ddgs/releases) [![](https://badge.fury.io/py/ddgs.svg)](https://pypi.org/project/ddgs)\n# D.D.G.S. | Dux Distributed Global Search<a name=\"TOP\"></a>\n\nA metasearch library that aggregates results from diverse web search services.\n\n\n## Table of Contents\n* [Install](#install)\n* [CLI version](#cli-version)\n* [DDGS search operators](#ddgs-search-operators)\n* [Regions](#regions)\n* [DDGS class](#ddgs-class)\n* [Proxy](#proxy)\n* [Exceptions](#exceptions)\n* [1. text()](#1-text)\n* [2. images()](#2-images)\n* [3. videos()](#3-videos)\n* [4. news()](#4-news)\n* [Disclaimer](#disclaimer)\n\n## Install\n```python\npip install -U ddgs\n```\n\n## CLI version\n\n```python3\nddgs --help\n```\nCLI examples:\n```python3\n# text search\nddgs text -q \"Assyrian siege of Jerusalem\"\n# find and download pdf files via proxy\nddgs text -q \"Economics in one lesson filetype:pdf\" -r us-en -n 50 -pr https://1.2.3.4:1234 -d -dd economics_reading\n# using Tor Browser as a proxy (`tb` is an alias for `socks5h://127.0.0.1:9150`)\nddgs text -q \"'The history of the Standard Oil Company' filetype:doc\" -n 50 -d -pr tb\n# find and save to csv\nddgs text -q \"'neuroscience exploring the brain' filetype:pdf\" -n 70 -o neuroscience_list.csv\n# don't verify SSL when making the request\nddgs text -q \"Mississippi Burning\" -v false\n# find and download images\nddgs images -q \"beware of false prophets\" -r ar-es -type photo -n 500 -d\n# get news for the last day and save to json\nddgs news -q \"sanctions\" -n 100 -t d -o json\n```\n[Go To TOP](#TOP)\n\n## DDGS search operators\n\n| Query example |\tResult|\n| ---     | ---   |\n| cats dogs |\tResults about cats or dogs |\n| \"cats and dogs\" |\tResults for exact term \"cats and dogs\". If no results are found, related results are shown. |\n| cats -dogs |\tFewer dogs in results |\n| cats +dogs |\tMore dogs in results |\n| cats filetype:pdf |\tPDFs about cats. Supported file types: pdf, doc(x), xls(x), ppt(x), html |\n| dogs site:example.com  |\tPages about dogs from example.com |\n| cats -site:example.com |\tPages about cats, excluding example.com |\n| intitle:dogs |\tPage title includes the word \"dogs\" |\n| inurl:cats  |\tPage url includes the word \"cats\" |\n\n[Go To TOP](#TOP)\n\n## Regions\n<details>\n  <summary>expand</summary>\n\n    xa-ar for Arabia\n    xa-en for Arabia (en)\n    ar-es for Argentina\n    au-en for Australia\n    at-de for Austria\n    be-fr for Belgium (fr)\n    be-nl for Belgium (nl)\n    br-pt for Brazil\n    bg-bg for Bulgaria\n    ca-en for Canada\n    ca-fr for Canada (fr)\n    ct-ca for Catalan\n    cl-es for Chile\n    cn-zh for China\n    co-es for Colombia\n    hr-hr for Croatia\n    cz-cs for Czech Republic\n    dk-da for Denmark\n    ee-et for Estonia\n    fi-fi for Finland\n    fr-fr for France\n    de-de for Germany\n    gr-el for Greece\n    hk-tzh for Hong Kong\n    hu-hu for Hungary\n    in-en for India\n    id-id for Indonesia\n    id-en for Indonesia (en)\n    ie-en for Ireland\n    il-he for Israel\n    it-it for Italy\n    jp-jp for Japan\n    kr-kr for Korea\n    lv-lv for Latvia\n    lt-lt for Lithuania\n    xl-es for Latin America\n    my-ms for Malaysia\n    my-en for Malaysia (en)\n    mx-es for Mexico\n    nl-nl for Netherlands\n    nz-en for New Zealand\n    no-no for Norway\n    pe-es for Peru\n    ph-en for Philippines\n    ph-tl for Philippines (tl)\n    pl-pl for Poland\n    pt-pt for Portugal\n    ro-ro for Romania\n    ru-ru for Russia\n    sg-en for Singapore\n    sk-sk for Slovak Republic\n    sl-sl for Slovenia\n    za-en for South Africa\n    es-es for Spain\n    se-sv for Sweden\n    ch-de for Switzerland (de)\n    ch-fr for Switzerland (fr)\n    ch-it for Switzerland (it)\n    tw-tzh for Taiwan\n    th-th for Thailand\n    tr-tr for Turkey\n    ua-uk for Ukraine\n    uk-en for United Kingdom\n    us-en for United States\n    ue-es for United States (es)\n    ve-es for Venezuela\n    vn-vi for Vietnam\n___\n</details>\n\n[Go To TOP](#TOP)\n\n\n## DDGS class\n\n```python3\nclass DDGS:\n    \"\"\"Dux Distributed Global Search. A metasearch library that aggregates results from diverse web search services.\n\n    Args:\n        proxy (str, optional): proxy for the HTTP client, supports http/https/socks5 protocols.\n            example: \"http://user:pass@example.com:3128\". Defaults to None.\n        timeout (int, optional): Timeout value for the HTTP client. Defaults to 10.\n        verify (bool): SSL verification when making the request. Defaults to True.\n    \"\"\"\n```\n\nHere is an example of initializing the DDGS class.\n```python3\nfrom ddgs import DDGS\n\nresults = DDGS().text(\"python programming\", max_results=5)\nprint(results)\n```\n\n[Go To TOP](#TOP)\n\n## Proxy\n\nPackage supports http/https/socks proxies. Example: `http://user:pass@example.com:3128`.\nUse a rotating proxy. Otherwise, use a new proxy with each DDGS class initialization.\n\n*1. The easiest way. Launch the Tor Browser*\n```python3\nddgs = DDGS(proxy=\"tb\", timeout=20)  # \"tb\" is an alias for \"socks5h://127.0.0.1:9150\"\nresults = ddgs.text(\"something you need\", max_results=50)\n```\n*2. Use any proxy server* (*example with [iproyal rotating residential proxies](https://iproyal.com?r=residential_proxies)*)\n```python3\nddgs = DDGS(proxy=\"socks5h://user:password@geo.iproyal.com:32325\", timeout=20)\nresults = ddgs.text(\"something you need\", max_results=50)\n```\n*3. The proxy can also be set using the `DDGS_PROXY` environment variable.*\n```python3\nexport DDGS_PROXY=\"socks5h://user:password@geo.iproyal.com:32325\"\n```\n\n[Go To TOP](#TOP)\n\n## Exceptions\n\n```python\nfrom ddgs.exceptions import (\n    DDGSException,\n    RatelimitException,\n    TimeoutException,\n)\n```\n\nExceptions:\n- `DDGSException`: Base exception for ddgs errors.\n- `RatelimitException`: Inherits from DDGSException, raised for exceeding API request rate limits.\n- `TimeoutException`: Inherits from DDGSException, raised for API request timeouts.\n\n[Go To TOP](#TOP)\n\n## 1. text()\n\n```python\ndef text(\n    query: str,\n    region: str = \"us-en\",\n    safesearch: str = \"moderate\",\n    timelimit: str | None = None,\n    num_results: int | None = None,\n    page: int = 1,\n    backend: str | list[str] = \"auto\",\n) -> list[dict[str, str]]:\n    \"\"\"DDGS text metasearch.\n\n    Args:\n        query: text search query.\n        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.\n        safesearch: on, moderate, off. Defaults to \"moderate\".\n        timelimit: d, w, m, y. Defaults to None.\n        num_results: number of results. Defaults to None.\n        page: page of results. Defaults to 1.\n        backend: A single or list of backends. Defaults to \"auto\" (first two).\n\n    Returns:\n        List of dictionaries with search results.\n    \"\"\"\n```\n***Example***\n```python\nresults = DDGS().text('live free or die', region='us-en', safesearch='off', timelimit='y', page=1, backend=\"auto\")\n# Searching for pdf files\nresults = DDGS().text('russia filetype:pdf', region='us-en', safesearch='off', timelimit='y', page=1, backend=\"auto\")\nprint(results)\n[\n    {\n        \"title\": \"News, sport, celebrities and gossip | The Sun\",\n        \"href\": \"https://www.thesun.co.uk/\",\n        \"body\": \"Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The Sun\",\n    }, ...\n]\n```\n\n[Go To TOP](#TOP)\n\n## 2. images()\n\n```python\ndef images(\n    query: str,\n    region: str = \"us-en\",\n    safesearch: str = \"moderate\",\n    timelimit: str | None = None,\n    num_results: int | None = None,\n    page: int = 1,\n    backend: str | list[str] = \"auto\",\n    size: str | None = None,\n    color: str | None = None,\n    type_image: str | None = None,\n    layout: str | None = None,\n    license_image: str | None = None,\n) -> list[dict[str, str]]:\n    \"\"\"DDGS images metasearch.\n\n    Args:\n        query: images search query.\n        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.\n        safesearch: on, moderate, off. Defaults to \"moderate\".\n        timelimit: d, w, m, y. Defaults to None.\n        num_results: number of results. Defaults to None.\n        page: page of results. Defaults to 1.\n        backend: A single or list of backends. Defaults to \"auto\" (first two).\n        size: Small, Medium, Large, Wallpaper. Defaults to None.\n        color: color, Monochrome, Red, Orange, Yellow, Green, Blue,\n            Purple, Pink, Brown, Black, Gray, Teal, White. Defaults to None.\n        type_image: photo, clipart, gif, transparent, line.\n            Defaults to None.\n        layout: Square, Tall, Wide. Defaults to None.\n        license_image: any (All Creative Commons), Public (PublicDomain),\n            Share (Free to Share and Use), ShareCommercially (Free to Share and Use Commercially),\n            Modify (Free to Modify, Share, and Use), ModifyCommercially (Free to Modify, Share, and\n            Use Commercially). Defaults to None.\n\n    Returns:\n        List of dictionaries with images search results.\n    \"\"\"\n```\n***Example***\n```python\nresults = DDGS().images(\n    query=\"butterfly\",\n    region=\"us-en\",\n    safesearch=\"off\",\n    timelimit=\"m\",\n    page=1,\n    backend=\"auto\",\n    size=None,\n    color=\"Monochrome\",\n    type_image=None,\n    layout=None,\n    license_image=None,\n)\nprint(images)\n[\n    {\n        \"title\": \"File:The Sun by the Atmospheric Imaging Assembly of NASA's Solar ...\",\n        \"image\": \"https://upload.wikimedia.org/wikipedia/commons/b/b4/The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA's_Solar_Dynamics_Observatory_-_20100819.jpg\",\n        \"thumbnail\": \"https://tse4.mm.bing.net/th?id=OIP.lNgpqGl16U0ft3rS8TdFcgEsEe&pid=Api\",\n        \"url\": \"https://en.wikipedia.org/wiki/File:The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA's_Solar_Dynamics_Observatory_-_20100819.jpg\",\n        \"height\": 3860,\n        \"width\": 4044,\n        \"source\": \"Bing\",\n    }, ...\n]\n```\n\n[Go To TOP](#TOP)\n\n## 3. videos()\n\n```python\ndef videos(\n    query: str,\n    region: str = \"us-en\",\n    safesearch: str = \"moderate\",\n    timelimit: str | None = None,\n    num_results: int | None = None,\n    page: int = 1,\n    backend: str | list[str] = \"auto\",\n    resolution: str | None = None,\n    duration: str | None = None,\n    license_videos: str | None = None,\n) -> list[dict[str, str]]:\n    \"\"\"DDGS videos metasearch.\n\n    Args:\n        query: videos search query.\n        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.\n        safesearch: on, moderate, off. Defaults to \"moderate\".\n        timelimit: d, w, m. Defaults to None.\n        num_results: number of results. Defaults to None.\n        page: page of results. Defaults to 1.\n        backend: A single or list of backends. Defaults to \"auto\" (first two).\n        resolution: high, standart. Defaults to None.\n        duration: short, medium, long. Defaults to None.\n        license_videos: creativeCommon, youtube. Defaults to None.\n\n    Returns:\n        List of dictionaries with videos search results.\n    \"\"\"\n```\n***Example***\n```python\nresults = DDGS().videos(\n    query=\"cars\",\n    region=\"us-en\",\n    safesearch=\"off\",\n    timelimit=\"w\",\n    page=1,\n    backend=\"auto\",\n    resolution=\"high\",\n    duration=\"medium\",\n)\nprint(results)\n[\n    {\n        \"content\": \"https://www.youtube.com/watch?v=6901-C73P3g\",\n        \"description\": \"Watch the Best Scenes of popular Tamil Serial #Meena that airs on Sun TV. Watch all Sun TV serials immediately after the TV telecast on Sun NXT app. *Free for Indian Users only Download here: Android - http://bit.ly/SunNxtAdroid iOS: India - http://bit.ly/sunNXT Watch on the web - https://www.sunnxt.com/ Two close friends, Chidambaram ...\",\n        \"duration\": \"8:22\",\n        \"embed_html\": '<iframe width=\"1280\" height=\"720\" src=\"https://www.youtube.com/embed/6901-C73P3g?autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>',\n        \"embed_url\": \"https://www.youtube.com/embed/6901-C73P3g?autoplay=1\",\n        \"image_token\": \"6c070b5f0e24e5972e360d02ddeb69856202f97718ea6c5d5710e4e472310fa3\",\n        \"images\": {\n            \"large\": \"https://tse4.mm.bing.net/th?id=OVF.JWBFKm1u%2fHd%2bz2e1GitsQw&pid=Api\",\n            \"medium\": \"https://tse4.mm.bing.net/th?id=OVF.JWBFKm1u%2fHd%2bz2e1GitsQw&pid=Api\",\n            \"motion\": \"\",\n            \"small\": \"https://tse4.mm.bing.net/th?id=OVF.JWBFKm1u%2fHd%2bz2e1GitsQw&pid=Api\",\n        },\n        \"provider\": \"Bing\",\n        \"published\": \"2024-07-03T05:30:03.0000000\",\n        \"publisher\": \"YouTube\",\n        \"statistics\": {\"viewCount\": 29059},\n        \"title\": \"Meena - Best Scenes | 02 July 2024 | Tamil Serial | Sun TV\",\n        \"uploader\": \"Sun TV\",\n    }, ...\n]\n```\n\n[Go To TOP](#TOP)\n\n## 4. news()\n\n```python\ndef news(\n    query: str,\n    region: str = \"us-en\",\n    safesearch: str = \"moderate\",\n    timelimit: str | None = None,\n    num_results: int | None = None,\n    page: int = 1,\n    backend: str | list[str] = \"auto\",\n) -> list[dict[str, str]]:\n    \"\"\"DDGS news metasearch.\n\n    Args:\n        query: news search query.\n        region: us-en, uk-en, ru-ru, etc. Defaults to us-en.\n        safesearch: on, moderate, off. Defaults to \"moderate\".\n        timelimit: d, w, m. Defaults to None.\n        num_results: number of results. Defaults to None.\n        page: page of results. Defaults to 1.\n        backend: A single or list of backends. Defaults to \"auto\" (first two).\n\n    Returns:\n        List of dictionaries with news search results.\n    \"\"\"\n```\n***Example***\n```python\nresults = DDGS().news(query=\"sun\", region=\"us-en\", safesearch=\"off\", timelimit=\"m\", page=1, backend=\"auto\")\nprint(results)\n[\n    {\n        \"date\": \"2024-07-03T16:25:22+00:00\",\n        \"title\": \"Murdoch's Sun Endorses Starmer's Labour Day Before UK Vote\",\n        \"body\": \"Rupert Murdoch's Sun newspaper endorsed Keir Starmer and his opposition Labour Party to win the UK general election, a dramatic move in the British media landscape that illustrates the country's shifting political sands.\",\n        \"url\": \"https://www.msn.com/en-us/money/other/murdoch-s-sun-endorses-starmer-s-labour-day-before-uk-vote/ar-BB1plQwl\",\n        \"image\": \"https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1plZil.img?w=2000&h=1333&m=4&q=79\",\n        \"source\": \"Bloomberg on MSN.com\",\n    }, ...\n]\n```\n\n[Go To TOP](#TOP)\n\n## Disclaimer\n\nThis library is for educational purposes only.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Dux Distributed Global Search. A metasearch library that aggregates results from diverse web search services.",
    "version": "9.1.0",
    "project_urls": {
        "Homepage": "https://github.com/deedy5/ddgs"
    },
    "split_keywords": [
        "python",
        " search",
        " metasearch"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9509f4d8cde3da75de63a938c6f8369de133422fb3f407d8cd9d20120b1ed74d",
                "md5": "f2973c835f564048352a8d1ed0e53b86",
                "sha256": "dbc9abfad25f40677520ba2bdac67c55ea3f8a6d257f47a62f81c5f9e5f51881"
            },
            "downloads": -1,
            "filename": "ddgs-9.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f2973c835f564048352a8d1ed0e53b86",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 25148,
            "upload_time": "2025-07-12T17:40:03",
            "upload_time_iso_8601": "2025-07-12T17:40:03.677529Z",
            "url": "https://files.pythonhosted.org/packages/95/09/f4d8cde3da75de63a938c6f8369de133422fb3f407d8cd9d20120b1ed74d/ddgs-9.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "37823a6030d4db4a2b48423654be80ec6fe8585ce18f97b7c502622acce542f5",
                "md5": "c09fccc8682867a73fec936b0d1c2079",
                "sha256": "dfca16a9818e68ce834d19795a5c1c09fbafb23f2cf1f6beb3ef5a4563e6f1ef"
            },
            "downloads": -1,
            "filename": "ddgs-9.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c09fccc8682867a73fec936b0d1c2079",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 24783,
            "upload_time": "2025-07-12T17:40:04",
            "upload_time_iso_8601": "2025-07-12T17:40:04.765762Z",
            "url": "https://files.pythonhosted.org/packages/37/82/3a6030d4db4a2b48423654be80ec6fe8585ce18f97b7c502622acce542f5/ddgs-9.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 17:40:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "deedy5",
    "github_project": "ddgs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ddgs"
}
        
Elapsed time: 0.65202s