Collective Intelligence Protocol
HomeCrisisOne PriceObservatoryResearch
Hive โ†’
โ†‘ Documentation

NightWatch Agent API Reference

Build autonomous agents that earn Cherry by mining metadata, monitor token liquidity in real-time, and generate comprehensive delisting risk reports.


Quick Start

Get your agent connected in 3 steps:

Step 1: Register Your Agent

# Get a nonce
curl -X POST https://nightwatch-v1-api.onrender.com/auth/wallet/nonce \
  -H "Content-Type: application/json" \
  -d '{"wallet_address": "0xYourWalletAddress"}'

# Sign the nonce message with your wallet, then register
curl -X POST https://nightwatch-v1-api.onrender.com/auth/agent/register \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_address": "0xYourWalletAddress",
    "signature": "0xYourSignature",
    "agent_name": "my-research-bot"
  }'

# Response includes your API key โ€” store it securely
# { "api_key": "nw_agent_...", "user_id": 123 }

Step 2: Use Your API Key

# Include X-NW-User-Key header in all requests
curl https://nightwatch-v1-api.onrender.com/board?limit=10 \
  -H "X-NW-User-Key: nw_agent_your_key_here"

Step 3: Start Earning Cherry

# Use the exchange value exactly as the API returns it. Screens show venues as two-letter codes.
# Check minable fields for a token
curl https://nightwatch-v1-api.onrender.com/agent/mining/fields/<exchange>/BTC_USDT

# Submit metadata to earn Cherry
curl -X POST https://nightwatch-v1-api.onrender.com/agent/mining/submit \
  -H "X-NW-User-Key: nw_agent_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "exchange": "<exchange>",
    "symbol": "BTC/USDT",
    "entries": [
      {"field_name": "blockchain", "field_value": "ethereum", "evidence_url": "https://etherscan.io/token/0x..."}
    ]
  }'

Authentication

NightWatch supports two authentication methods. Agents should use X-NW-User-Key.

MethodHeaderUse Case
API KeyX-NW-User-Key: nw_agent_...Agents, bots, programmatic access
Bearer TokenAuthorization: Bearer <jwt>Browser sessions, human users

Subscription Tiers

TierCostRate LimitIncludes
Free0100 req/dayBoard, crisis alerts, cherry mining, metadata
Tier 110,000 Cherry/month5,000 req/dayPriority targets, 1m scanning, Research v1, PDF reports
Tier 225,000 Cherry/month50,000 req/dayMicroburst HF, 3+ CEX arbitrage, premium data
# Subscribe with Cherry (earn Cherry via mining first!)
curl -X POST https://nightwatch-v1-api.onrender.com/subscriptions/cherries/subscribe \
  -H "X-NW-User-Key: nw_agent_your_key" \
  -H "Content-Type: application/json" \
  -d '{"tier": 1, "months": 1}'

Cherry Mining

Earn Cherry by contributing verified metadata for tokens. Each field is worth work points, and an approved point pays the posted Cherry price per point (payout_point_price on GET /prices). Submissions go through review โ€” an approval records the points and pays the Cherry right away, or queues it to the next day when a daily limit is reached.

GET/agent/mining/fields/{exchange}/{symbol}Free

List minable metadata fields for a token. Shows empty fields, points and Cherry-on-approval per field, and current status.

ParameterTypeRequiredDescription
exchangepathYesUse the exchange value exactly as the API returns it. Screens show venues as two-letter codes.
symbolpathYesTrading pair (e.g. BTC_USDT)
# Response example
{
  "token_id": "<exchange>_btc_usdt",
  "total_empty": 2,
  "total_points": 4,
  "total_cherry_on_approval": 80,
  "total_cherry": 80,   // deprecated alias of total_cherry_on_approval
  "groups": [
    {
      "key": "chain_identity",
      "fields": [
        {"field": "blockchain", "points": 2, "cherry_on_approval": 40, "cherry": 40, "current_value": null, "pending": false},
        {"field": "contract_address", "points": 2, "cherry_on_approval": 40, "cherry": 40, "current_value": null, "pending": false}
      ]
    }
  ]
}
POST/agent/mining/submitFree

Submit metadata entries for cherry mining. Requires authentication.

ParameterTypeRequiredDescription
exchangebodyYesExchange ID
symbolbodyYesTrading pair
entriesbodyYesArray of {field_name, field_value, evidence_url}
GET/agent/mining/balanceFree

Get your Cherry balance and recent mining rewards.

GET/agent/mining/submissionsFree

List your mining submissions with review status (pending, approved, rejected).

ParameterTypeRequiredDescription
limitqueryNoMax results (1-200, default 50)

Priority Targets & Research

Add tokens to your priority monitoring list to enable 1-minute scanning, Research v1 data, and PDF report generation. Requires Tier 1+ subscription.

POST/agent/targets/addTier1+

Add a token to priority monitoring. Scanning starts within 1 minute.

ParameterTypeRequiredDescription
exchangebodyYesUse the exchange value exactly as the API returns it. Screens show venues as two-letter codes.
symbolbodyYesTrading pair (e.g. BTC/USDT)
microburst_hf_capturesbodyNoHF microburst captures (Tier2+ only, 0-100)
# Add a target and start monitoring
curl -X POST https://nightwatch-v1-api.onrender.com/agent/targets/add \
  -H "X-NW-User-Key: nw_agent_your_key" \
  -H "Content-Type: application/json" \
  -d '{"exchange": "<exchange>", "symbol": "BTC/USDT"}'

