Quickstart
To use our API, you must have valid credentials. Please visit our website to create an account and obtain your API Key.
Websocket
Endpoint: wss://data.stalkapi.com/ws?apiKey=YOUR_API_KEY
const WebSocket = require("ws");
const ws = new WebSocket("wss://data.stalkapi.com/ws?apiKey=YOUR_API_KEY");
// Subscribing to a stream
ws.send(
JSON.stringify({
type: "subscribe",
payload: {
stream: "kol-feed",
parameters: {...} // some endpoints accept additional parameters
},
})
);
API
Endpoint: https://data/stalkapi.com
async function fetchStalkAPI() {
const API_KEY = 'YOUR_API_KEY';
const API_URL = 'https://data.stalkapi.com';
try {
const response = await fetch(API_URL, {
method: 'GET',
headers: {
'X-API-Key': API_KEY,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
return data;
} catch (error) {
console.error('Error fetching from StalkAPI:', error);
throw error;
}
}
const result = fetchStalkAPI();
console.log(result);
Last updated