Skip to main content

Duckduckgo.com search results

Project description

Python >= 3.6

Duckduckgo_search

Duckduckgo.com search results.

Dependencies

lxml, requests

Install

pip install -U duckduckgo_search

Usage

from duckduckgo_search import ddg

ddg(keywords, region='wt-wt', safesearch='Moderate', time=None, max_results=30, **kwargs):
    '''
    DuckDuckGo search
    Query parameters, link: https://duckduckgo.com/params:
    keywords: keywords for query;
    safesearch: On (kp = 1), Moderate (kp = -1), Off (kp = -2);
    region: country of results - wt-wt (Global), us-en, uk-en, ru-ru, etc.;
    time: 'd' (day), 'w' (week), 'm' (month), 'y' (year), or 'year-month-date..year-month-date';
    max_results: depends on the keyword, the maximum DDG gives out about 200 results.
    '''

Returns

[{'title': title of result,
  'href': href of result,
  'body': body of result,},
 {'title': title of result,
  'href': href of result,
  'body': body of result,}, ...]

Example

keywords = 'google'
results = ddg(keywords, region='wt-wt', safesearch='Moderate', time='y', max_results=2)
print(results)
[{'title': 'Google', 'href': 'http://www.l.google.com/', 'body': "Google has many special features to help you find exactly what you're looking for. Advertising Programs Business Solutions About Google."}, {'title': 'Google - Home | Facebook', 'href': 'https://www.facebook.com/Google/', 'body': "Google, Mountain View, CA. 28M likes · 52,285 talking about this · 611 were here. Organizing the world's information and making it universally accessible... See actions taken by the people who manage and post content. Google Inc. is responsible for this Page."}]

Project details


Release history Release notifications | RSS feed

This version

0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

duckduckgo_search-0.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

duckduckgo_search-0.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file duckduckgo_search-0.3.tar.gz.

File metadata

  • Download URL: duckduckgo_search-0.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for duckduckgo_search-0.3.tar.gz
Algorithm Hash digest
SHA256 97bee75af4533e215f50421833eba4f853ae390e2e5cd7468482187d6f828058
MD5 dc420f7580f7ea165e2c42172d46502d
BLAKE2b-256 328da987899e9a3b649c79e1d04f0b3aca25afdd63046fdaf32ea62e9458cea4

See more details on using hashes here.

Provenance

File details

Details for the file duckduckgo_search-0.3-py3-none-any.whl.

File metadata

  • Download URL: duckduckgo_search-0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for duckduckgo_search-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f08701116acef3dd5e53fd2b20b917d1687bd076819c036ca64f0ef1dee925d3
MD5 2124ab78d525701141c0be079a03bc43
BLAKE2b-256 dd9b76ae908c762b9a9a1338d1e8e95af40fc8edde71d4f1f30d88229ed6280d

See more details on using hashes here.

Provenance

Supported by

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