I've recently wrote yet another ddg API wrapper for python https://github.com/alvations/rubberduck. I'm loving how I can browse the web in jupyter notebook. Oh the irony of having jupyter on a browser and calling an API to get search results
For a terminal application, you can always write a wrapper by just sending key events on stdin. The messiest part is probably managing a pty for w3m to run on.