Well i needed to get the Title of site just for displaying on to a page.

You can use the below endpoint :

“/_api/web/title”

Full Code:

$( document ).ready(function() {
var siteurl = _spPageContextInfo.webAbsoluteUrl;
$.ajax({
url: siteurl + “/_api/web/title”,
method: “GET”,
headers: { “Accept”: “application/json; odata=verbose” },
success: function (data) {
$(‘#addSiteTitle’).text(data.d.Title);
},
error: function (data) {
alert(“Error: “+ data);
}
});
});

http://sharepoint.stackexchange.com/questions/120146/get-site-title-by-its-url-using-rest