SecureNow API Docs

SecureNow API Documentation

The SecureNow API provides AI-powered threat intelligence, IP reputation scoring, and security automation for your applications. Public endpoints require no authentication.

🔓

Free Public API

No API key needed. Query IP intelligence instantly.

🤖

AI-Powered

Threat verdicts, bot detection, and attack classification.

⚡

Real-Time

Sub-second responses with 24h intelligent caching.

Authentication

Public API — No Auth Required

All endpoints under /api/public/* are free and require no authentication. Just send a request and get results.

Authenticated API — Bearer Token

Platform endpoints require a Bearer token. Obtain one by signing into the SecureNow dashboard or by using the CLI.

bash
# CLI login (generates a session token)
npx securenow login

# Use the token in requests
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://api.securenow.ai/api/applications

Runtime SDK - API Key

The SDK uses a per-app snk_live_... runtime API key to authenticate telemetry ingestion and firewall sync. npx securenow login (or npx securenow app connect) writes it to .securenow/runtime.json; admin login is separate. There is no client object to construct: the preload reads the file at startup. Rotate the key with npx securenow api-key create or npx securenow api-key set snk_live_....

json
// .securenow/runtime.json (secret: never commit or print it)
{
  "apiKey": "snk_live_...",
  "app": { "key": "<app-uuid>", "name": "my-api" },
  "config": { "runtime": { "deploymentEnvironment": "local" } }
}

Base URLs

EnvironmentURLUse
Production APIhttps://api.securenow.aiAll API requests
Dashboardhttps://app.securenow.aiUser login, settings
OTLP Endpointhttps://ingest.securenow.aiTrace ingestion (OpenTelemetry)

Rate Limits

Rate limits are applied per client IP address. Exceeding the limit returns a 429 status with a retryAfter field indicating seconds to wait.

EndpointLimitCache
/api/public/ip-intel/:ip10 req/min1 hour (public), 24h (server)
/api/public/ip-intel/recent-ips2 req/min24 hours
/api/public/ip/:ip10 req/min1 hour
Authenticated endpointsVaries by plan—

Error Handling

All errors return a JSON body with an error field. HTTP status codes follow standard conventions.

StatusMeaningExample
400Bad Request{ "error": "Only IPv4 addresses are currently supported" }
401Unauthorized{ "error": "Authentication required" }
404Not Found{ "error": "Resource not found" }
429Rate Limited{ "error": "Rate limit exceeded. Max 10 requests per minute.", "retryAfter": 60 }
500Server Error{ "error": "Failed to fetch IP intelligence" }

SDKs & Collections

📦

npm Package

CLI + SDK for Node.js, Next.js, Nuxt, and Express.

bash
npm install securenow@latest
View on npm →
🟠

Postman Collection

Import into Postman or Insomnia. All endpoints pre-configured.

📄

OpenAPI Spec

OpenAPI 3.1 spec for code generation and tooling.

View openapi.json

SDK Setup

Install the npm package and integrate with your framework. See also: CLI Reference | Download SKILL.md files

Installation

The securenow package includes the SDK (tracing, logging, body capture, firewall), CLI binary, MCP server, and framework integrations. Install the latest package, then connect with the credentials-first login flow.

Project dependency

npm install securenow@latest

Global CLI

npm install -g securenow@latest

Connect

npx securenow login
Current flow: npx securenow login picks or creates the app and writes runtime app config plus the runtime API key to .securenow/runtime.json; the firewall runs as soon as that key is present. Admin/control-plane auth lives separately in .securenow/admin.json. Both files are secrets: login and init gitignore them without ignoring the whole .securenow/ folder. Then npx securenow init detects the framework and fills the defaults. Environment variables are not required for SDK runtime setup.
Coding agents: the full playbook ships in the package as node_modules/securenow/SKILL-API.md (integration) and SKILL-CLI.md (CLI). Every CLI command documents itself offline: npx securenow help <command>.
Node.js: run a patched release (22.23.4+, 24.22.1+, or 26.12.1+); tested on Node 24.22. CommonJS package, works on macOS, Linux, and Windows.

Framework Integration

Pick your framework below. Most need zero code changes — just a preload flag or one config line.

Express / Node

0 lines changed
bash
# Express 4/5, Fastify, NestJS, Koa, Hapi, Hono (@hono/node-server),
# Polka, Feathers, h3, raw http. ESM and TypeScript (tsx) use the same flag.

# Connect once. This writes .securenow/runtime.json.
npx securenow login

# Then add the preload flag — zero code changes.
node -r securenow/register src/index.js

# TypeScript: SecureNow first, then your loader
node -r securenow/register --import tsx src/index.ts

# Can't change the command? Use NODE_OPTIONS
NODE_OPTIONS="-r securenow/register" npm start

# Or use the CLI
npx securenow run src/index.js

# Bun 1.3, apps served through node:http (Bun.serve is not covered)
bun --preload securenow/register app.js

# PM2 ecosystem.config.cjs: fork or cluster mode, no env vars needed.
# Use an absolute path: in cluster mode a bare -r is resolved from the
# PM2 daemon's folder, so workers crash if it was started elsewhere.
module.exports = {
  apps: [{
    script: './app.js',
    instances: 'max',
    node_args: ['-r', require.resolve('securenow/register')],
  }],
};

Runtime Configuration

SecureNow boots from .securenow/runtime.json locally, then legacy/generated runtime credential files. Production should mount the tokenless runtime export as .securenow/credentials.json or .securenow/credentials.<env>.json. Every setting below is a key in that file.

The SDK reads only two environment variables: SECURENOW_CREDENTIALS, for hosts that cannot mount a file, and SECURENOW_DISABLED. Older variables such as SECURENOW_APPID, SECURENOW_INSTANCE or SECURENOW_NO_UUID are ignored.

SettingDefaultDescription
.securenow/runtime.jsonlocal SDK runtimeGenerated by `npx securenow login` or `npx securenow app connect`. Stores app identity, runtime API key, ingest routing, and SDK defaults.
.securenow/admin.jsonadmin CLI/MCPGenerated by `npx securenow admin login` or the friendly login flow. Stores admin/control-plane auth only.
.securenow/credentials.jsonlegacy/prod mountLegacy combined credentials are still read. Production should mount the tokenless runtime export here when needed.
.securenow/credentials.<env>.jsonproduction exportGenerated by `npx securenow credentials runtime --env production`; accepted directly when credentials.json is absent.

Deployment

Production uses a tokenless runtime export: npx securenow credentials runtime --env production writes .securenow/credentials.production.json (app key, runtime API key and config, never the admin token). Ship it as <app-root>/.securenow/credentials.json, or on hosts without file mounts store the output of --format env as the secret SECURENOW_CREDENTIALS. Keep the preload on the command that really starts the server.

bash
# Writes .securenow/credentials.production.json (app key, runtime API key, config; no admin token)
npx securenow credentials runtime --env production
# Ship it as <app-root>/.securenow/credentials.json (secret file or mount)

# Hosts without file mounts: one secret environment variable
npx securenow credentials runtime --env production --format env
# prints SECURENOW_CREDENTIALS=<base64>; it wins over every credentials file

# .dockerignore: keep local secrets out of images
.securenow/admin.json
.securenow/runtime.json
.securenow/credentials*.json

Verify

  • Start the app and read its startup line: [securenow] pid=... appId="<app-uuid>" ... apiKey=set credentials=<path or env:SECURENOW_CREDENTIALS> → service.name=<app-uuid> (Next.js: [securenow] Next.js App -> service.name=<app-uuid> apiKey=set ...), then Firewall: ENABLED and Firewall: synced <n> global blocked IPs.
  • apiKey=missing means telemetry and firewall sync are rejected: run npx securenow app connect. No [securenow] line at all means the preload is not on the command that starts the server.
  • init writes deploymentEnvironment: "local" while the CLI and dashboard default to production: pass --env local when checking a local run.
  • Keep test runs out of the real app with SECURENOW_DISABLED=1 npm test.
bash
npx securenow version     # 8.24.0+ (8.25.0+ for the marked items)
npx securenow whoami      # admin auth and the runtime app both present
npx securenow env         # service name = app key, environment, firewall enabled
npx securenow doctor      # All checks passed.
npx securenow test-span   # Span accepted (HTTP 200)

# start the app, send one real request, then:
npx securenow traces --env local --limit 5
npx securenow status
npx securenow today
npx securenow firewall test-ip 203.0.113.7 --env production

Tested On & Limits

  • Tested end to end (traces, client IP, body capture with redaction, 403 block, 429 rate limit, challenge, errors, logs) on Node 24.22 with Express 4.22 and 5.3, Fastify 5.12, NestJS 11.2, Koa 3.3, Hapi 21.4, Hono 4, Polka 0.5, Feathers 5.0, h3 1.15, Next.js 14.2 (8.25.0+), 15.5 and 16.4 (Turbopack and webpack, next start and standalone), Nuxt 3.21 and 4.6, Bun 1.3 and PM2 5.4 (fork and cluster). Older majors are expected to work but are not tested.
  • Not supported: Edge runtimes (Cloudflare Workers, Vercel Edge, Next.js Edge middleware and routes), Deno, Bun.serve, browser telemetry.
  • Not tested: Vercel (the firewall is unverified on its serverless functions), AWS Lambda and other serverless platforms.
  • Cloud WAF (layer 4): AWS WAF tested against real IP sets (8.25.2+); Cloudflare and GCP tested on the request format only, not against real accounts.
  • IPv6: the blocklist, allowlist, trusted IPs, rate limits, challenges and API-key IP limits take IPv6 addresses and CIDR ranges; layer 1 and trusted proxies match them from 8.25.0 (older SDKs match exact IPv6 addresses but ignore IPv6 ranges).

SDK Features

What the SDK does once it is wired, and how to use each feature from the CLI, MCP or your code. Items marked 8.25.0+ need that version (npx securenow version).

What Is Automatic

Once the runtime is wired, none of this needs code:

  • Traces: one server span per request with method, status, client IP and route (http.route for Express, Fastify, NestJS, Koa with @koa/router, Hapi and Nuxt; Next.js, Hono, h3, Feathers and Polka from 8.25.0), plus database (Postgres, MySQL, MongoDB, Redis...) and outgoing HTTP spans.
  • Header and body capture with redaction: JSON, form and GraphQL bodies up to capture.maxBodySize, multipart field values and file metadata (never file content). Passwords, tokens, OTP codes, cards, emails and other sensitive fields are redacted in the app, by name and by value shape.
  • Logs: console.* lines become log records linked to the active trace. From 8.25.0 they are redacted before export (config.logging.redact, default true); attributes passed to getLogger().emit() are exported as set. Redaction goes by field names and value shapes, so don't log secrets in free text.
  • Crash capture: uncaught exceptions and unhandled rejections become FATAL logs with the stack; logs and finished spans are flushed before the process exits.
  • Firewall: blocklist and allowlist (403), rate limits (429 with Retry-After) and proof-of-work challenges, synced from the dashboard, CLI and MCP.
bash
npx securenow redact '{"email":"a@b.co","password":"x","otpCode":"123456"}'
npx securenow traces --env production --limit 5
npx securenow logs errors --since 1h
npx securenow logs --level fatal --since 1h

Client IP & Trusted Proxies

The client IP is the connection's address unless the connection comes from a trusted proxy; then it is the right-most untrusted X-Forwarded-For address (or CF-Connecting-IP, True-Client-IP, X-Real-IP). Private, loopback and (8.25.0+) Unix-socket connections are trusted by default, so a client cannot pick its IP through X-Forwarded-For. The firewall, rate limits, session detection and traces all use this IP.

  • Behind Cloudflare, a CDN or a load balancer with a public address, list it in config.networking.trustedProxies: exact IPs, IPv4 or IPv6 CIDRs (IPv6 ranges 8.25.0+), or "cloudflare" for Cloudflare's edge ranges. Make the proxy forward the client (X-Forwarded-For).
  • Check it: in npx securenow traces show <traceId>, http.client_ip is the visitor and http.client_ip.source is x-forwarded-for, not socket. Starter protection refuses block mode while more than 20% of the app's traffic comes through a proxy it doesn't trust.
json
{ "config": { "networking": { "trustedProxies": ["cloudflare", "203.0.113.10", "198.51.100.0/24"] } } }

Firewall Layers

  • Layer 1, HTTP 403: always on once the runtime API key is present; works behind proxies. It enforces the blocklist (SecureNow's known-bad IP feed, refreshed hourly, plus your entries), the allowlist, scoped blocks, challenges and rate limits. Version check every 10 seconds, full resync hourly, fail-open by default (failMode).
  • Layer 2, TCP drop (tcp: true): destroys the socket before HTTP parsing. Layer 3, OS firewall (iptables: true): kernel DROP rules; Linux, root or CAP_NET_ADMIN (in Docker: --cap-add NET_ADMIN and the iptables package). Layers 2 and 3 see only the connection's source IP, so they help only when clients connect directly.
  • Layer 4, Cloud WAF (cloud: "cloudflare" | "aws" | "gcp"): pushes the global blocklist to the edge; on Cloudflare your own WAF rule must reference the securenow-blocklist list. cloudDryRun: true logs the pushes only. AWS tested against real IP sets (8.25.2+); Cloudflare and GCP request format tested only.
  • Layers 2 to 4 carry global IP/CIDR blocks only; turn them on with 8.25.0+. Turn the whole firewall on or off per app and environment in the dashboard or with npx securenow firewall enable|disable (config.firewall.enabled is ignored).
json
{
  "config": {
    "firewall": {
      "failMode": "open",
      "tcp": true,
      "iptables": true,
      "cloud": "cloudflare",
      "cloudflare": { "apiToken": "<secret>", "accountId": "<account-id>" }
    }
  }
}
bash
npx securenow firewall status
npx securenow firewall test-ip 203.0.113.7 --path /admin --env production
npx securenow firewall hits --since 1h
npx securenow firewall disable --app <key> --env local

Blocklist, Allowlist & Trusted IPs

  • Blocklist: an IP address or CIDR range, IPv4 or IPv6 (IPv6 ranges need securenow 8.25.0+), everywhere or on one route and method, optionally expiring. Unblocking keeps the history. Blocks reach running apps in about 10 seconds.
  • Allowlist (dangerous): deny-by-default. Once one entry is active for an app and environment, only listed IPs get through. Use it only to lock an app to known IPs.
  • Trusted IPs: uptime monitors, office VPN, your own servers. Alerts on them are suppressed; nobody is restricted.
bash
npx securenow blocklist add 203.0.113.42 --env production --duration 24h --reason "credential stuffing"
npx securenow blocklist add 203.0.113.42 --route /admin --mode prefix --method ALL --reason "admin probing"
npx securenow blocklist unblock <id> --reason "false alarm"
npx securenow trusted add 198.51.100.20 --label "Uptime monitor"
npx securenow allowlist add 198.51.100.7 --app <key> --env production --label "Office" --reason "lock the admin app"

Rate Limits & Redis

Rules live in SecureNow, not in your code, and running apps apply them within about 10 seconds. A rule matches a route (exact, prefix or regex) and method, optionally an IP or CIDR, and counts per IP, globally, per request-header value (API key, tenant) or per cookie value (session). Over the limit: HTTP 429 with Retry-After.

  • Counters live in each process: with PM2 cluster or several servers, share them through Redis with config.firewall.rateLimitStore (redis:// or rediss://). If Redis is unreachable, counting falls back to in-process.
  • Rules are per environment and the CLI defaults to production: create one with --env local to try it on a local run.
bash
npx securenow ratelimit add --route /api/login --method POST --limit 5 --window 1m --env production --reason "login brute force"
npx securenow ratelimit add --route /api/ --limit 100 --window 1m --header x-api-key --env production
npx securenow ratelimit from-text "5 per minute per IP on POST /api/login for 2h" --yes
npx securenow ratelimit test 203.0.113.42 --path /api/login --method POST --env production
json
{ "config": { "firewall": { "rateLimitStore": "redis://your-redis:6379" } } }

Challenges (Proof of Work)

A softer step than a block. Browsers get an invisible proof-of-work page (14 bits by default, about a second) and a pass cookie valid 30 minutes. Clients that don't accept HTML get a 403 JSON challenge_required, so don't challenge API routes that non-browser clients call. A challenge can escalate to a block after repeated failures.

bash
npx securenow challenge add --route /login --clearance 30m --env production
npx securenow challenge add 203.0.113.0/24 --route /signup --difficulty 16 --escalate-to-block --fail-threshold 10 --block-ttl-hours 24
npx securenow challenge test 203.0.113.9 --path /login --method GET --env production

Security Events: track()

Your app reports what only it knows: sign-ins, OTPs, password resets, MFA. Events feed brute-force, credential-stuffing and account-takeover detection, and alert rules can query them. track() is fire-and-forget: batched in the background, never throws, and uses the runtime credentials (call await flush() before a script exits).

  • Recommended events: auth.login.failure, auth.login.success, auth.otp.send.requested, auth.otp.send.result, auth.otp.verify.failure, auth.otp.verify.success, auth.password_reset.requested, auth.password_reset.completed, auth.mfa.challenge.failure, auth.mfa.challenge.success, auth.session.revoked.
  • Properties: userId, sessionId, ip, userAgent, severity (trace to fatal), ts, and your own fields under attributes (strings, numbers, booleans).
  • From a shell, CI or a non-JS service: npx securenow event send auth.login.failure --user u_test --ip 203.0.113.10 --attrs reason=test. See what arrived: npx securenow telemetry fields --since 1h --json.
javascript
const { track } = require('securenow/events');   // ESM: import { track } from 'securenow/events';
const { resolveClientIp } = require('securenow/resolve-ip');   // the firewall's trusted-proxy rules

app.post('/api/login', async (req, res) => {
  const ip = resolveClientIp(req);
  const user = await findUserByEmail(req.body.email);
  if (!user || !(await verifyPassword(user, req.body.password))) {
    track('auth.login.failure', {
      userId: user ? user.id : undefined,   // your internal id, never the password
      ip, userAgent: req.get('user-agent'), severity: 'warn',
      attributes: { reason: user ? 'bad_password' : 'unknown_user' },
    });
    return res.status(401).json({ error: 'Invalid email or password' });
  }
  track('auth.login.success', { userId: user.id, ip, attributes: { method: 'password' } });
  res.json({ ok: true });
});

Session Revocation

Revoke a stolen session or every session of a user from the CLI, the dashboard or automation. The SDK pulls active revocations every 30 seconds and rejects matching requests locally (fail-open). The session id is the SHA-256 of the Bearer token or of the session cookie (your sessions.cookieNames (8.25.0+), then __Secure-next-auth.session-token, __Host-next-auth.session-token, next-auth.session-token, connect.sid, session, sid); the user id is the JWT sub.

  • Zero code, every framework (8.25.0+): sessions.guard answers a revoked session or user with 401 and clears the session cookies; sessions.capture sends session.seen (deduplicated per session and IP every 5 minutes) for session-theft detection. Works with -r securenow/register, Next.js, Nuxt and firewall-only.
  • Express-style apps (Express, Connect, Polka, NestJS on the Express adapter, Feathers with Express): app.use(sessions.guard()), optionally with your own getSessionId(req) and getUserId(req).
  • Anything else (8.25.0+): sessions.check(req) takes a Node request or a Web Request and returns { revoked, sessionId, userId }; answer 401 yourself. Fastify request.raw, Koa ctx.req, Hono c.req.raw, h3 event.node.req, a Next.js route handler's request. Lower level: sessions.isRevoked({ sessionId, userId }).
bash
npx securenow revoke session <session-id> --reason "impossible travel" --duration 24h
npx securenow revoke user <user-id> --reason "account takeover"   # default expiry 7d
npx securenow revoke list
npx securenow revoke restore <id> --reason "verified with the user"
json
{ "config": { "sessions": { "guard": true, "capture": true, "cookieNames": ["my_app_session"] } } }
javascript
const sessions = require('securenow/sessions');

// Express, Connect, Polka, NestJS (Express adapter), Feathers (Express)
app.use(sessions.guard());

// Fastify (8.25.0+): the same check works in Koa, Hono, h3 and Next.js route handlers
fastify.addHook('onRequest', async (request, reply) => {
  if (sessions.check(request.raw).revoked) return reply.code(401).send({ error: 'session_revoked' });
});

Detection & Alert Rules

  • Starter protection: every app gets about 20 rules (SQL injection, XSS, traversal, command and template injection, Log4Shell, SSRF, .env/.git probes, attack tools, failed sign-ins, 404 scanning...) in monitor mode on first traffic: they alert and block nothing. Only a signed-in person can turn blocking on.
  • Alert rules from English or SQL start in test mode: they alert and nothing acts on them until a person promotes them. Agents ask with alerts rules request-promotion.
  • AI investigations prepare a verdict and a proposed action for each alerting IP; decisions wait in Requires Human (npx securenow human), rules that fired too wide in Alert Review (npx securenow review).
bash
npx securenow protect status
npx securenow alerts rules from-text "one IP failing 10 sign-ins in 5 minutes" --app <key> --draft-only
npx securenow alerts rules test <rule-id> --wait
npx securenow alerts rules runs <rule-id> --since 1h
npx securenow alerts rules promote <rule-id> --yes
npx securenow today
npx securenow attacker 203.0.113.42

MCP for Coding Agents

  • Local stdio server after npx securenow login, or the hosted server https://api.securenow.ai/mcp with OAuth sign-in (an API key as Authorization: Bearer <key> also works).
  • 125 tools (62 read-only, 63 write). Every write tool refuses to run without confirm: true and a non-empty reason. npx securenow mcp --profile investigator|detection|responder serves fewer tools.
bash
claude mcp add securenow -- npx securenow mcp
codex mcp add securenow -- npx securenow mcp
claude mcp add --transport http securenow https://api.securenow.ai/mcp   # hosted, OAuth

# Cursor: .cursor/mcp.json
{ "mcpServers": { "securenow": { "command": "npx", "args": ["securenow", "mcp"] } } }

Public API Reference

Free endpoints — no authentication required.

Get IP Intelligence

GEThttps://api.securenow.ai/api/public/ip-intel/{ip}

Returns a comprehensive AI-powered threat report for any IPv4 address. Combines SecureNow's proprietary scoring, AI analysis, bot detection, attack classification, and SecureNow AI IPDB community data into a single response.

Path Parameters

NameTypeRequiredDescription
ipstringREQUIREDIPv4 address to analyze (e.g. "185.220.101.1")

Response Fields

FieldTypeDescription
ipstringThe queried IP address
securenowScoreintegerComposite threat score (0 = clean, 100 = highly malicious)
verdictstringAI-generated threat verdict (e.g. "Malicious - Automated Scanner", "Clean")
isMaliciousbooleanWhether the IP is classified as malicious
isBotboolean | nullWhether traffic is bot/automated (null if unknown)
activityTypestringType of activity observed (e.g. "Automated Scanning")
attackTypesstring[]Array of attack categories (Port Scan, Brute Force, etc.)
summarystringHuman-readable AI analysis summary
riskFactorsstring[]List of risk factors contributing to the score
botVsHumanAnalysisstringDetailed bot vs human classification reasoning
securenowIpdbobjectSecureNow AI IPDB data: confidenceScore, countryCode, isp, domain, totalReports, recentReports
sourcesstring[]Data sources used (SecureNow AI IPDB, securenow-internal, securenow-ai)
lastUpdatedAtstring (ISO 8601)Timestamp of last data refresh

Code Examples

bash
curl -s "https://api.securenow.ai/api/public/ip-intel/185.220.101.1" | jq .

Example Response

json
{
  "ip": "185.220.101.1",
  "securenowScore": 87,
  "verdict": "Malicious - Automated Scanner",
  "isMalicious": true,
  "isBot": true,
  "activityType": "Automated Scanning",
  "attackTypes": ["Port Scan", "Brute Force", "Web Application Attack"],
  "summary": "This IP has been widely reported for automated scanning and brute force attacks...",
  "riskFactors": [
    "High SecureNow AI IPDB confidence score (95%)",
    "Known Tor exit node",
    "Over 500 community abuse reports"
  ],
  "botVsHumanAnalysis": "Traffic patterns are consistent with automated scanning tools...",
  "securenowIpdb": {
    "abuseConfidenceScore": 95,
    "countryCode": "DE",
    "countryName": "Germany",
    "domain": "torproject.org",
    "isp": "Tor Exit Node",
    "usageType": "Hosting/Transit/CDN",
    "totalReports": 543,
    "lastReportedAt": "2026-03-13T10:30:00Z",
    "recentReports": [
      {
        "reportedAt": "2026-03-13T10:30:00Z",
        "categories": [14, 15],
        "comment": "Port scan and SSH brute force attempts"
      }
    ]
  },
  "sources": ["securenow-ipdb", "securenow-internal", "securenow-ai"],
  "lastUpdatedAt": "2026-03-13T12:00:00Z"
}

Get Recent IPs

GEThttps://api.securenow.ai/api/public/ip-intel/recent-ips

Returns a list of recently analyzed IP addresses. Useful for building sitemaps or discovering trending threat IPs. Heavily cached (24 hours) and more strictly rate-limited.

Rate limit: 2 requests per minute. Response is cached for 24 hours.

Example Response

json
{
  "ips": [
    "185.220.101.1",
    "45.33.32.156",
    "103.152.220.44",
    "192.42.116.16"
  ]
}
bash
curl -s "https://api.securenow.ai/api/public/ip-intel/recent-ips" | jq .

Get IP Data (Legacy)

GEThttps://api.securenow.ai/api/public/ip/{ip}
Deprecated: This endpoint returns a flatter, SecureNow AI IPDB-compatible response shape. Use /api/public/ip-intel/{ip} instead for the full AI-powered analysis.

Returns basic IP reputation data in a simplified format compatible with older integrations.

Path Parameters

NameTypeRequiredDescription
ipstringREQUIREDIPv4 address to look up

Example Response

json
{
  "ip": "185.220.101.1",
  "abuseConfidenceScore": 95,
  "countryCode": "DE",
  "isp": "Tor Exit Node",
  "domain": "torproject.org",
  "totalReports": 543,
  "lastReportedAt": "2026-03-13T10:30:00Z"
}

Authenticated API Reference

These endpoints require a Bearer token. Obtain one through the dashboard or via npx securenow login.

Applications

GEThttps://api.securenow.ai/api/applications
Auth Required

Manage your monitored applications. Create, update, delete applications and retrieve their API keys for integration.

MethodPathDescription
GET/api/applicationsList all applications
POST/api/applicationsCreate a new application
GET/api/applications/:idGet application by ID
PUT/api/applications/:idUpdate an application
DELETE/api/applications/:idDelete an application
POST/api/applications/bulkBulk operations on applications
GET/api/applications/:id/ipsList IPs hitting this application
POST/api/applications/:id/detect-techDetect application tech stack

Traces

GEThttps://api.securenow.ai/api/traces
Auth Required

Access HTTP request traces collected by the SecureNow SDK. View individual traces, analyze suspicious requests with AI, and investigate incidents.

MethodPathDescription
GET/api/tracesList traces (supports filtering & pagination)
GET/api/traces/:traceIdGet a single trace by ID
POST/api/analyze-traceStart AI analysis on a trace
GET/api/analyze-trace/:analysisIdGet analysis results

Analytics

GEThttps://api.securenow.ai/api/analytics
Auth Required

Retrieve aggregated security analytics for your applications. Response codes, error rates, and traffic patterns broken down by status category.

MethodPathDescription
GET/api/analytics/2xx-responsesSuccessful responses over time
GET/api/analytics/3xx-responsesRedirect responses over time
GET/api/analytics/4xx-responsesClient error responses
GET/api/analytics/5xx-responsesServer error responses
GET/api/analytics/500-errorsDetailed 500-level errors

Forensics

POSThttps://api.securenow.ai/api/forensics/query
Auth Required

AI-powered security forensics. Ask questions in natural language and get structured results from your trace data. Supports chat-based investigations and saved query libraries.

MethodPathDescription
POST/api/forensics/queryExecute a natural language query
GET/api/forensics/query/status/:jobIdCheck query execution status
POST/api/forensics/chatStart or continue a chat investigation
GET/api/forensics/chat/status/:idGet chat response status
POST/api/forensics/chat/confirm/:idConfirm a suggested action
GET/api/forensics/conversationsList saved conversations
GET/api/forensics/conversations/:idGet conversation history
GET/api/forensics/query-libraryList saved query templates
POST/api/forensics/query-library/executeExecute a saved query

Example: Natural Language Query

bash
curl -X POST https://api.securenow.ai/api/forensics/query \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query": "Show me all suspicious IPs from the last 24 hours"}'

Alert Rules & Channels

GEThttps://api.securenow.ai/api/alert-rules
Auth Required

Configure security alert rules, notification channels (Slack, email, webhooks), and review alert history.

MethodPathDescription
GET/api/alert-rulesList alert rules
POST/api/alert-rulesCreate an alert rule
PUT/api/alert-rules/:idUpdate an alert rule
DELETE/api/alert-rules/:idDelete an alert rule
GET/api/alert-channelsList notification channels
POST/api/alert-channelsCreate a notification channel
GET/api/alert-historyList alert history
GET/api/alert-history/:idGet alert details
GET/api/notificationsList notifications
POST/api/notifications/read-allMark all notifications read

Blocklist & Allowlist

GEThttps://api.securenow.ai/api/blocklist
Auth Required

Manage IP blocklists and allowlists for your applications. Block known threats automatically or whitelist trusted IPs and services.

MethodPathDescription
GET/api/blocklistList blocked IPs
POST/api/blocklistAdd IP to blocklist
GET/api/allowlistList allowed IPs
POST/api/allowlistAdd IP to allowlist
GET/api/trusted-ipsList trusted IPs
POST/api/trusted-ipsAdd a trusted IP

Firewall

GEThttps://api.securenow.ai/api/firewall
Auth Required

Real-time firewall integration endpoints. Used by the SecureNow SDK to sync blocklists and allowlists with your application's firewall middleware.

MethodPathDescription
GET/api/v1/firewall/statusGet firewall status
GET/api/v1/firewall/check/:ipCheck if an IP is blocked
GET/api/v1/firewall/blocklistGet full blocklist
GET/api/v1/firewall/allowlistGet full allowlist
GET/api/v1/firewall/blocklist/versionGet blocklist version (for sync)
GET/api/v1/firewall/allowlist/versionGet allowlist version (for sync)

SDK Integration

No code calls these endpoints: the preload syncs the lists itself with the runtime API key (version check every 10 seconds) and enforces them in the app. Wire it once, then check what it would do from the CLI. See Firewall Layers.

bash
# Express, Fastify, NestJS, Koa, Hapi, Hono... (Next.js and Nuxt: npx securenow init)
node -r securenow/register src/index.js

# Would this IP be blocked on this route?
npx securenow firewall test-ip 203.0.113.7 --path /admin --env production
npx securenow firewall status

Need Help?

Join our community, check out the blog, or contact us for enterprise support and custom integrations.