nsindocs Search the docs⌘K
  1. Docs
  2. API reference
  3. Analytics

Clients whose traffic resembles a proxy tunnel

gethttps://api.nsin.ir/analytics/tunnel-suspects

Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.

Clients whose WebSocket/gRPC traffic looks like a VPN or proxy tunnel run behind the CDN: sustained volume over a single fixed path, with opaque payloads and no sign of ordinary browsing (no real assets fetched, no referer).

This is a heuristic for investigation, not proof of abuse. balance is informational — tunnels used for browsing are download-heavy, so symmetry is not a criterion.

Query parameters

  • periodstringquery

    Time window, ending now. Time series are bucketed by minute for 1h, by hour up to 48h, and by day for 7d and 30d. Buckets are cut on Asia/Tehran (UTC+03:30) boundaries and emitted as UTC instants, so an hourly bucket starts at :30 UTC. An unrecognised value falls back to 24h.

    One of: "1h" "3h" "6h" "12h" "24h" "48h" "7d" "30d"
    Default: "24h"

Responses

200Suspected tunnel clients.

Content type: application/json

  • suspectsarray of TunnelSuspect
    Item fields
    • remote_addrstring
    • networkstring

      The client's network operator (AS organisation).

    • countrystring
    • hostnamestring
    • transportstring

      Detected transport. httpupgrade is Upgrade: websocket without a real WebSocket handshake.

      One of: "httpupgrade" "ws" "grpc" "xhttp" "http"
    • reqsinteger

      All requests from this client to this host.

    • tunnel_reqsinteger

      Requests with opaque payloads.

    • tunnel_pathsinteger

      Distinct paths used — around 1 for a tunnel.

    • upinteger

      Client-to-edge bytes.

    • downinteger

      Edge-to-client bytes.

    • balancenumber

      min/max of up and down. Informational only.

    • max_secsinteger

      Longest single connection, in seconds.

    • sample_pathstring

      The heaviest single path.

    • ja4string

      TLS fingerprint.

    • ja4hstring

      HTTP fingerprint.

    • uastring

      The client's User-Agent.

    • scoreinteger

      Additive tunnel score from the matched signals; higher is more tunnel-like.

    • severitystring

      The score's band. Empty below the lowest band.

      One of: "high" "medium" "low" ""
    • signalsarray of object

      The signals that contributed to score.

      Item fields
      • namestring

        Signal name.

      • valuenumber

        The measured value.

      • pointsinteger

        Points it added to the score.

      • detailstring

        Human-readable explanation, when there is one.

    • path_uniquenessnumber

      Distinct URIs per request. High is a tunnel signal — some tunnel software puts a random token in every URI.

    • cache_hit_rationumber

      The client's cache hit ratio, 0–1. A tunnel is uncacheable, so this is about 0.

    • bytes_per_reqnumber

      Average bytes per request.

    • ja4_clusterinteger

      How many distinct client IPs in this result share this client's TLS fingerprint on the same host.

    • httpupgrade_byte_sharenumber

      Share of this client's bytes carried over the httpupgrade transport, 0–1.

  • as_ofstring (date-time)

    When the ranking was computed. It is served from a precomputed store, so a 7d/30d answer can be up to an hour old.

  • refreshingboolean

    Present (true) while a newer ranking is being computed behind this one.

json
{
  "suspects": [
    {
      "remote_addr": "string",
      "network": "string",
      "country": "string",
      "hostname": "string",
      "transport": "httpupgrade",
      "reqs": 0,
      "tunnel_reqs": 0,
      "tunnel_paths": 0,
      "up": 0,
      "down": 0,
      "balance": 0,
      "max_secs": 0,
      "sample_path": "string",
      "ja4": "string",
      "ja4h": "string",
      "ua": "string",
      "score": 0,
      "severity": "high",
      "signals": [
        {
          "name": "string",
          "value": 0,
          "points": 0,
          "detail": "string"
        }
      ],
      "path_uniqueness": 0,
      "cache_hit_ratio": 0,
      "bytes_per_req": 0,
      "ja4_cluster": 0,
      "httpupgrade_byte_share": 0
    }
  ],
  "as_of": "2026-01-01T00:00:00Z",
  "refreshing": true
}
401Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "invalid API key"
}
429The key exceeded its request budget (300 requests per minute by default).

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

json
{
  "error": "rate limit exceeded"
}
503Either the analytics backend is temporarily unreachable (retry; no data is lost), or the answer is still being computed. The per-domain sections and the cached account-wide views (domains-overview, global-summary, global-summary/peak, requests-compare, bandwidth-overview, nodes-overview) wait at most about 25 seconds for their query; past that they answer 503 with pending: true and a Retry-After header, while the query keeps running and caches its result, so the retry is served from that cache instead of starting the same scan again. Identical concurrent requests share one computation.

Content type: application/json

  • errorstringrequired

    Human-readable description of what went wrong.

  • pendingboolean

    true when the query is still running rather than failing. Retry after Retry-After seconds.

json
{
  "error": "analytics unavailable"
}

Example request

bash
curl -X GET "https://api.nsin.ir/analytics/tunnel-suspects" \
  -H "Authorization: Bearer $NSIN_API_KEY"
esc