Integrate analytics tracking into your applications with our simple REST API. Track events, page views, and user interactions programmatically.
All API requests require authentication using an API token. You can obtain tokens from:
Contact your administrator to get a user account, then login at /User/Login to create your API tokens.
Include your API token in the request header:
X-API-Token: your_api_token_here
Alternatively, pass the token as a query parameter:
GET /api/AnalyticsApi/ping?apiToken=your_api_token_here
Keep your API tokens secure. Do not expose them in client-side code or public repositories.
All API endpoints are relative to the base URL:
https://analytics.boats/api/AnalyticsApi
API requests are tracked per token. There are currently no hard rate limits, but excessive usage may result in token revocation. Monitor your token usage in the Admin Panel.
Test your API connection and validate your token.
This endpoint requires a valid API token. Without a token, you will receive: {"success":false,"message":"Invalid or missing API token"}
curl -X GET "https://analytics.boats/api/AnalyticsApi/ping" \
-H "X-API-Token: your_api_token_here"
200 OK
{
"success": true,
"message": "OK",
"data": null
}
Track an analytics event with associated metadata.
| Parameter | Type | Required | Description |
|---|---|---|---|
| ip | string | Required | IP address of the user |
| userAgent | string | Required | User agent string of the client |
| keyword | string | Required | Keyword or event identifier to track |
| referrer | string | Optional | Referrer URL |
curl -X POST "https://analytics.boats/api/AnalyticsApi/track" \
-H "X-API-Token: your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"ip": "192.168.1.1",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"keyword": "product_search",
"referrer": "https://example.com"
}'
200 OK
{
"success": true,
"message": "OK",
"data": {
"trackId": "550e8400-e29b-41d4-a716-446655440000",
"eventId": 123,
"sessionId": "7a2d1f3e-8b4c-4d5e-9f6a-1b2c3d4e5f6a"
}
}
Save the trackId (UUID) from the response. Use it to update the track record with results (captcha status, page load time, content) via PUT /api/AnalyticsApi/track/{trackId}.
Alternative GET method for tracking events via query parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
| ip | string | Required | IP address of the user |
| userAgent | string | Required | User agent string |
| keyword | string | Required | Keyword or event identifier |
| referrer | string | Optional | Referrer URL |
curl -X GET "https://analytics.boats/api/AnalyticsApi/track?ip=192.168.1.1&userAgent=Mozilla/5.0&keyword=search_term" \
-H "X-API-Token: your_api_token_here"
Update a track record with results after the initial tracking. Use this to report captcha status, page load time, content, or errors.
| Parameter | Type | Required | Description |
|---|---|---|---|
| trackId | string (UUID) | Required | The trackId (UUID) returned from the track endpoint |
| Parameter | Type | Required | Description |
|---|---|---|---|
| captchaSolved | boolean | Optional | Whether captcha was solved successfully |
| pageLoadTime | number | Optional | Page load time in seconds (e.g., 1.2) |
| pageContent | string | Optional | Top content returned from page (max 2000 chars) |
| errorLog | string | Optional | Error details for captcha or loading failures (max 1000 chars) |
curl -X PUT "https://analytics.boats/api/AnalyticsApi/track/550e8400-e29b-41d4-a716-446655440000" \
-H "X-API-Token: your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"captchaSolved": true,
"pageLoadTime": 1.2,
"pageContent": "Product Name - $99.99 - In Stock..."
}'
curl -X PUT "https://analytics.boats/api/AnalyticsApi/track/550e8400-e29b-41d4-a716-446655440000" \
-H "X-API-Token: your_api_token_here" \
-H "Content-Type: application/json" \
-d '{
"captchaSolved": false,
"errorLog": "Captcha challenge could not be solved"
}'
200 OK
{
"success": true,
"message": "Track updated",
"data": {
"trackId": "550e8400-e29b-41d4-a716-446655440000",
"status": "completed",
"captchaSolved": true,
"pageLoadTime": 1.2,
"pageContent": "Product Name - $99.99 - In Stock...",
"errorLog": null,
"updatedAt": "2026-03-14T12:30:00Z"
}
}
| Status | Description |
|---|---|
pending |
Initial state after track, waiting for result update |
completed |
Successfully updated with results |
captcha_failed |
Captcha was not solved |
error |
Error occurred (see errorLog for details) |
Get the current status and details of a track record.
| Parameter | Type | Required | Description |
|---|---|---|---|
| trackId | string (UUID) | Required | The trackId (UUID) of the track record |
curl -X GET "https://analytics.boats/api/AnalyticsApi/track/550e8400-e29b-41d4-a716-446655440000" \
-H "X-API-Token: your_api_token_here"
200 OK
{
"success": true,
"message": "OK",
"data": {
"trackId": "550e8400-e29b-41d4-a716-446655440000",
"ipAddress": "192.168.1.1",
"keyword": "product_search",
"status": "completed",
"captchaSolved": true,
"pageLoadTime": 1.2,
"pageContent": "Product Name - $99.99 - In Stock...",
"errorLog": null,
"usedAt": "2026-03-14T12:25:00Z",
"updatedAt": "2026-03-14T12:30:00Z"
}
}
Retrieve all settings, keywords, and proxies in a single call. Ideal for software initialization.
/api/AnalyticsApi/config
X-API-Token | Required | Your API token |
{
"success": true,
"message": "OK",
"data": {
"settings": {
"headlessMode": false,
"autoClickFirstResult": true,
"useKeywordAsWebsite": false,
"useProxies": true,
"solveRecaptchaAudio": false,
"captchaService": false,
"captchaApiKey": "",
"captchaInitialWait": 5,
"captchaPollEvery": 3,
"captchaMaxWait": 120,
"skipProxyOnCaptcha": true,
"autoDisableFailedProxies": false,
"enableMouseMovements": true,
"enableScrolling": true,
"viewportWidth": 1366,
"viewportHeight": 768,
"delayOpenBrowser": 4,
"delayBeforeSearch": 4,
"delaySearchToResult": 4,
"delayPageLoad": 4,
"delayBetweenActions": 4,
"delayRandomMax": 4,
"delayStayAfterClick": 4
},
"keywords": [
{
"id": 1,
"keyword": "google",
"maxCount": 2000,
"concurrency": 1,
"status": "Stopped",
"scheduleStart": null,
"scheduleRepeat": "Once",
"scheduleEnd": "No end",
"scheduleMax": 1,
"completedCount": 0
}
],
"proxies": [
{
"host": "192.168.1.1",
"port": 8080,
"username": "user",
"password": "pass"
}
]
}
}
Retrieve browser, CAPTCHA, anti-CAPTCHA, and timing settings for the token.
/api/AnalyticsApi/settings
X-API-Token | Required | Your API token |
{
"success": true,
"message": "OK",
"data": {
"headlessMode": false,
"autoClickFirstResult": true,
"useKeywordAsWebsite": false,
"useProxies": true,
"solveRecaptchaAudio": false,
"captchaService": false,
"captchaApiKey": "your-captcha-key",
"captchaInitialWait": 5,
"captchaPollEvery": 3,
"captchaMaxWait": 120,
"skipProxyOnCaptcha": true,
"autoDisableFailedProxies": false,
"enableMouseMovements": true,
"enableScrolling": true,
"viewportWidth": 1366,
"viewportHeight": 768,
"delayOpenBrowser": 4,
"delayBeforeSearch": 4,
"delaySearchToResult": 4,
"delayPageLoad": 4,
"delayBetweenActions": 4,
"delayRandomMax": 4,
"delayStayAfterClick": 4
}
}
If no settings have been configured for the token, default values are returned.
Retrieve all keywords configured for this token, including scheduler settings.
/api/AnalyticsApi/keywords
X-API-Token | Required | Your API token |
{
"success": true,
"message": "OK",
"data": [
{
"id": 1,
"keyword": "google",
"maxCount": 2000,
"concurrency": 1,
"status": "Stopped",
"scheduleStart": "2026-04-15T06:42:00",
"scheduleRepeat": "Once",
"scheduleEnd": "No end",
"scheduleMax": 1,
"completedCount": 150
}
]
}
Retrieve all enabled proxies for this token. Only proxies marked as active are returned.
/api/AnalyticsApi/proxies
X-API-Token | Required | Your API token |
{
"success": true,
"message": "OK",
"data": [
{
"host": "9.142.18.108",
"port": 5767,
"username": "proxyuser",
"password": "proxypass"
},
{
"host": "78.31.204.139",
"port": 6663,
"username": "proxyuser",
"password": "proxypass"
}
]
}
Update the status and completed count of a keyword. Used by software to report progress.
/api/AnalyticsApi/keywords/{id}/status
X-API-Token | Required | Your API token |
Content-Type | Required | application/json |
id | Required | Keyword ID (from GET /keywords response) |
{
"status": "Running",
"completedCount": 450
}
status | Optional | New status: Running, Stopped, Completed |
completedCount | Optional | Number of completed iterations |
{
"success": true,
"message": "Keyword updated"
}
All API responses follow a consistent JSON format:
{
"success": boolean, // Indicates if the request was successful
"message": string, // Status message or error description
"data": object|null // Response data (if applicable)
}
| Status | Meaning | Description |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Missing or invalid parameters |
| 401 | Unauthorized | Invalid or missing API token |
| 404 | Not Found | Track record not found |
| 500 | Server Error | Internal server error |
{
"success": false,
"message": "Invalid or missing API token",
"data": null
}
const axios = require('axios');
const API_TOKEN = 'your_api_token_here';
const BASE_URL = 'https://analytics.boats/api/AnalyticsApi';
// Phase 1: Track an event
async function trackEvent(ip, userAgent, keyword) {
const response = await axios.post(`${BASE_URL}/track`, {
ip, userAgent, keyword, referrer: 'https://yoursite.com'
}, {
headers: { 'X-API-Token': API_TOKEN, 'Content-Type': 'application/json' }
});
return response.data.data.trackId; // Save this UUID for phase 2
}
// Phase 2: Update with results
async function updateTrackResult(trackId, result) {
const response = await axios.put(`${BASE_URL}/track/${trackId}`, result, {
headers: { 'X-API-Token': API_TOKEN, 'Content-Type': 'application/json' }
});
return response.data;
}
// Example: Two-phase tracking workflow
async function performTracking() {
// Phase 1: Initial track
const trackId = await trackEvent('192.168.1.1', 'Mozilla/5.0', 'product_search');
console.log('Track started, trackId:', trackId);
// ... perform your page load / scraping here ...
const startTime = Date.now();
// simulate page load
const loadTime = (Date.now() - startTime) / 1000;
// Phase 2: Update with results
const result = await updateTrackResult(trackId, {
captchaSolved: true,
pageLoadTime: loadTime,
pageContent: 'Product: Widget - $29.99'
});
console.log('Track updated:', result);
}
performTracking();
import requests
import time
API_TOKEN = 'your_api_token_here'
BASE_URL = 'https://analytics.boats/api/AnalyticsApi'
HEADERS = {'X-API-Token': API_TOKEN, 'Content-Type': 'application/json'}
# Phase 1: Track event
def track_event(ip, user_agent, keyword, referrer=''):
payload = {'ip': ip, 'userAgent': user_agent, 'keyword': keyword, 'referrer': referrer}
response = requests.post(f'{BASE_URL}/track', json=payload, headers=HEADERS)
return response.json()['data']['trackId']
# Phase 2: Update with results
def update_track(track_id, captcha_solved=None, page_load_time=None, page_content=None, error_log=None):
payload = {}
if captcha_solved is not None: payload['captchaSolved'] = captcha_solved
if page_load_time is not None: payload['pageLoadTime'] = page_load_time
if page_content is not None: payload['pageContent'] = page_content
if error_log is not None: payload['errorLog'] = error_log
response = requests.put(f'{BASE_URL}/track/{track_id}', json=payload, headers=HEADERS)
return response.json()
# Example: Two-phase tracking
track_id = track_event('192.168.1.1', 'Mozilla/5.0', 'product_search')
print(f'Track started, trackId: {track_id}')
# Perform your scraping here...
start_time = time.time()
# ... scraping logic ...
load_time = time.time() - start_time
# Update with results
result = update_track(track_id, captcha_solved=True, page_load_time=load_time, page_content='Product: Widget')
print(f'Track updated: {result}')
<?php
$apiToken = 'your_api_token_here';
$baseUrl = 'https://analytics.boats/api/AnalyticsApi';
$headers = ['X-API-Token: ' . $apiToken, 'Content-Type: application/json'];
// Phase 1: Track event
function trackEvent($ip, $userAgent, $keyword, $referrer = '') {
global $baseUrl, $headers;
$data = ['ip' => $ip, 'userAgent' => $userAgent, 'keyword' => $keyword, 'referrer' => $referrer];
$ch = curl_init("$baseUrl/track");
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => $headers]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
return $response['data']['trackId'];
}
// Phase 2: Update with results
function updateTrack($trackId, $data) {
global $baseUrl, $headers;
$ch = curl_init("$baseUrl/track/$trackId");
curl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => $headers]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
return $response;
}
// Example: Two-phase tracking
$trackId = trackEvent('192.168.1.1', 'Mozilla/5.0', 'form_submit');
echo "Track started, trackId: $trackId\n";
// Perform scraping here...
$startTime = microtime(true);
// ... scraping logic ...
$loadTime = microtime(true) - $startTime;
// Update with results
$result = updateTrack($trackId, ['captchaSolved' => true, 'pageLoadTime' => $loadTime, 'pageContent' => 'Content...']);
print_r($result);
?>
using System.Net.Http;
using System.Text;
using System.Text.Json;
public class AnalyticsClient
{
private readonly HttpClient _client;
private readonly string _baseUrl = "https://analytics.boats/api/AnalyticsApi";
public AnalyticsClient(string apiToken)
{
_client = new HttpClient();
_client.DefaultRequestHeaders.Add("X-API-Token", apiToken);
}
// Phase 1: Track event
public async Task<string> TrackEventAsync(string ip, string userAgent, string keyword)
{
var payload = new { ip, userAgent, keyword, referrer = "" };
var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await _client.PostAsync($"{_baseUrl}/track", content);
var json = JsonDocument.Parse(await response.Content.ReadAsStringAsync());
return json.RootElement.GetProperty("data").GetProperty("trackId").GetString();
}
// Phase 2: Update with results
public async Task<string> UpdateTrackAsync(string trackId, bool? captchaSolved = null,
double? pageLoadTime = null, string pageContent = null, string errorLog = null)
{
var payload = new Dictionary<string, object>();
if (captchaSolved.HasValue) payload["captchaSolved"] = captchaSolved.Value;
if (pageLoadTime.HasValue) payload["pageLoadTime"] = pageLoadTime.Value;
if (pageContent != null) payload["pageContent"] = pageContent;
if (errorLog != null) payload["errorLog"] = errorLog;
var content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await _client.PutAsync($"{_baseUrl}/track/{trackId}", content);
return await response.Content.ReadAsStringAsync();
}
}
// Example: Two-phase tracking
var client = new AnalyticsClient("your_api_token_here");
var trackId = await client.TrackEventAsync("192.168.1.1", "Mozilla/5.0", "purchase");
Console.WriteLine($"Track started, trackId: {trackId}");
// Perform scraping here...
var stopwatch = Stopwatch.StartNew();
// ... scraping logic ...
stopwatch.Stop();
// Update with results
var result = await client.UpdateTrackAsync(trackId, captchaSolved: true,
pageLoadTime: stopwatch.Elapsed.TotalSeconds, pageContent: "Product details...");