API & Developers
Integrate WebCount.BG IP / DNS / domain tools directly into your applications, monitoring systems, and internal panels. Below is an example structure of a public API, which you can adapt to the final implementation.
1. Authentication and API keys
Access to the WebCount.BG API is provided through an API key. Each registered user can request one or more keys for production and test environments.
- Log in to your WebCount.BG account;
- Go to the API / Developers section in the profile (planned module);
- Generate a new API key and optionally restrict it by IP / domain.
All requests must include the key, for example in an HTTP header:
GET https://webcount.bg/api/v1/analytics/ip/8.8.8.8
X-Api-Key: YOUR_API_KEY_HERE
Note: replace the URL address and header names according to the final production configuration.
2. Limits and proper usage
To keep the platform stable and fair for everyone, the API should have limits per key / plan. Example logic:
- Free / test plan: e.g. 1,000 requests per day;
- Pro / paid plans: higher daily / monthly quotas;
- Enterprise: custom limits and separate infrastructure.
When a limit is exceeded, the API can return HTTP 429 Too Many Requests
with a short JSON response describing the limit.
3. Example endpoints
Several typical endpoints you can expose (examples):
GET /api/v1/analytics/ip/{ip}– IP geo data and risk flags;GET /api/v1/analytics/domain/{domain}– DNS, MX, NS, HTTP check;GET /api/v1/scamdetect/{domain}– combined reputation / risk score;GET /api/v1/uptime/{monitor_id}– uptime monitor status.
The actual JSON structure can follow the arrays you already use in
analytics.php and reputation.php.
4. Example request (cURL)
Basic example of an IP analytics request via cURL:
curl -X GET \
"https://webcount.bg/api/v1/analytics/ip/8.8.8.8" \
-H "X-Api-Key: YOUR_API_KEY_HERE" \
-H "Accept: application/json"
Example JSON response:
{
"ip": "8.8.8.8",
"geo": {
"country": "United States",
"city": "Mountain View",
"isp": "Google LLC"
},
"risk": {
"score": 15,
"label": "Low risk"
}
}
The exact fields depend on how you map data from external services and the internal risk scoring.
5. Example integration (PHP)
A minimal example of an API request from another PHP project:
<?php
$ip = '8.8.8.8';
$key = 'YOUR_API_KEY_HERE';
$url = 'https://webcount.bg/api/v1/analytics/ip/' . urlencode($ip);
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-Api-Key: ' . $key,
'Accept: application/json',
],
]);
$body = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code === 200 && $body !== false) {
$data = json_decode($body, true);
// work with $data['ip'], $data['geo'], $data['risk'], ...
} else {
// error handling / logging
}
6. Contact and custom integrations
For production API access, higher limits, whitelisting, or on-premise installations you can contact us:
- Through the Contact form in WebCount.BG;
- Describe the use case (SaaS, ISP, hosting, SOC, MSP, etc.);
- Add the expected volume and which endpoints you plan to use.
Private endpoints or separate infrastructure for large partners are also possible, under individual commercial terms.