Hacker News new | ask | show | jobs
by stroebjo 3494 days ago
This uses the Google Autocomplete API which seems a bit risky to use [0] and according to this Google blog post should be already shut down [1]. Do you have any newer information on how reliable the API is?

[0]: http://stackoverflow.com/questions/6428502/google-search-aut... [1]: https://webmasters.googleblog.com/2015/07/update-on-autocomp...

2 comments

Nice catch, updated to the new API.
Instructions are also included to use DuckDuckGo.
Wonderful. I decided to put a script together.

  #!/bin/bash
  S="$(echo "$@" | sed -E 's, +,+,g')"
  g(){
   curl -sS "https://suggestqueries.google.com/complete/search?client=firefox&q=$1" \
    | sed -E 's,.*\[([^]]*)\].*,\1,;s,",,g' | tr , '\n'
  }
  d(){
   curl -sS "https://duckduckgo.com/ac/?q=$1" \
    | sed -E 's,"phrase":|[][{}"],,g' | tr , '\n'
  }
  paste -d , <(g $S) <(d $S) | column -t -s ,