Python SDKs

The Python SDK can be used to fetch analytics data, render search results, and obtain information on content source data.


Install python 3.0 or higher.

Ensure that your profile is in the right scope. Refer to Change User Scope (API and SDK).


Before using SDK you must have to initialize first. In this process you just need to ensure authentication. We have two methods to generate and refresh access tokens. After initializing SDK you can access SearchUnify analytics, content and search.



Initialize Python SDK

from searchunify import startClient, refreshToken
username = "**************"
password = "**************"
clientId = "**************"
secrets =  "**************"
url= ""
result = startClient(username=username, password=password,clientId=clientId, secrets=secrets, instance=url)

The access token expires every four hours. You can refresh it with the refreshToken() function.


Generate refresh token

from searchunify import startClient, refreshToken
result = refreshToken()


To access analytics data you can use analytics functions. There are around 22 methods for various use cases.


This includes the methods for content source APIs. If you want to use content APIs can directly use these functions.


SDK has a search API to make content searchable. You just need to pass parameters as per requirement.