API Reference

Complete endpoint documentation. All examples below.

Quick start

Get your API key

  1. 1. Create a Latens account (free, no card)
  2. 2. Visit your account dashboard
  3. 3. Generate an API key from the "Developers" section
  4. 4. Include it in the Authorization header of your requests

Example header:

Authorization: Bearer sk_live_abc123xyz789...

Endpoints

GET

/v1/threats/recent

Description

Fetch the most recent threat detections. Returns threats detected in the last 24 hours, ordered newest first. No authentication required for public threats feed.

Query parameters

limit
Optional. Default: 20, Max: 100 Number of results to return
offset
Optional. Default: 0 Pagination offset
type
Optional. Values: phishing, malware, botnet, exploit, crawler Filter by threat type

Code examples

curl -X GET 'https://api.latens.net/v1/threats/recent?limit=20' \
  -H "Authorization: Bearer YOUR_API_KEY"

Response schema

{
  "data": [
    {
      "id": "threat_20260411_001",
      "timestamp": "2026-04-11T14:32:00Z",
      "domain": "phish-paypal-verify.ru",
      "type": "phishing",
      "confidence": 0.98,
      "first_seen": "2026-04-11T12:15:00Z",
      "blocked_by": 42847,
      "status": "active"
    }
  ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 12847
  }
}
GET

/v1/threats/feed

Auth required

Description

Real-time threat feed via Server-Sent Events (SSE). Keep an open connection and receive new threats as they're detected. Extremely useful for SIEM integration and real-time dashboards.

Headers

Authorization: Bearer YOUR_API_KEY

Code examples

curl -X GET 'https://api.latens.net/v1/threats/feed' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: text/event-stream"
GET

/v1/threats/ip/{ip}

Pro plan

Description

Look up the reputation of an IP address and get all known malicious domains resolved from it.

Parameters

ip

IPv4 or IPv6 address to look up

Code examples

curl -X GET 'https://api.latens.net/v1/threats/ip/185.220.101.45' \
  -H "Authorization: Bearer YOUR_API_KEY"

Response schema

{
  "ip": "185.220.101.45",
  "reputation": "dangerous",
  "threat_count": 12,
  "last_seen": "2026-04-10T22:45:00Z",
  "domains": [
    {
      "domain": "botnet-c2.cc",
      "type": "botnet",
      "first_seen": "2026-03-15T10:20:00Z"
    }
  ]
}
GET

/v1/threats/stats

Description

Get aggregate threat statistics. Useful for dashboards, reports, and trend analysis.

Query parameters

period
Optional. Default: 24h. Values: 1h, 6h, 24h, 7d, 30d Time period for statistics

Code examples

curl -X GET 'https://api.latens.net/v1/threats/stats?period=24h' \
  -H "Authorization: Bearer YOUR_API_KEY"

Response schema

{
  "period": "24h",
  "total_threats": 12847,
  "by_type": {
    "phishing": 5230,
    "malware": 3450,
    "botnet": 2100,
    "exploit": 1067,
    "crawler": 1000
  },
  "unique_ips": 2847,
  "blocked_requests": 847291,
  "trend": "increasing",
  "trend_percent": 2.4
}
GET

/blocklist.txt

Description

Plain text blocklist in standard format (one domain per line). No authentication required. Compatible with Pi-hole, dnsdist, DNS sinkhole, and other blocklist-based systems.

Code examples

curl -X GET 'https://api.latens.net/blocklist.txt' \
  -o blocklist.txt

Response format (excerpt)

phish-paypal-verify.ru
botnet-c2.cc
cryptominer.net
malware.exploit-kit.cc
trojaned-router-fw.net
fake-apple-id.ru
credential-stealer.cc

Authentication

Authorization header

Include your API key in every request using the Authorization header.

Authorization: Bearer YOUR_API_KEY

Example:

Authorization: Bearer sk_live_4eC39HqLyjWDarhtT658W135_26cFWY

API key formats

  • sk_live_ Production API keys (start with sk_live_)
  • sk_test_ Test API keys (start with sk_test_). Free for testing.

Keep your API key secret. Don't commit it to version control. Rotate regularly.

Error responses

400

Bad Request

Invalid parameters or malformed request

401

Unauthorized

Missing or invalid API key

429

Too Many Requests

Rate limit exceeded. Check X-RateLimit-Reset header

500

Server Error

Unexpected server error. Try again later

Example error response:

{
  "error": "Unauthorized",
  "message": "Invalid API key",
  "status": 401
}

Rate limiting

Free tier

Per day 100 requests
Per minute 5 requests

Pro tier

Per day 10,000 requests
Per minute 500 requests

Rate limit headers

Every response includes rate limit information:

X-RateLimit-Limit Total requests allowed in the period
X-RateLimit-Remaining Requests remaining in the current period
X-RateLimit-Reset Unix timestamp when the limit resets

Webhooks coming soon

Webhook subscriptions will allow you to receive notifications when new threats are detected. Follow our GitHub for updates.

Questions?

Email us or check the status page.