
WhatPulse
AnalyticsSmall application that measures your keyboard/mouse usage. Do you feel that you could have moved your hands, keystroke by keystroke, across the globe twice every day? Interested in finding out just how much you type a day? Do you know which applications you use the most? Do you know which applications use the most bandwidth? WhatPulse is a small application that measures your keyboard/mouse usage, down- & uploads and your uptime. It sends these statistics here, to the website, where you can use these stats to analyze your computing life, compete against or with your friends and compare your statistics to other people.
📚 Documentation & Examples
Everything you need to integrate with WhatPulse
🚀 Quick Start Examples
// WhatPulse API Example
const response = await fetch('https://whatpulse.org/pages/webapi/', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);
Using the WhatPulse API in JavaScript
The WhatPulse API provides a way to access user and team statistics, as well as global usage data, from the WhatPulse website. In this tutorial, we will use JavaScript code examples to show you how to fetch data from the API and display it on a webpage or in a console.
Getting Started with the WhatPulse API
To use the API, you'll need to create an API key for your account. You can do this by logging into the WhatPulse website, going to the settings page, and clicking on the "API" tab. You'll need to create a new API key and save it somewhere safe.
To make requests to the API, you'll also need to include your API key in the URL. For example:
https://api.whatpulse.org/v1/user.php?key=yourapikey&user=yourusername
Retrieving User Statistics
You can retrieve a range of statistics for a specific user using the user.php
endpoint. Here's an example of how to fetch and display the number of keys a user has pressed:
const apiKey = 'yourapikey';
const username = 'yourusername';
const url = `https://api.whatpulse.org/v1/user.php?key=${apiKey}&user=${username}`;
fetch(url)
.then(response => response.json())
.then(data => {
console.log(`Keys: ${data.keys}`);
})
.catch(error => console.error(error));
Retrieving Team Statistics
You can also retrieve team statistics using the team.php
endpoint. Here's an example of how to fetch and display the number of keys for a specific team:
const apiKey = 'yourapikey';
const teamid = 'yourteamid';
const url = `https://api.whatpulse.org/v1/team.php?key=${apiKey}&team=${teamid}`;
fetch(url)
.then(response => response.json())
.then(data => {
console.log(`Keys: ${data.keys}`);
})
.catch(error => console.error(error));
Retrieving Global Statistics
Finally, you can retrieve global statistics using the global.php
endpoint. Here's an example of how to fetch and display the number of registered users on WhatPulse:
const apiKey = 'yourapikey';
const url = `https://api.whatpulse.org/v1/global.php?key=${apiKey}`;
fetch(url)
.then(response => response.json())
.then(data => {
console.log(`Registered Users: ${data.total_users}`);
})
.catch(error => console.error(error));
Conclusion
The WhatPulse API provides a simple way to access user, team, and global statistics from the WhatPulse website. In this tutorial, we've shown you how to use JavaScript to fetch data from the API and display it on a webpage or in a console. With a little creativity, you can use this data to create your own custom dashboards, visualizations, and tools.
📊 30-Day Uptime History
Daily uptime tracking showing online vs offline minutes