Skip to content

Instantly share code, notes, and snippets.

@unixfox
Last active November 11, 2022 07:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unixfox/710675c1a1ac12cc973ba08597fa791c to your computer and use it in GitHub Desktop.
Save unixfox/710675c1a1ac12cc973ba08597fa791c to your computer and use it in GitHub Desktop.
Different ways to get json output from Google servers API
  • When async something is in the URL, add/modify async=_fmt:json.
  • You can try the query string alt=json for some APIs like the youtube one
  • You can also try the query string fmt=json
  • For some API, get the JSON result by modifying the client name used. Example:

    So, short version: curl "https://www.google.com/complete/search?client=qsb-android-asbl-pb&q=" -H "user-agent: Mozilla/5.0 AppleWebKit/537.36 GSA/10.77.9.21.x86" -output trend.proto It seems that it combines geoIP with the field &hl= in order to decide which trends to show, and perhaps also gl= It allows for three different clients in order to get json, ajax-json or protobuffer. Respectively, qsb-android, qsb-android-asbl and qsb-android-asbl-pb

Different kind of possible output format:

  • pb: protocol buffer
  • pc: protocol something??
  • prog: protocol something?? seems to be the same thing as pc
  • json: json
  • html: HTML page
  • jspb: protocol buffer in json format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment