Google Custom Search API- Get results specific user location - google-api

As in normal Google search page, Google returns me results specific to my location. As i am considering/assuming for this, it gets my ip address my request, find uses location for it and returns the results.
I am writing the proxy server for search engines. So from user browser i get requests for some search terms and server returns search results.
I am curious to know, if from Custom Search API can i get the such results based on some IP address i provide or anything like that, so that i can mock the user location in my proxy server and pretend the Google Custom Search to be that user and get the location specific results
PS.I am new to this search engine api world, so please understand me.

Yes, you can, but just for the country, not the exact location.
Here is the docs for parameters of a query request:
https://developers.google.com/custom-search/json-api/v1/reference/cse/list
Look at the 'gl' parameter.
I'm not aware of any way to specify the location more precisely then this.

After these many years I'm not sure if you still need it, but I found it hard to find a helpful answear, so here's the solution for whoever needs it.
You can achieve that behavior with the "?gl=" query param as mentioned here, and pass the value as one of the country codes.
Worked for me, hope it helps someone!

Related

WHMCS intellisearch from shell

WHMCS does not offer full search via API so I was wondering if there is a way to it in other ways via shell (yes, it needs to be bash).
The goal is to perform a full search (clients, products,orders, tickets, domains etc ...).
For example, I might have a client that registered an account under a certain domain that was registered elsewhere. Using the GetDomains/GetClients/GetOrders is will not yield results. Yet, the account's main domain is linked to the account.
Performing a full search checks it all and the results can be filtered and that is what I need.
Any ideas?
I have never heared of search via API in WHMCS unfortunately. Would like that as well.
But you should be able to create something with CURL and hit the search.php which is used in admin search interface.
parameters:
value=[Your search string]
intellisearch=1
token=[You have to curl a page first and parse the html to get this]
Make sure to first login against WHMCS with your script.
This is not the most beautiful solution, but the easiest if you don't want to access database directly.

Will a single GSA search request that specifies two site collections get loaded into the suggestions database for both sites?

Will a single GSA search request that specifies two site collections get loaded into the suggestions database for both sites?
For example consider the following query,
http://gsa/search?q=hello&site=site1|site2&client=myfrontend
If results are returned from both collections will the query "hello" get loaded into the suggestion database for both,
1. client=myfrontend&site=site1
2. client=myfrontend&site=site2
So far I have not seen the query get loaded into either suggest database, but perhaps I have not waited long enough, which makes me wonder is there any way to quickly reset/reload suggestions? In the past I have tried resetting them via admin console's suggestions page, and then enabling/disabling suggestions via the frontend, but it does not always regenerate them. Is there any other procedure people follow to reload suggestions?
Contacted Google support and, if multiple collections are defined in search request the suggestion gets logged to the default_collection.
They are working on a resolution :)

Google Custom Search Engine API Image Search not returning results

Just setup my CSE with Image Search enabled in the Basics tab, but still ain't getting results.
If I don't use searchType=image in the query it works, if I put it back it stops working with no errors, just no results.
Any inputs?
It seems there are two elements required to consume the Google search API, the configuration of the API key and credentials.
Setup the API key here https://console.developers.google.com/project
and create your own CSE here https://www.google.co.uk/cse/all
I made the mistake like a lot of people of ignoring the CSE side of the setup (it didn't seem logical to search only my own site).
You need to create a CSE though, point it to search any url (I don't think it matters greatly), and then where it says "Sites to search" chose "Search the entire web but emphasise included sites". Also then set image search to "On".
Once you've done this browse to your new CSE, the url should contain your CX code e.g. cx=014341056213260336986:v4fl8n8sabc, you then need to use this in your request query string.
Your API query should now start returning results.
Image search needs to be switched to ON at the Custom Search Setup->Basics

Does Firefox stores keywords in its Google Analytics cookie?

I'm trying to extract the keyphrase someone used to land on a website. And since I have the Google Analytics script, I should be able to get the cookie name ___utmz and then look for the string "utmctr=...." to find what keywords.
However, in Firefox, no matter what, I always see (not provided)
utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)
Is there a way to extract the keywords if someone visited using FF?
This has nothing to do with Google Analytics or Firefox but instead is a result of how keywords are handled for SSL searches with Google. In those cases, Google search will not pass along the keyword in the referral and instead sets the value to (not provided). For details see the keyword section in https://support.google.com/analytics/answer/1033173

Is there a way to get the user location not by IP

i have seen some pages that display your current location very accurately and dont seem to be doing it thorough your IP since i tried by using a proxy from another country and they still display my actual location. Is there anyway to get the user location other than by the IP? and if so, is it possible to bypass that so webmasters dont see my actual location?
Thank you.
Read about Geolocation
http://diveintohtml5.info/geolocation.html
Sample page: http://html5demos.com/geo
proxies of this type are supposed to deliver a web experience where that you're location is not shared with anyone but in some cases the actual online proxy- who wouldn't ever use this data. All I can recommend, is a site called hidemyass(dot).com
I found that it tends to use IP address based in the United Kingdom, but that could be based on your own geographical location.

Resources