Hacker News new | past | comments | ask | show | jobs | submit login
DuckDuckGo Terminal Interface (duckduckgo.com)
210 points by LucasLarson on Oct 29, 2019 | hide | past | favorite | 80 comments



I thought maybe this would be an actual terminal client, as in a way to search DDG via the terminal.



Nice, though I suspect a bunch of the parameters can be submitted with the request.

I've got a bash function wrapper around w3m that fires off searches from the shell. It's not a dedicated DDG client, but then again, after you hit the search results, the goal is to view the results page. This does use the "lite" page, which is console-browser friendly-er

    ddg () 
    { 
        w3m https://duckduckgo.com/lite?q="$*&fd=-1"
    }
Full params list: https://duckduckgo.com/params

Nothing for number of results on page, that I see, though I've just added the toggle for no redirect ("&fd=-1", included above now).


NB: that should be "&kd=-1", not "fd".

    ddg () 
        { 
            w3m https://duckduckgo.com/lite?q="$*&kd=-1"
        }


This is what I was looking for (although honestly I probably won't use this often... unless I get used to it).

Thanks!


It uses DDG json api, which gives different search result than their web version in a lot of cases.

https://api.duckduckgo.com/api

>This API does not include all of our links, however. That is, it is not a full search results API or a way to get DuckDuckGo results into your applications beyond our instant answers. Because of the way we generate our search results, we unfortunately do not have the rights to fully syndicate our results, free or paid. For the same reason, we cannot allow framing our results without our branding. Please see our partnerships page for more info on guidelines and getting in touch with us.


Nice does it support piping results to firefox?


Yes, you can open the results in FF.


You just made my day, this is awesome! Thanks


This could be an excellent way to convert those who enjoy the command line (including me). I get awfully sick of google's garbage, "We've detected automated traffic from your systems." I don't scrape stuff, but if I did, so what? This is worse on things like tor or if I can't use JS. Why can't I just type in a query and get back a result?

Now, please make this an actual CLI. I want to type `search "performant c hash table"` from my command line and get back results. I can open the resultant link in something like lynx, as all I need is probably textual. This is perfect for development use cases.



I liked DDG a lot .. but when I discovered that it is effectively an UI over Bing (Yahoo?), I am a lot less impressed.

Is there any search engine which is NOT backed by an extremely heavyweight player?


This comment is made a lot but it's only half true. DDG does use Bing to source some of it's results but it does have it's own crawlers too. In practice this means that it isn't "effectively a UI over Bing".


Here's an old but interesting SO post that if true would indicate otherwise https://stackoverflow.com/a/24089393


Seems people can't find your source, so I did some digging and found this:

"We also of course have more traditional links in the search results, which we also source from a variety of partners, including Verizon Media (formerly Yahoo) and Bing."[0]

[0]https://help.duckduckgo.com/duckduckgo-help-pages/results/so...


But what percentage of it comes from which partner? They never say this.


And more importantly, what percentage does not come from any partner.


...so the order of results is still determined by DDG, right?


As siblings have covered - it is a proxy for some search results.

That's ok though - a privacy respecting proxy to a decent search engine is a useful thing. You get all the search results and they don't get to track you.


Your claim desperately needs a citation.


Logic. Creating and maintaining a half decent search engine requires a billion dollar worth of infrastructure and talent. They have neither.


That's circular. They don't have it because they could not?

Alas, it's using bing as one source, it's more than just a proxy to bing. And they seem to have their own crawler as well.


I don't think I've ever seen DDG show up in my logs, and I found this article from a web host that listed out their top crawler traffic and DDG doesn't even register (but something called Sogou is): https://deviceatlas.com/blog/most-active-bots-and-crawlers-w...

It might be that DDG sticks to the to X thousand sites or something like that, so I would imagine that Bing must be providing the majority of the index, but maybe not for more popular queries.


Where did you find information it is really a "proxy" to Bing? I couldn't find such information.

BTW, there is also similar private search that proxies queries to google - https://www.startpage.com/



They also use Yandex, I don't see the problem exactly.

> Is there any search engine which is NOT backed by an extremely heavyweight player?

Global search of most web pages worth finding is a heavyweight task.


Are you sure you are not confusing DDG with Ecosia? Ecosia is also an UI to Bing.


My guess is DDG mostly depends on bing technology, at least for anything that is non trivial. There is a lot of smoke and mirrors on what actually DDG is, i would be happy to learn about details of their deals, technology, etc.


A service that combined yandex and google would probably cancel out most of the worlds censorship. I'm not sure where you would be allowed to run such a service from though...


In Russia DDG uses Yandex


in Soviet Union...?


...DuckDuckGo searches you?



So I'm sure this is cool to programmers, but this feels like if DDG wants to go towards popular use it should be going in the opposite direction, yeah? I guess this probably wasn't much work (maybe even an internal hackathon project) but still feels like DDG isn't really headings towards popular adoption and I'm curious what their internal focus is.


It's one of the most popular sites on the internet already.

https://www.alexa.com/siteinfo/duckduckgo.com

It's also built into browsers. So, whatever they're doing, it's working.


Come on, we all know that doesn't mean it's getting as wide use as a search engine as Google let's say. And popularity doesn't mean that it's not leaving things on the table. I'm just trying to give feedback as a potential user from a non-technical perspective, which I think most developers overlook.


You can't beat Google by trying to be Google without having Google level money, and even then, you still probably can't, Microsoft and Yahoo tried.

So, do something different. It's possible to grow by endearing yourself to geeks first. How'd Firefox catch on to begin with? Geeks, then they recommend to family and friends etc.

Hell, even if geeks were their only users, it'd likely be viable. There are a lot of us.


> Geeks, then they recommend to family and friends etc.

Or, in my case, parents ask their kids to set up their computers and they install firefox and add things like adblockers.


Except for searching, right? I mean what is the average number of links which DDG returns you for your ordinary search query? Is it even close to Google's results? And what about it's relevance?


The results are largely the same, in my test searches, all the tops results on ddg match the top results on google.


Maybe, but it's working great already for everyday use. Besides, Google does nerdy stuff like this all the time and people love them for it.

I've been using it full time for a bit longer than two years. In the beginning I think I had to use "g!" to search on google maybe 1 / 5 times, now I really only search on google maybe once a month and when I do I often don't find any better results. It's really come a long way from the first time I tried using it 5 or 6 years ago.

At this point it's good enough that I think I could recommend someone else switch to it without needing to change their search habits.


They already have a "cool" (browser) interface, and other plain ones. Adjust your nerd filter, they're just having some fun.


I'd disagree for a wildly "out there" reason. We've been conditioned to assume search should be like Google and so any attempt made by someone else gets compared against Google... but that's a losing battle from the start. As the "out there" reason - I enjoy professional wrestling and recently AEW has appeared (literally weeks ago). One of the immediate criticisms was that they were not like WWE's production, but among the fanbase, they were fine with it and made arguments that WWE's version of how a pro wrestling show should be is exactly what pushed fans away from the product. Some of their allure is being more gritty and "real", but their presentation is clearly different from the main product and its getting complimented for that currently.

As to DDG vs. Search, maybe this is a bit programmer leaning; however, I'd say that was some of the draw that got Firefox and Chrome to own the web browser market. They presented products that developers and techies enjoyed using and always kept them (initially) in their vision. I recall telling my parents they needed to switch from IE to Chrome because "it was just better" a decade ago. So, while this brutalistic terminal version of DDG only caters to a niche market, it's the same niche market that ends up spreading why it's the "better" product.


I agree 100% ... i use DDG everyday yet Im just using Bing and the reality is Bing is no Google. Google's results are hands down the best on the web and thats without being signed into Google.

DDG has so much momentum behind it now I dont understand why they dont do all they can to create a search engine all their own(bulk up search engineers.. bulk up on venture funding...make acquisition that improve its search, etc). One that is as good or better then Google. I so want to be able to keep recommending it yet not have to hear friends/family say its not as good as Google.


I can't seem to search for "kubernetes" or "kubernetes linux"; with or without quotes.


That's a feature.


I think it's hitting a cache backend and not the main index, to lower the quality of the exposed JSON endpoint (which is really easy to consume).


same, most longer search terms just don't return anything for me (but they do on regular DuckDuckGo).


Somehow the input on this doesn't register as an actual textbox. Many of my keystrokes are read by Vimium instead, making this unusable.


in vimium you can go i and you will be in insert mode ( till you hit escape ) and you will be fine.


TIL, thanks.


Just earlier today I thought it would be very cool to use Google assistant in a terminal. It looks like there is an example python project that is close to working with some polishing.

Google assistant is also lacking a client for web browsers, or desktops in general...

It appears free to use the assistant API for non commerical purposes. Until it gets randomly deprecated.


The search results are ddg pages suggesting search terms based on the input?

Why can't I just search normally and the list is a list of the actual results of my query.

Now you navigate to the ddg search results page and have to then browse as usual. Almost useless. You'd think this would be made to skip that step.


Fedback (see #1) from my use on Firefox 70 on Mac OS Catalina

1. Feedback isn't being sent anywhere (looking at the network requests.)

2. Searching for sum or difference of numbers (eg. 2-1) returns [Object].

3. Typing / or ' invokes the browser's quick find option

4. I can never search for the letter M (or m, or 'm' inside quotes) because it always gives "-- End of search results." instead of the search results.

5. I can never search for a URL (say, http://duckduckgo.com) as a keyword. No results at all.

6. Pressing CTRL-L after typing some text clears the text as well (unlike any other terminal)

7. Pronounce doesn't work at all (audio plays well on Forvo)

Discoveries:

1. Searching for \anything takes you to the first result (on a popup that's blocked by the browser).

2. [Added] A `duck` CLI would be useful.


Re: 6. I found that annoying as well. I use CTRL+L to jump to the address bar, not clear the terminal. MacOS uses CTRL+K to clear it and I'd assume that be the case on linux as well.


Hmm? ctrl-L clears the terminal in iTerm (and in linux terminals too I believe)

Ok looks like CMD-L and CMD-K also clear the terminal in iTerm. But we're talking about "ctrl" here


ddgr perhaps?


Various comments are noting that certain queries are not working.

I think this is hitting a caching/prefetch layer and not actually querying the main index.

My theory:

- this was a hackathon/weekend/20%(ish) project...

- ...using JSON for simplicity...

- ...said JSON endpoint needs to be exposed in a straightforward way...

- ...without implementing authentication/obfuscation (which would have blown the allotted time budget)...

- ...and so the decision was made to "break" the results in some way instead, so that once you realize https://duckduckgo.com/?q=test&o=json is EXTREMELY easy to parse, it's of no value.


> :why

> Because Devdas uses vimperator with Google?? I don't think they mix well. Devdas, you should try this instead.

I'm not sure this was ever intended to be more than just a quick project. It breaks because parsing has a lot of edge cases, and this was done quickly.


It can be a little bit better if the url's are dimmed a little bit (they can be still green to mimic the mono-color terminals, but dimmer).


1+1 returns [Object object]

https://imgur.com/les9QqQ


Doesn't work in FF with "Search for text when you start typing". I expected better implementation.

JS hijacks pretty much every event, and cursor is just a styled span, not a real input, which introduces a bunch of usability bugs.


Weirdly this doesn't seem to work using their own Android DDG Privacy Browser app


Nice.

Could I use this on my Terminal now?


Not unless your terminal interprets Javascript.

Though you might appreciate https://duckduckgo.com/lite


The default keypress for / isn't captured and makes it difficult to type in an URL to search for (not that the URL search returned anything).


It sucks so much! I tried typing but apparently was typing too fast and more than half of the letters didn't appear on the screen?


do you have vimium installed? I had similar symptoms till I realized, then realized what was going on. If this is the case, press i to go into insert mode, and you should be good from there


This is a lot of fun. Right now I'm hitting a few issues with the Vimium plugin in Firefox.

Pretty sure that can be fix though.


For some reason it doesn't work for me (nothing happens after typing a search term).


It only works if I use a single word, no spaces...


Same here, was pretty excited to try it out too! Help and the likes work, but not just searching.


Wait, help? When I type help I gest a list of search results for help. Did you actually get help text?


It's :help


Ah.

Thanks for the er, help.


it doesn't work. today i was asking ddg why sys.maxint is no longer works in python3. got immediate answer. but this terminal app just keep silent about that.



Trivium: written by some guy named Julian Assange.


I think they are trying to kill him in Belmarsh. https://finance.yahoo.com/news/mumbling-assange-tells-judge-...


DDG coincidentally makes almost every post to the frontpage as if it was a trillion dollar company meanwhile almost all interesting SHOW HN threads upon which the entire future of livelihood of many indie devs and micro startups depend are buried without even getting the slightest chance to get any coverage.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: