How to get Conflunece knowledge base data through Rest API?


I want to integrate Confluence into my website.

I need the following two functionality:

  1. User comes to my website and clicks Connect. The user grants authorization.
  2. User search in our ‘dedicated search section of confluence’, they will start seeing the data(if they have authorized) .

Can anyone provide the documentation for getting Confluence KnowledgeBase Data through API?