{"id":3337,"date":"2016-11-10T09:15:29","date_gmt":"2016-11-10T09:15:29","guid":{"rendered":"https:\/\/www.bronco.co.uk\/our-ideas\/?p=3337"},"modified":"2017-03-20T11:43:57","modified_gmt":"2017-03-20T11:43:57","slug":"searching-google-from-anywhere","status":"publish","type":"post","link":"https:\/\/www.bronco.co.uk\/our-ideas\/searching-google-from-anywhere\/","title":{"rendered":"Searching Google From Anywhere!"},"content":{"rendered":"<p>Today I&#8217;d like to discuss how you can get around Google&#8217;s restrictions on localised searching; specifically, viewing localised SERPs. I put together a little web application in preparation for Dave&#8217;s session at <a href=\"http:\/\/seoktoberfest.net\/experts.html\" target=\"_blank\">SEOktoberfest<\/a> and everyone seemed to like it. I&#8217;ll share that with you in just a little bit but before that, I&#8217;ll go into some of the internal of how I&#8217;ve done it.<\/p>\n<p>Here&#8217;s a little preview, <a href=\"https:\/\/www.google.co.uk\/search?ie=UTF-8&amp;oe=UTF-8&amp;hl=en&amp;q=plumbers&amp;uule=w+CAIQICIKbWFuY2hlc3Rlcg&amp;pws=0\" target=\"_blank\">click this link and you&#8217;ll be searching for Plumbers from Manchester<\/a>, here&#8217;s a screenshot (using sarcastically obnoxious arrows to illistrate my point):<\/p>\n<p><a href=\"\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_094159_AM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3340\" src=\"\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_094159_AM.jpg\" alt=\"screenshot_110816_094159_am\" width=\"720\" height=\"911\" srcset=\"https:\/\/www.bronco.co.uk\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_094159_AM.jpg 720w, https:\/\/www.bronco.co.uk\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_094159_AM-237x300.jpg 237w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><br \/>\n<a href=\"\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_093947_AM.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3338\" src=\"\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_093947_AM.jpg\" alt=\"screenshot_110816_093947_am\" width=\"754\" height=\"352\" srcset=\"https:\/\/www.bronco.co.uk\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_093947_AM.jpg 754w, https:\/\/www.bronco.co.uk\/our-ideas\/wp-content\/uploads\/2016\/11\/Screenshot_110816_093947_AM-300x140.jpg 300w\" sizes=\"auto, (max-width: 754px) 100vw, 754px\" \/><\/a><\/p>\n<p>Here&#8217;s the same results in <a href=\"https:\/\/www.google.co.uk\/search?ie=UTF-8&amp;oe=UTF-8&amp;hl=en&amp;q=plumbers&amp;uule=w+CAIQICIFbGVlZHM&amp;pws=0\" target=\"_blank\">Leeds<\/a>, <a href=\"https:\/\/www.google.co.uk\/search?ie=UTF-8&amp;oe=UTF-8&amp;hl=en&amp;q=plumbers&amp;uule=w+CAIQICIGbG9uZG9u&amp;pws=0\" target=\"_blank\">London <\/a>and <a href=\"https:\/\/www.google.co.uk\/search?ie=UTF-8&amp;oe=UTF-8&amp;hl=en&amp;q=plumbers&amp;uule=w+CAIQICIITmV3IHlvcms&amp;pws=0&amp;gws_rd=cr&amp;ei=nZ4hWJKlB8iFgAaywKTICg\" target=\"_blank\">New York<\/a>.<\/p>\n<p>So how is this done?<\/p>\n<p>First we need to create a key, these are &#8220;secret keys&#8221; based on the length of the location name &#8211; this is used as a delimiter between the Google standard protocol &#8220;CAIQICI&#8221; and the encoded base64 string, within the URL.<\/p>\n<p>(code in Python)<\/p>\n<pre class=\"lang:default decode:true \">keys = {\r\n    4:\"E\", 5:\"F\", 6:\"G\", 7:\"H\", 8:\"I\", 9:\"J\",\r\n    10:\"K\", 11:\"L\", 12:\"M\", 13:\"N\", 14:\"O\", 15:\"P\",\r\n    16:\"Q\", 17:\"R\", 18:\"S\", 19:\"T\", 20:\"U\", 21:\"V\",\r\n    22:\"W\", 23:\"X\", 24:\"Y\", 25:\"Z\", 26:\"a\", 27:\"b\",\r\n    28:\"c\", 29:\"d\", 30:\"e\", 31:\"f\", 32:\"g\", 33:\"h\",\r\n    34:\"i\", 35:\"j\", 36:\"k\", 37:\"l\", 38:\"m\", 39:\"n\",\r\n    40:\"o\", 41:\"p\", 42:\"q\", 43:\"r\", 44:\"s\",45:\"t\",\r\n    46:\"u\", 47:\"v\", 48:\"w\", 49:\"x\", 50:\"y\", 51:\"z\",\r\n    52:0, 53:1, 54:2, 55:3, 56:4, 57:5, 58:6, 59:7,\r\n    60:8, 61:9, 62:\"-\", 63:\"\", 64:\"A\", 65:\"B\", 66:\"C\",\r\n    67:\"D\", 68:\"E\", 69:\"F\", 70:\"G\", 71:\"H\", 72:\"I\",\r\n    73:\"J\", 76:\"M\", 83:\"T\", 89:\"L\"\r\n    }<\/pre>\n<p>To explain, the URL structure is broken down as follows:<\/p>\n<p><strong>Complete URL<\/strong>: https:\/\/www.google.co.uk\/search?q=plumbers&amp;uule=w+CAIQICIFbGVlZHM<br \/>\n<strong>Standard search URL<\/strong>: https:\/\/www.google.co.uk\/search?q=plumbers<br \/>\n<strong>Location specific parameter<\/strong>: &amp;uule=w+CAIQICIFbGVlZHM<br \/>\n<strong>Standard protocol<\/strong>: &amp;uule=w+CAIQICI<br \/>\n<strong>Secret key<\/strong>: F<br \/>\n<strong>Base64 (which we&#8217;ll get to in a minute)<\/strong>: bGVlZHM<\/p>\n<p>So the base64 encoding is the place name, encoded in base64, for example <em>Leeds<\/em>, which would become <code>bGVlZHM<\/code>.<\/p>\n<p>Finally, we can tie this all together, with the following:<\/p>\n<pre class=\"lang:default decode:true \">keys = {\r\n    4:\"E\", 5:\"F\", 6:\"G\", 7:\"H\", 8:\"I\", 9:\"J\",\r\n    10:\"K\", 11:\"L\", 12:\"M\", 13:\"N\", 14:\"O\", 15:\"P\",\r\n    16:\"Q\", 17:\"R\", 18:\"S\", 19:\"T\", 20:\"U\", 21:\"V\",\r\n    22:\"W\", 23:\"X\", 24:\"Y\", 25:\"Z\", 26:\"a\", 27:\"b\",\r\n    28:\"c\", 29:\"d\", 30:\"e\", 31:\"f\", 32:\"g\", 33:\"h\",\r\n    34:\"i\", 35:\"j\", 36:\"k\", 37:\"l\", 38:\"m\", 39:\"n\",\r\n    40:\"o\", 41:\"p\", 42:\"q\", 43:\"r\", 44:\"s\",45:\"t\",\r\n    46:\"u\", 47:\"v\", 48:\"w\", 49:\"x\", 50:\"y\", 51:\"z\",\r\n    52:0, 53:1, 54:2, 55:3, 56:4, 57:5, 58:6, 59:7,\r\n    60:8, 61:9, 62:\"-\", 63:\"\", 64:\"A\", 65:\"B\", 66:\"C\",\r\n    67:\"D\", 68:\"E\", 69:\"F\", 70:\"G\", 71:\"H\", 72:\"I\",\r\n    73:\"J\", 76:\"M\", 83:\"T\", 89:\"L\"\r\n    }\r\n\r\nplace = 'leeds'\r\nengine = '.co.uk'\r\nkeyword = 'plumbers'\r\n\r\n# encode location name into base 64\r\nencoded_place = place.encode('base64').replace('=', '') \r\n\r\n# find secert key\r\nkey =  keys[len(place)] \r\n\r\n# create the complete localised string\r\nlocalised_string = 'w+CAIQICI{}{}'.format(key, encoded_place)\r\n\r\n# create final query URL\r\nserp_url = '''https:\/\/www.google{}\/search?ie=UTF-8&amp;oe=UTF-8&amp;hl=en&amp;q={}&amp;uule={}&amp;pws=0\r\n    '''.format(engine, keyword.replace(' ', '+'), localised_string)\r\n\r\nprint serp_url<\/pre>\n<p>And that&#8217;s it. With a little programming knowledge you&#8217;ll be able to wrap a <code>for<\/code> loop around that to run through multiple locations or multiple queries. If you want a ready made version of the above, check out the following:<\/p>\n<p><a href=\"http:\/\/octoberfest.bronco2.co.uk\/\">Try it here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I&#8217;d like to discuss how you can get around Google&#8217;s restrictions on localised searching; specifically, viewing localised SERPs. I put together a little web application in preparation for Dave&#8217;s session at SEOktoberfest and everyone seemed to like it. I&#8217;ll share that with you in just a little bit but before that, I&#8217;ll go into [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":3386,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"class_list":["post-3337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-search-engine-optimisation"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/posts\/3337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/comments?post=3337"}],"version-history":[{"count":0,"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/posts\/3337\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/media\/3386"}],"wp:attachment":[{"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/media?parent=3337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bronco.co.uk\/our-ideas\/wp-json\/wp\/v2\/categories?post=3337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}