I'm going to make search page in website using google search engine.
I'm using laravel 5.4 framework.
So I got the Google Custom Search API key.
And I created new google search engine here.
I got the search engine ID.
And I used "jan-drda/laravel-google-custom-search-engine" package for searching.
I can get the search result. but result is limited to lists of url that I
inserted in custom search engine.
How can I get the result same as google search result?
In other words, how can I search without searching url limitation.
I hope that make sense.
Remove all the urls entered in "Sites to Search" from and you will have the search returned from whole web.
Note: The results on main google search and results via google API, results would still vary.
Related
All I want to do is a simple Google Images search. We were doing the old, really, incredibly simple way using the now completely deprecated JSON Image Search API.
That page now says it is included in Google Custom Search. The problem is that I don't want to search my own website, I want to search the web for images still. I cannot, for the life of me, find what the new way to do this is.
I have tried the Google API for PHP, it also works only with Custom Search which is only for searches on my website and not the entire web.
I have tried it using https://www.googleapis.com/customsearch/v1?key=MYKEY&cx=MYCX&q=candy and it's still searching our website only not the web in general.
Can someone point me to a documentation page that describes how to use an API to do an image search on the web in general and get results in the JSON?
You can indeed use the Google API for PHP. You just need to configure your custom search engine to search the entire web. To do this, login to your CSE settings at https://cse.google.com/cse/, and remove all sites.
Then, change 'Sites to search' to 'Search the entire web but emphasize included sites'.
Since you don't have any sites specified, it will just search the whole web.
You can test using the box on the right.
As for documentation, the CSE API is documented here https://developers.google.com/custom-search/json-api/v1/reference/cse/list#parameters
I am trying to develop a site which should act as a personalized search tool (i:e)search results based on user interests and the keyword entered by the user.
Currently i want to use cURL to display results,
My doubt is ,
whenever the user search a keyword in my website search tab ,the results should be lifted from search engines and the results should be published in my site.
How can i use cURL to display search results based on the keyword pinged by the user in the search area .
Help me friends .
thanks in advance
You might want to check
Google Search API
Php Curl Docs
there are a lot of examples and use cases in both websites regarding to your question.
cant quite find the answer I need so hopefully you guys can help.
I am trying to develop ( with basic but growing knowledge!) a split search bar for a custom cake website.
basically I have one search bar in the header, and a drop down with whole site and cakes in it.
When the whole site is selected I want it to pass the search parameters to googel custom search and display on the page. when cakes is selected it triggers a custom php search I wrote to search for and display a single cake picture.
I am doing this at the moment with an if statement. so if type=cakes then ( run php () else put search terms through google custom search.
Now I have tried using the results only format for it, but it doesnt seem to render anything! I dont know how to pass my parameter to the results page. I tried setting the parameter to cakeref which is what i have specified previously.
Any help or explanations as to how google custom search works and integrates would be amazing.
Try this
$search_query = "Is+Wikipedia+IsGreat";
$amazon_url = "https://www.googleapis.com/customsearch/v1?key=3425lh43lkh52lk34jh5&cx=023470239740:kj2h3kl4hlk23&alt=atom&num=5&q='$search_query'";
$google_search = file_get_contents($amazon_url);
You need API Key and CX number for calling this API. And urlencoding to encode query parameters.
Try Curl also..
API Client Library is here
http://code.google.com/p/google-api-php-client/
http://code.google.com/p/google-api-php-client/source/browse/trunk/examples/customSearch/index.php
http://www.phpclasses.org/package/6301-PHP-Perform-searches-with-the-Google-Site-Search-API.html
I have implemented google custom search engine on my website http://www.finalyearondesk.com/
What I want is that when user enters his query into my own defined search bar, then the results [By result I mean the result that is displayed right after just entering the query and hitting enter, for example "ubuntu"] must be displayed in this page... http://www.finalyearondesk.com/search.php . At now the result are just displayed where I have inserted the code that google has given me.
The Google custom search is a JavaScript Ajax widget. The browser talks to Google independent of your site.
If you want results in your search.php page, either put the search-box on the search.php page, or query Google server side, then display the formatted results any way you like. This is very not ideal because Google limits the number of queries you can do.
Long story short, you have to live with the ads and limited placement options google gives you.
You can always attempt to write your own web search engine if you don't like it [/sarcasm]
I am developing a search solution for my photo community web application. I am making use of Google Site Search. There are various ways to make use of it, but because I want a seamless fit with custom search result rendering, I went for the XML option.
It works really simple. I have a custom-styled search box on the site which posts to my back-end, a CodeIgniter PHP controller. The controller then will do a GET to the Google Site Search XML service, which returns me the search results in XML.
It works brilliantly and gives me full control over output rendering. There is just one little thing missing. If I search for a misspelled word, let's say "crocodilw" (should be "crocodile") I would like to get the "did you mean "crocodile?" functionality that is so common in Google.
This feature does work when you use the front-end integration method of Google Site Search. I kind of expected the correct search suggestion to be part of the return XML as well, but I can't seem to find it.
Any clues on how/if this is possible using the XML method?
This will only work on the first page (start=0) of the results. On the second page, it's gone.
http://www.google.com/cse/docs/resultsxml.html#results_xml_tag_Spelling