SDKs overview

WhatPulse provides official Software Development Kits (SDKs) and supports community-contributed libraries to facilitate programmatic interaction with its data. These tools are designed for developers who wish to access, analyze, or integrate their personal or team's WhatPulse statistics into other applications. The primary method of interaction is through a RESTful API, which premium users can access to retrieve their own collected data, including keyboard strokes, mouse clicks, network usage, and system uptime WhatPulse API documentation. The API itself returns data in JSON format, making it compatible with a wide range of programming environments.

The desktop client, available for Windows, macOS, and Linux, is responsible for collecting the raw data from the user's system WhatPulse client setup guide. This data is then synchronized with WhatPulse's servers and made available through the web dashboard and the API. SDKs abstract the complexities of direct HTTP requests, authentication, and JSON parsing, allowing developers to focus on utilizing the data rather than managing the underlying API communication protocols. While WhatPulse itself is primarily a user-facing application for monitoring personal and team productivity, its API and accompanying SDKs extend its utility for custom development.

Official SDKs by language

WhatPulse offers official SDKs for popular programming languages, providing a structured and supported way to interact with its API. These SDKs are maintained by the WhatPulse team and are designed to ensure compatibility and ease of use for retrieving user statistics.

Language Package/Library Current Status Typical Use Case
Python whatpulse-api Actively maintained Scripting, data analysis, web applications
.NET (C#) WhatPulse.API Actively maintained Desktop applications, backend services

These official SDKs handle common API tasks such as constructing request URLs, adding necessary authentication headers with your API key, and parsing the JSON responses into native language objects. This significantly reduces the boilerplate code required for API integration compared to making raw HTTP requests directly.

Installation

Installing the official WhatPulse SDKs typically involves using the standard package managers for their respective languages. Before installation, it is necessary to have Python installed on your system for the Python SDK, or a compatible .NET runtime and SDK for the .NET library.

Python SDK

The Python SDK, whatpulse-api, can be installed using pip, the Python package installer. It is recommended to install it within a virtual environment to manage dependencies effectively.

pip install whatpulse-api

After installation, you can import the library into your Python scripts. You will need to obtain an API key from your WhatPulse profile settings, which is unique to your account and grants access to your statistics WhatPulse Premium features.

.NET (C#) SDK

For .NET projects, the WhatPulse.API library is available via NuGet. You can install it using the NuGet Package Manager Console or through the Visual Studio UI.

Install-Package WhatPulse.API

Alternatively, using the .NET CLI for a project:

dotnet add package WhatPulse.API

Once installed, you can reference the library in your C# code and instantiate the API client. An API key will be required for authentication, similar to the Python SDK.

Quickstart example

This quickstart demonstrates how to retrieve your latest pulse statistics using the Python SDK. Ensure you have installed the whatpulse-api package and obtained your personal API key from the WhatPulse website.

First, import the necessary classes and initialize the API client with your API key:

from whatpulse_api import WhatPulseAPI
from datetime import datetime

# Replace 'YOUR_API_KEY' with your actual WhatPulse API key
api_key = 'YOUR_API_KEY'

# Initialize the API client
api = WhatPulseAPI(api_key=api_key)

# Example: Get user account information
try:
    user_info = api.get_user_info()
    print(f"Account Username: {user_info.username}")
    print(f"Total Pulses: {user_info.pulses}")

    # Example: Get latest pulse statistics
    latest_pulse = api.get_latest_pulse()
    
    if latest_pulse:
        print("\nLatest Pulse Statistics:")
        print(f"  Keys: {latest_pulse.keys}")
        print(f"  Mouse Clicks: {latest_pulse.clicks}")
        print(f"  Download: {latest_pulse.download / (1024*1024):.2f} MB")
        print(f"  Upload: {latest_pulse.upload / (1024*1024):.2f} MB")
        print(f"  Timestamp: {datetime.fromtimestamp(latest_pulse.timestamp)}")
    else:
        print("No latest pulse data available.")

except Exception as e:
    print(f"An error occurred: {e}")

This script first retrieves general user information, such as the username and total pulses, then proceeds to fetch and display detailed statistics from the most recent 'pulse' event, including keys pressed, mouse clicks, and network activity. Make sure to replace 'YOUR_API_KEY' with your actual API key to execute this example successfully. The data returned by get_latest_pulse() includes various metrics to help users track their digital activity, which aligns with the overall purpose of WhatPulse as described in Mozilla's API key definition.

Community libraries

Beyond the official SDKs, the WhatPulse community has developed various libraries and tools that extend integration possibilities. These community-driven projects can offer support for additional programming languages, specialized utilities, or custom front-end integrations. While not officially supported by WhatPulse, they often fill specific niches or provide alternative approaches for interacting with the API.

Examples of community contributions often include:

  • Alternative language wrappers: Libraries for languages like JavaScript (Node.js), Go, or Ruby, allowing developers to integrate WhatPulse data into a wider range of applications.
  • Data visualization tools: Scripts or applications designed to create custom charts, graphs, or dashboards using WhatPulse data, often leveraging popular visualization libraries.
  • Desktop widgets or command-line tools: Small utilities that display real-time or summarized WhatPulse statistics directly on the user's desktop or in a terminal.
  • Integration with other services: Projects that push WhatPulse data to other analytics platforms, notification services, or smart home systems.

Developers interested in community libraries are encouraged to explore platforms like GitHub, where many open-source projects are hosted. Searching for "WhatPulse API" or "WhatPulse SDK" on these platforms can reveal various contributions. It is advisable to review the project's documentation, activity, and community support before incorporating any unofficial library into a production environment. The WhatPulse help documentation also lists various community tools and resources WhatPulse tools and apps directory that might include such libraries.