Hi @Gunjan_13! Do you mean you want get most searched "internal search terms" on your website via API?
If you got the custom variables for "internal search terms", you can use API for Ranked report.
Please confirm detail document below.
- Analytics API Reports User Guide > Ranked Report Example
https://github.com/AdobeDocs/analytics-2.0-apis/blob/master/reporting-guide.md
Thanks!