SharePoint Enterprise Search capabilities are exposed for use from SharePoint Apps and external Applications through various interfaces. While some of these APIs needs SharePoint context, REST based APIs on the other hand can be accessed directly.
Following are the different API options available.
If .NET client object model (CSOM) or JavaScript CSOM are used on the client, the server would require to have SharePoint Server 2013 Client Components SDK installed. Which can be downloaded at
Search in SharePoint 2013 includes a Search REST service you can use to add search functionality to your client and mobile applications by using any technology that supports REST web requests. You can use the Search REST service to submit Keyword Query Language (KQL) or FAST Query Language (FQL) queries in your apps for SharePoint, remote client applications, mobile applications, and other applications.
The Search REST service supports both HTTP POST and HTTP GET requests.
Construct the URI for query GET requests to the Search REST service as follows:
/_api/search/query
For GET requests, you specify the query parameters in the URL. You can construct the GET request URL in two ways:
You construct the URI for query POST requests to the Search REST service as follows:
/ _api / Search / postquery
When you make a call to the Search REST service, you specify query parameters with the request. Search in SharePoint 2013 uses these query parameters to construct the search query. With a GET request, you specify the query parameters in the URL. For POST requests, you pass the query parameters in the body in JavaScript Object Notation (JSON) format.
Sample GET request:
Sample POST request:
JSON
{ ‘__metadata’ : {‘type’ : ‘Microsoft.Office.Server.Search.REST.SearchRequest’}, ‘Querytext’ : ‘sharepoint’ }
The Search REST service includes a Suggest endpoint you can use in any technology that supports REST web requests to retrieve query suggestions that the search system generates for a query from client or mobile applications.
Note: The Search REST service doesn’t support anonymous requests to the Suggest endpoint.