google custom search api zip code filter - google-custom-search

I am integrating google custom search api in an application, I need to add a state/city filter or zip code filter. i have studied the google custom search api documentation.
Following is the link https://developers.google.com/custom-search/json-api/v1/reference/cse/list
There is a "gl" parameter for country in the optional but i need to filter on state,city or zip code.

Related

How can I retrieve a URL from a search

I'm trying to retrieve a URL from a search using google search api. Is there any function to do so?
I've tried searching on the google custom search glossary but have only found how to retrieve meta data and not URLs

Can i get all task by inputting asana search url?

If we search on asana UI we get a unique url to every search. Using that url as input, through asana api can i get all tasks which were found in that url.
for eg.
Search URL : https://app.asana.com/0/search/12345678/90123456
has got 50 tasks, so through api (using some kind of input as url) can i get those 50 tasks alone?
NOTE: The search url is nothing but combinations of tags and some filters. I can do search by api searching directly through tags, but this seams little bit easy to get my searched tasks.
Please suggest if any solution.
We don't currently support sorting via the API. The URL contains an ID for the search and an ID for the task currently selected of the form "/0/search/[search id]/[task id]", so you can get the specific task easily with the API.
However, getting the results for the search via the API is not supported.

How to restrict Google Custom Search to specific url prefixes?

If I go to the Google CSE control panel (https://www.google.com/cse/all) I see a list of my custom search engines.
When I click on one I can see in the list the option "sites to search". There I can list
example.com/cool-path
example.com/awesome-path
etc
How do I use the API to do the same? To add multiple domains, sites, or paths to the search? I can't find any documentation specifying this behavior.
The API will connect to a search engine that is specified on your custom search panel.
So you create the search engines you need (each with it's own list of sites to search) and then you connect to whichever one you need using the API using the engine's unique code

Multiple file types search using Google Custom Search API

I need to get Google search results for particular filetypes.
For example, in browser I would directly google search for "hyperloop filetype:pdf" and it will list out PDF files for "Hyperloop".
For this, my Google Custom Search request URI will be https://www.googleapis.com/customsearch/v1?key=MY_KEY&cx=MY_UNIQUE_ID&q=hyperloop&fileType=pdf
However, currently I would like to get search results for "hyperloop" of filetypes .ppt or .doc.
In browser, I would achieve this by googling "hyperloop filetype:ppt OR filetype:doc".
What will be my Search request URI equivalent for this query?
I could not find anything related to querying using multiple values for a single parameter in Google Custom Search Documentation.
Rather than doing
q=hyerloop&filetype=pdf
you can use
q=hyperloop%20filetype:pdf%20OR%20filetype:doc
use this its work
$url='https://www.googleapis.com/customsearch/v1?key=AIzaSyCJUGIb_tevRKD-Kxxi5f4&cx=010407088:onjj7gscy2g&q='. urlencode($keywords).'&filetype=doc&filetype=docx';
for me

How can i remake the return from Google search api?

How can i use Google search api to get like on the google engine, title of website,a short description and URL. Is it possible?
I tried the api but it gives me only some information that doesn`t have a url or title to a website.
Using the Google shopping api, you can retrieve the title, short description and url. I've achieved this in a c# application where it returns a json file from the url below and parse over it.
You need a apiId to start with.
Using this url you can add search parameters after the q, in this example just searching for digital camera.
https://www.googleapis.com/shopping/search/v1/public/products?key=key&country=US&q=digital+camera
See http://code.google.com/apis/shopping/search/v1/getting_started.html
for more details
I'm not sure that I have enough information, but I find the Google Custom Search API reference page has the reference JSON/ATOM examples:
https://code.google.com/apis/customsearch/v1/reference.html
This query will get you started:
https://www.googleapis.com/customsearch/v1?key={YOURAPIKEY}&cx={cx?}&cref={cref?}&q=st%20olaf
Does this get you started?
Take care!
speeves