Your question is quite compact so I might be missing your point. For now I assume you want to get data out of Sharepoint Online. For an on-premise Sharepoint setup I have no answer.
To get data (list items) out of Sharepoint Online (part of Office 365) you can use the Microsoft Graph API. It's documented at Microsoft Graph - Documentation - Overview. The part you need is in beta currently, see Microsoft Graph - Documentation - SharePoint. I have to note this: it requires moderate to advanced Powershell and developer skills to do this. You'll need to know:
How to register an application in Azure AD with the right scope (scope = Sites.Read.All)
How to use OAUTH2 to get an authentication code and then an access token
How to list your sites and lists to get the appropriate listID. The listID used by the Graph API is not the same one as you see in Sharepoint Online...