What does the linkSite option do with Google Custom Search API? - google-custom-search

Google Custom Search API docs says "Specifies that all search results should contain a link to a particular URL"
Does the general Google Search have this as a advanced option, if so what is the option? I am getting results that are just weird, possibly I don't understand something.

General Google Search has a "link:" option that is kind of same as the CSE "linkSite".
But with CSE, it seems that the linkSite-option is not restricted to the sites that are listed at CSE configuration, AKA. other sites may appear in the results, sites that are not listed in CSE configuration

Related

Include noindex pages in Google Custom Search API results?

We use Google's Custom Search API to provide search functionality for our website's users who want to search our website. Is there a way to include pages that are set to noindex via <meta name=robots content="follow, noindex"> in these search results? We do not want some of our pages (e.g. privacy policy) to be available through google SERPs but we do want them to show up in our internal search on our website. But since the internal search is implemented via Google's custom search API, "noindex pages" do not show up in the internal search.
Unfortunately, no.
Google's Programmable Search Engine has to follow the same rules as Google Search, and "noindex" means "do not show in search results" for both.

How to achieve dynamic site search using Custom Search Engine REST API

Requirement: From my web page user has the ability to add websites and fetch a collection of web pages having the input search term.
We have been using CSE V1 API to extract web pages based on a search term on the desired websites by making use of cref parameter. Since Google stopped supporting Link CSE feature (https://customsearch.googleblog.com/2017/02/refocusing-and-looking-forward-on.html), how do I implement the dynamic site search feature?
Thanks in Advance,
Raghu
On further analysis, custom site search is possible with the siteSearch parameter.
Ref: https://developers.google.com/custom-search/json-api/v1/reference/cse/list#siteSearch.
This parameter accepts only one website as the value, so for multiple website searches, invoke the Google CSE API multiple times for each website.
While creating the search engine, select the option "Search the entire web but emphasise included sites" so that you can hook websites while invoking the CSE API.
To enable siteSearch parameter of API
Hope it helps.
-Raghu

Google Custom Search refinement redirect

So I'm using Google Custom Search (Google CSE) and I'm trying to use the refinement functionality to redirect search queries to Google Scholar.
Basically I'm following exactly the documentation found here. However it turns out that, despite there being documentation, this functionality doesn't exist, and it doesn't appear that Google has any plans to implement it in the near future (see the StackOverflow post here).
My question is, does anyone have a hack/workaround for this problem, so that I could use Google CSE to search Google Scholar?
Server Side
You can use something like https://github.com/ckreibich/scholar.py to parse the results from google scholar yourself and expose it as an API that you could consume and render any way you liked.
It would use scholar search under the hood. However, since this isn't an official API this might break at any time, it also requires you to have server side resources to service the requests, but would let you have the nicest interface that you have full control over.
IFrame
You can open an iframe at the particular URL, and this can be embedded inside your page. It looks a bit clunkier, but it means you don't have to link externally and you can embed it locally
<iframe src='http://scholar.google.com/scholar?q={query}'></iframe>
See documentation here. It might be specifically what renders well for you.
External Link
Alternatively, you can just open a new tab/window with:
<a href='http://scholar.google.com/scholar?q={query}' target='_blank'> My Link </a>

Listing the authors of a web site according to Google?

Google allows to its users to list which web sites the contribute to. If the web-site also links to the G+ profile of the person with ?rel=authors then Google can show the avatar of the person on Google search results. See further explanations.
Is there a way to get the list of people who added a web site to their "contribute to" list?
A manual search on Google or an API?
The People.search REST API method does not appear to support searching data from the contributor fields. You can try it yourself here. The data is exposed in the response from the People.get method, but is not apparently part of the full text search.

Google custom search engine for Google News

I'm trying to use the Google custom search engine API to query Google News. The API is working great otherwise - but I want to get News results instead of web results.
I can't find a way to either restrict the CSE to use Google News, or to ensure that my API query hits Google News rather than the web search. Does anyone know a way to achieve this?
You can use schemas from Schema.org to specify if you're only looking for articles/ blog posts.
To specify the Schema, go to Advanced settings on the Control Panel and select the required schema from here.
There was a News Search API but it's deprecated:
Important: The Google News Search API has been officially deprecated
as of May 26, 2011. It will continue to work as per our deprecation
policy, but the number of requests you may make per day may be
limited.
https://developers.google.com/news-search/
You can see some alternatives SO users recommended on this question.