Can anyone tell me that how can I export SharePoint search result for a particular keyword(which I passed in SharePoint search box web part) through REST API?

  • do you want the know about search query using REST API or the export functionality? Jun 15, 2017 at 12:27
  • I want export to excel functionality. Jun 15, 2017 at 12:32

1 Answer 1


There may be some JS API available which can do it in better way, but i prefer the old school way to export html tabular data into excel.

        <table id="xyz">
        <a id="exportData" href="" download="text.xls">Export</a>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script>
        var tableHTML = document.getElementById('xyz').outerHTML.replace(/ /g, '%20');
        $('#exportData').prop('href', ('data:application/vnd.ms-excel, ' + tableHTML));

The only condition is, your data need to be in tabular format and when you are saying export to excel, it must be satisfying the condition.

  • My data is not in table format. I am using default view of SharePoint Search result to display. Oct 16, 2017 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.