How can i remake the return from Google search api? - 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

Related

How to retrieve a document from Sharepoint API when only the document id is known?

I'm using Sharepoint v1.0 API and want to retrieve a file by it's document id. I can't find any documentation on how to retrieve a file this way. If I use the URL:
https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_layouts/15/DocIdRedir.aspx?ID=MLVDK4UWQQ8B-763006743-3089
The response is a 401 so direct calls don't work. I can query the API but I don't know how to translate the above URL to an URL I can use with that API. The URL should be something like:
https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/
What is the correct way to retrieve the document using the API? I've tried:
https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/search/query?refinementfilters=DlcDocId:equals("MLVDK4UWQQ8B-763006743-3089")
https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/search/query?DlcDocId='MLVDK4UWQQ8B-763006743-3089'
https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/Web/GetFolderByServerRelativeUrl('Shared
Documents')/Files
https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/Web/GetFileByServerRelativeUrl('_layouts/15/DocIdRedir.aspx?ID=MLVDK4UWQQ8B-763006743-3089')/Versions
Try to use DocId=MLVDK4UWQQ8B-763006743-3089 in search rest api:
https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/search/query?querytext='DocId=MLVDK4UWQQ8B-763006743-3089'
Reference:
Search By Document ID In SharePoint 2013
I know that is not an official API endpoint you are maybe looking for but if you want to download the document with SharePoint url you may try to use the download.aspx like
https://xxxxxxx.sharepoint.com/sites/xxxxx/_layouts/15/download.aspx?UniqueId=MLVDK4UWQQ8B-763006743-3089
I hope this will be of any help

Get Date From Google Custom Search API

How i can get date data like that google search. Is it possible to get it?
I never found it in google custom search API. The second picture i post is only snippet which got date and some description about it. The first picture from google search news and the second is google custom search
The following API request returns metadata, like published time, only if it is mentioned in its HTML source.
GET https://www.googleapis.com/customsearch/v1?key=APIkey&cx=CustomSearchEngineID&q=rambo
And refer to the "metatags" section
And Voila!
Hope that helps :)

How to get such header title and search input in Google search for website

How to get such header title and search input in Google search for website like below:
I am doing my website with core PHP (not any CMS like WordPress, Drupal etc.). So please help me to get such a result in Google.
This is called Sitelinks.
Check it out here: https://support.google.com/webmasters/answer/47334?hl=en
It's an Google automated process and you can't do much to control it. Although a google search on "how to get sitelinks" gives you plenty of results on how to get them, for example, here, or here.
Or perhaps you can purchase them under your AdWords advertisement.
As far as I know, it is much related to PHP. It's more on Search Engine Optimization (SEO).

Accessing full url of all page images Wikipedia API

I'm experimenting with the Wikipedia API and was trying to get the full urls for all images on a particular page, in this example Google's main page (http://en.wikipedia.org/wiki/Google).
I found the page id through the use of another API and then attempted to use this information in the following API to get the full urls of all images on that page:
http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml
I get some of the page images from this but cannot understand why I am not getting all - specifically the logo which is what I was most interested in. Apologies I am aware that there are similar questions which have been asked but I was not able to find one which would assist me here.
The API does not give you all results at once, it defaults to 10 results. You see in the beginning answer that you have a value for the parameter gimcontinue. If you use it like this you get more images: http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml&gimcontinue=1092923|Google_bike.jpg
Alternatively, you can ask for more images at once using gimlimit like this: http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml&gimlimit=500

Search for all G+ posts mentioning or linking to a domain or url?

Is there any way to search or structure a url in Google+ to get all posts that link to or reference a URL or domain? Similar to the way you can do it in Pinterest like http://pinterest.com/source/domain.com
This structured query does not get nearly everything: https://plus.google.com/u/0/s/domain.com
Google+ does not offer a specific API for getting posts that reference a specific URL or host. As Joanna mentions, you can use the activites.search method to do a full text search based on any given string, which could be a URL.
Google+ does not offer a URL that you can use to search to target specific shares. However, you can use the Google+ API to make an activities.search API call, where you can specify a query, which does a full text search. The API will return the public posts that contain the matched text.