DEVELOPER HUB

Institutional API Docs

Build high-frequency trading bots, integrate real-time prediction markets, and leverage our proprietary AI news analysis pipeline.

Authentication

NewsTrade uses Bearer tokens to authenticate requests. All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail unless specified.

Example Header
Authorization: Bearer <YOUR_TOKEN>

Authentication

Authenticate your requests using Bearer tokens.

GET /api/auth/me Auth

Verify the current session and get user ID.

JSON Response
{
  "success": true,
  "userId": "user_123456"
}
POST /api/auth/login

Authenticate a user and receive a session token.

Parameters

NameTypeDescription
email *stringUser email address
password *stringUser password
JSON Response
{
  "success": true,
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "user": { "id": "user_123", "email": "[email protected]" }
}

Prediction Markets

Interact with prediction markets, place trades, and check odds.

GET /api/market

Fetch all available prediction markets.

Parameters

NameTypeDescription
category stringFilter by category (politics, sports, crypto, etc.)
status stringFilter by status (open, closed, settled)
search stringSearch by market question
JSON Response
{
  "success": true,
  "data": [
    {
      "id": "mkt-001",
      "question": "Will the Central Bank of Nigeria raise rates in Q3?",
      "category": "politics",
      "status": "open",
      "totalVolume": 1250000,
      "buyPrice": 0.65,
      "sellPrice": 0.62
    }
  ],
  "total": 42
}
POST /api/market/trade Auth

Place a trade on a specific market.

Parameters

NameTypeDescription
marketId *stringThe ID of the market to trade on
direction *stringTrade direction: "buy" or "sell"
stake *numberAmount to stake in NGN
JSON Response
{
  "success": true,
  "data": {
    "trade": {
      "id": "trade-998",
      "marketId": "mkt-001",
      "direction": "buy",
      "stake": 5000,
      "contractPrice": 0.65,
      "contracts": 7692,
      "status": "open"
    },
    "priceImpact": 0.02
  },
  "message": "BUY trade placed successfully."
}

News & AI Analysis

Access real-time news feeds and AI-powered sentiment analysis.

GET /api/news

Fetch paginated and filtered news items.

Parameters

NameTypeDescription
page numberPage number (default: 1)
limit numberItems per page (max: 100)
category stringFilter by news category
aiOnly booleanOnly show AI-generated news
JSON Response
{
  "success": true,
  "data": [...],
  "total": 150,
  "page": 1,
  "hasMore": true
}

AI Agents

Interact with autonomous AI agents and orchestration pipelines.

GET /api/agents

Get status and health of all AI agents in the registry.

Parameters

NameTypeDescription
agentId stringFilter status for a specific agent
JSON Response
{
  "success": true,
  "data": [
    { "id": "director-chisom", "status": "working", "successRate": 98 },
    { "id": "researcher-idris", "status": "idle", "successRate": 95 }
  ],
  "systemStatus": "healthy"
}