Pakistan National Internet Observatory

Public API

Third-party access to PNIO traceroute data, targets, anomalies, and infrastructure statistics

Authentication

All endpoints require an API key. Pass it via header or query parameter:

curl -H "X-API-Key: YOUR_KEY" https://pnio.s4s.host/v1/public/stats
curl "https://pnio.s4s.host/v1/public/stats?api_key=YOUR_KEY"
Rate Limits

Default: 100 req/hr, 2000 req/day

Response Format

JSON by default, CSV for exports

Interactive Docs
OpenAPI / Swagger UI
GET/v1/public/traces

Search and filter traceroutes with pagination. Supports filtering by direction, probe location, target, anomaly score, status, and time range.

Parameters

direction(string)outside_to_pk, pk_to_outside, cross_isp, within_isp
probe_city(string)Probe city name
probe_country(string)Probe country code (e.g. PK, US)
probe_asn(integer)Probe AS number
target_domain(string)Target domain (partial match)
target_ip(string)Exact target IP
target_city(string)Target city name
min_anomaly(float)Minimum anomaly score (0.0-1.0)
status(string)completed or failed
since(string)ISO datetime start
until(string)ISO datetime end
hours(integer)Last N hours (default: 168, max: 720)
page(integer)Page number (default: 1)
limit(integer)Results per page (default: 50, max: 200)
include_hops(boolean)Include hop details (default: false)
curl -H "X-API-Key: $KEY" "https://pnio.s4s.host/v1/public/traces"
GET/v1/public/traces/{trace_id}

Get a single traceroute with full hop details, geo enrichment, and ASN data.

Parameters

trace_id(uuid)requiredTraceroute ID
curl -H "X-API-Key: $KEY" "https://pnio.s4s.host/v1/public/traces/example"
GET/v1/public/traces/export

Bulk export traces as JSON or CSV. Max 10,000 traces per export.

Parameters

format(string)json or csv (default: json)
direction(string)Filter by direction
min_anomaly(float)Minimum anomaly score
hours(integer)Last N hours (default: 24)
limit(integer)Max traces (default: 1000, max: 10000)
include_hops(boolean)Include hop details (default: true)
curl -H "X-API-Key: $KEY" "https://pnio.s4s.host/v1/public/traces/export"

Error Codes

CodeErrorDescription
401api_key_requiredNo API key provided
403invalid_keyAPI key not found in database
403key_disabledAPI key has been deactivated
403key_expiredAPI key has passed its expiry date
404not_foundRequested resource does not exist
429rate_limit_hourlyHourly request limit exceeded
429rate_limit_dailyDaily request limit exceeded