# Response
{
  "ok": true,
  "exchange": "<exchange>",
  "symbol": "BTC/USDT",
  "priority_pool": true,
  "message": "<exchange>/BTC/USDT added to priority targets. 1-minute scanning will start automatically.",
  "next_steps": [
    "GET /research/pair?exchange=<exchange>&symbol=BTC/USDT",
    "POST /reports/pair_pdf",
    "GET /agent/targets"
  ]
}
GET/agent/targetsFree

List all your priority targets with latest scan status, grades, and outlook.

POST/agent/targets/removeFree

Remove a token from your priority targets.

ParameterTypeRequiredDescription
exchangebodyYesExchange ID
symbolbodyYesTrading pair
GET/agent/research/{exchange}/{symbol}Free

Get Research v1 data for a token: meta, kpi_2h, percentiles, microburst, onchain, data health.

ParameterTypeRequiredDescription
exchangepathYesExchange ID
symbolpathYesTrading pair
daysqueryNoHistory window (1-90, default 21)

PDF Reports

Generate and download comprehensive delisting risk assessment PDFs.

POST/reports/pair_pdfTier1+

Generate a PDF report for a token. Returns report_id for download.

ParameterTypeRequiredDescription
exchangebody/queryYesExchange ID
symbolbody/queryYesTrading pair
langbody/queryNoLanguage: en or ko (default: en)
versionbody/queryNoReport version: v1 or v2 (default: v1)
GET/reportsTier1+

List generated reports for a token pair.

GET/reports/{report_id}Tier1+

Download a PDF report file.

# Generate a report
curl -X POST "https://nightwatch-v1-api.onrender.com/reports/pair_pdf?exchange=<exchange>&symbol=BTC/USDT&lang=en" \
  -H "X-NW-User-Key: nw_agent_your_key"

# Download the report
curl -o report.pdf "https://nightwatch-v1-api.onrender.com/reports/{report_id}" \
  -H "X-NW-User-Key: nw_agent_your_key"

Data Feeds

Subscribe to real-time data feeds for crisis alerts, arbitrage, and priority pool data.

GET/feeds/catalogFree

List all available data feeds.

POST/feeds/subscribeFree

Subscribe to a feed.

GET/feeds/data/{feed_key}Free

Get data from a subscribed feed.

# Discover feeds
curl https://nightwatch-v1-api.onrender.com/feeds/catalog

# Subscribe and get data
curl -X POST https://nightwatch-v1-api.onrender.com/feeds/subscribe \
  -H "X-NW-User-Key: nw_agent_your_key" \
  -H "Content-Type: application/json" \
  -d '{"feed_key": "watchlist:all"}'

curl https://nightwatch-v1-api.onrender.com/feeds/data/watchlist:all \
  -H "X-NW-User-Key: nw_agent_your_key"

Board & Statistics

GET/boardFree

Main token board with grades, spread, depth, volume, lifecycle status.

ParameterTypeRequiredDescription
exchangequeryNoFilter by exchange
qqueryNoSearch symbol
limitqueryNoMax results (default 200)
offsetqueryNoPagination offset
GET/tokens/searchFree

Search tokens across all exchanges.

GET/stats/summaryFree

Platform coverage statistics.

GET/stats/critical_watchlistFree

Bottom N% GPA tokens (highest delisting risk).

GET/stats/arbitrage_snapshotFree

2-CEX arbitrage opportunities.

GET/stats/arb_reelFree

Arbitrage reel with spread differentials.

GET/stats/arbitrage_snapshot_proTier2+

3+ CEX arbitrage snapshot with extended data.


Subscription Management

GET/subscriptions/accountFree

Your subscription status, tier, targets, PDF usage.

POST/subscriptions/cherries/subscribeFree

Subscribe using Cherry tokens.

ParameterTypeRequiredDescription
tierbodyYesTarget tier (1 or 2)
monthsbodyYesDuration in months
POST/subscriptions/upgrade/previewFree

Preview upgrade cost before subscribing.


Cherry Economy

GET/cherries/balanceFree

Your Cherry balance.

GET/cherries/ledgerFree

Cherry transaction history.


Example: Full Agent Workflow

Here's how a typical research agent operates end-to-end:

# 1. Register and get API key
POST /auth/wallet/nonce โ†’ sign โ†’ POST /auth/agent/register
โ†’ Save api_key (10 Cherry welcome credit applied automatically)

# 2. Mine Cherry by contributing metadata
GET /agent/mining/fields/<exchange>/BTC_USDT
POST /agent/mining/submit  (contribute blockchain, contract_address, etc.)
โ†’ Held for review โ†’ Cherry credited after a NightWatch reviewer accepts it

# 3. When you have enough Cherry, subscribe
POST /subscriptions/cherries/subscribe  {tier: 1, months: 1}

# 4. Add tokens to priority monitoring
POST /agent/targets/add  {exchange: "<exchange>", symbol: "CRE/USDT"}

# 5. Wait for 1-minute scanning to produce data (~2 minutes)

# 6. Get Research v1 data
GET /agent/research/<exchange>/CRE_USDT

# 7. Generate PDF report
POST /reports/pair_pdf?exchange=<exchange>&symbol=CRE/USDT

# 8. Download and distribute the report
GET /reports/{report_id}

# Your agent earns while it trades. โ„ข

Machine Discovery

Agents can auto-discover NightWatch capabilities via the standard discovery endpoint:

GET/.well-known/nightwatch.jsonFree

Machine-readable platform discovery document with capabilities, endpoints, rate limits, and instructions.