Behavioral Signals Python SDK

Make integration easier using our SDK

The Behavioral Signals Python SDK makes it easy to integrate our API into your applications. With a few lines of code, you can access real-time and batch analysis for both behavioral insights (such as emotion, engagement, and speaking style) and deepfake detection.

Whether you’re building voice analytics, enhancing contact center tools, or detecting synthetic media, our SDK supports both streaming and file-based audio input modes to fit your use case.

🐍 Installation from PyPI

You can install the Behavioral Signals SDK from PyPI with:

pip install behavioralsignals

Set your client ID (CID) and API key as environment variables:

export BEHAVIORALSIGNALS_CID="your_cid"
export BEHAVIORALSIGNALS_API_KEY="your_api_key"

The SDK will pick them up automatically:

from behavioralsignals import Client

client = Client()

You can also pass the credentials directly:

client = Client("your_cid", "your_api_key")

Simple usage:

from behavioralsignals import Client
from behavioralsignals.utils import print_results

client = Client()

process = client.behavioral.upload_audio(file_path="audio.wav")
result = client.behavioral.wait_for_result(
    pid=process.pid,
    timeout=600,
)

print_results(result.results)

print_results() prints one line per result: the start and end time in seconds, the task, and the top label with its probability.

wait_for_result(pid, timeout=None) polls the process until it finishes and then returns the result, so you don't have to write a polling loop.

We currently provide two main APIs:

  • the Behavioral API for analyzing human behavior through voice, and
  • the Deepfakes API for detecting deepfake content in speech and in video.

Both APIs support batch and streaming modes, allowing you to send audio files or streams for analysis and receive results in real-time or after processing. You can also find more detailed examples for both batch and streaming in the examples directory.

The next pages of this documentation contain snippets on how to use the SDK for sending/streaming audios and retrieving the results.

⭐ Github repo

Feel free to visit our Github repo at https://github.com/BehavioralSignalTechnologies/behavioralsignals-python

You can also raise any issues there, and on our Discord server



Did this page help you?