This repository offers two solutions for extracting data from DuckDuckGo Search Engine Results Pages (SERPs):
- Free DuckDuckGo Scraper: A tool for scraping DuckDuckGo Search Results at small scale
- Enterprise-grade DuckDuckGo SERP API: A scalable, production-ready solution for high-volume, real-time data extraction (part of Bright Data's SERP Scraper API)
- Free DuckDuckGo SERP Scraper
- DuckDuckGo SERP API
- Implementation Methods
- DuckDuckGo Search Query Parameters
- Practical Example
- Support & Resources
The Free DuckDuckGo SERP Scraper offers a straightforward method for collecting search result data on a smaller scale. It’s perfect if you need limited data without the overhead of managing proxies or handling high volumes.
- Python 3.9+ – Download Python
- Required Packages:
selenium
(for browser automation)webdriver-manager
(for managing browser drivers)beautifulsoup4
(for HTML parsing)
Install the packages using:
pip install selenium webdriver-manager beautifulsoup4
New to Web Scraping?
Kickstart your journey with our Beginner’s Guide to Web Scraping with Python. Then, level up with our Using Selenium for Web Scraping tutorial, and if you’re already comfortable with Selenium, take your skills further with our advanced SeleniumBase guide.
-
Open the duckduckgo-serp-scraper.py file.
-
Customize the search terms as needed:
SEARCH_TERMS = [ "ergonomic office chair", "coffee maker", ]
-
Run the script to begin scraping.
Below is a preview of the scraper output:
Keep in mind that while the free scraper is great for basic tasks, it has some important limitations:
- High risk of IP blocking with frequent use
- Limited request volume capacity
- Frequent CAPTCHA interruptions
- Not suitable for production environments
For a scalable and stable solution, consider Bright Data's dedicated API detailed below 👇
The DuckDuckGo SERP API is part of Bright Data’s comprehensive SERP Scraper API suite. It leverages our industry-leading DuckDuckGo proxy infrastructure to deliver real-time DuckDuckGo search results with a single API call.
- Global Accuracy: Get tailored results for specific locations worldwide.
- Pay-Per-Success: You pay only for successful requests.
- Real-Time Data: Access up-to-date search results in seconds.
- Unlimited Scalability: Handle high-volume scraping effortlessly.
- Cost-Efficient: No need for expensive infrastructure.
- Reliable Performance: Advanced anti-blocking technology ensures consistent results.
- 24/7 Expert Support: Get assistance whenever you need it.
📌 Try Before You Buy: Experience our solution with the SERP API Live Demo.
- Create a Bright Data account (new users receive a $5 credit).
- Generate your API key.
- Follow our step-by-step configuration guide to integrate the SERP API.
You can integrate the DuckDuckGo SERP API into your workflow using one of two approaches:
Make a direct request to Bright Data’s API endpoint.
curl https://api.brightdata.com/request \
-H "Content-Type: application/json" \
-H "Authorization: Bearer API_TOKEN" \
-d '{
"zone": "ZONE_NAME",
"url": "https://duckduckgo.com/?q=budget+laptops+under+500+gbp&kl=uk-en&kad=en-gb&df=w",
"format": "raw"
}'
import requests
url = "https://api.brightdata.com/request"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer API_TOKEN"
}
payload = {
"zone": "ZONE_NAME",
"url": "https://duckduckgo.com/?q=budget+laptops+under+500+gbp&kl=uk-en&kad=en-gb&df=w",
"format": "raw",
}
response = requests.post(url, headers=headers, json=payload)
with open("duckduckgo-scraper-api-result.html", "w", encoding="utf-8") as file:
file.write(response.text)
print("Response saved!")
Use proxy routing for direct access to search results.
curl -i \
--proxy brd.superproxy.io:33335 \
--proxy-user brd-customer-<CUSTOMER_ID>-zone-<ZONE_NAME>:<ZONE_PASSWORD> \
-k \
"https://duckduckgo.com/?q=budget+laptops+under+500+gbp&kl=uk-en&kad=en-gb&df=w"
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
host = "brd.superproxy.io"
port = 33335
username = "brd-customer-<CUSTOMER_ID>-zone-<ZONE_NAME>"
password = "<ZONE_PASSWORD>"
proxy_url = f"http://{username}:{password}@{host}:{port}"
proxies = {
"http": proxy_url,
"https": proxy_url
}
url = "https://duckduckgo.com/?q=budget+laptops+under+500+gbp&kl=uk-en&kad=en-gb&df=w"
response = requests.get(url, proxies=proxies, verify=False)
with open("duckduckgo-scraper-api-result.html", "w", encoding="utf-8") as file:
file.write(response.text)
print("Response saved!")
Note: For production use with the native proxy approach, installing Bright Data’s SSL certificate is recommended. Refer to our SSL Certificate Guide for details.
👉 For a full preview of the HTML output, see the complete result.
Fine-tune your search results by using various query parameters.
Specifies the country and language for search results.
Example:
curl --proxy brd.superproxy.io:33335 \
--proxy-user brd-customer-<id>-zone-<zone>:<password> \
"https://duckduckgo.com/?q=best+coffee+brands&kl=it-it"
This returns search results tailored for Italy.
Controls the language of the DuckDuckGo interface.
Example:
https://duckduckgo.com/?q=photo+editing+tools&kad=de
This keeps the search content in English while displaying the interface in German.
Adjusts content filtering for adult material.
1
– Strict Safe Search-1
– Moderate-2
– Off
Example:
https://duckduckgo.com/?q=swimsuit&kp=1
Returns only family-safe results for "swimsuit”.
Limits search results to a specific time frame.
d
– Past dayw
– Past weekm
– Past monthy
– Past year- Custom range: e.g.,
2025-03-01..2025-03-10
Example:
https://duckduckgo.com/?q=iphone+15+review&df=w
Shows only recent reviews (within the last week).
Simulate searches from various device types.
0
– Desktop (default)1
– Random mobile deviceios
oriphone
– iPhoneipad
orios_tablet
– iPadandroid
– Android phoneandroid_tablet
– Android tablet
Example:
https://duckduckgo.com/?q=top+travel+apps&brd_mobile=ios
This simulates an iPhone user. You might see app store links, mobile-focused content, or AMP pages.
Specify the browser’s user-agent for the request.
- Default (random browser)
chrome
– Google Chromesafari
– Safarifirefox
– Mozilla Firefox (not compatible withbrd_mobile=1
)
Example:
https://duckduckgo.com/?q=best+vpn+services&brd_browser=safari
This simulates a Safari browser, providing insights into how content is displayed and ranked on that platform.
You're monitoring competitors' pricing pages for "budget laptops under £500" in the UK, targeting mobile users.
Your goal is to:
- Simulate a UK-based mobile user
- Get localized English results (UK-specific retailers, currency)
- Use a mobile Chrome user agent (to capture mobile-specific results like AMP pages)
- Focus on recent product listicles or deals
Combine these requirements in a single cURL command:
curl --proxy brd.superproxy.io:33335 \
--proxy-user brd-customer-<CUSTOMER_ID>-zone-<ZONE_NAME>:<ZONE_PASSWORD> \
"https://duckduckgo.com/?\
q=budget+laptops+under+500+gbp&\
kl=uk-en&\
kad=en-gb&\
df=w&\
brd_mobile=android&\
brd_browser=chrome"
🎯 This fetches mobile-first, localized, and recent content.
- Documentation: SERP API Documentation
- Related APIs:
- Use Cases:
- Additional Reading: Best SERP APIs
- Contact Support: support@brightdata.com