Back to the map
Solana Mainnet - API Docs

API Reference

Query parameters, response fields, and examples for each endpoint powering the Next Leader TPU Map.

GET /api/next-leaders

Returns upcoming slot leaders with TPU metadata starting from the latest known slot.

Query params
  • limit Optional integer. Defaults to 1000, clamps between 1 and 5000. Invalid values fall back to the default.
Response fields
  • currentSlot Latest slot used as the starting point.
  • limit The resolved limit after clamping.
  • leaders Array of slot rows (see below).
  • slotMs Estimated milliseconds per slot.
  • ts Server timestamp (ms since epoch).
Leader row
  • slot Slot number.
  • leader Validator identity pubkey.
  • tpu TPU address string, if known.
  • ip Parsed IP address, if available.
  • port Parsed port, if available.
Example

GET /api/current-slot

Returns the latest observed Solana slot and server timestamp.

Query params
  • None.
Response fields
  • currentSlot Latest slot hint used by the service.
  • ts Server timestamp (ms since epoch).
Example

GET /api/leader-stream

Server-sent events (SSE) stream of the current and next slot leader.

Query params
  • track Optional validator identity pubkey. When present, payloads include slotsUntilLeader when known.
Event payload
  • slot Current slot number.
  • slotTimestamp Slot timestamp in ms since epoch.
  • currentValidator Current leader pubkey.
  • nextValidator Next leader pubkey.
  • currentTpu, currentIp, currentPort TPU metadata for the current leader.
  • nextTpu, nextIp, nextPort TPU metadata for the next leader.
  • slotsUntilSwitch Slots remaining until the leader switches.
  • slotsUntilLeader Slots until the tracked leader (only when track is set).
Error event
  • Emits an error SSE event with {"message":"..."} when the stream encounters a backend issue.
Example

GET /api/leader-path

Returns upcoming leaders plus MaxMind geolocation data for the map view.

Query params
  • limit Optional integer. Defaults to 1000, clamps between 1 and 5000. Invalid values fall back to the default.
Response fields
  • currentSlot Latest slot used as the starting point.
  • limit The resolved limit after clamping.
  • slotMs Estimated milliseconds per slot.
  • path Array of rows with slot, leader, ip, port, and geolocation fields latitude, longitude, city, country.
  • ts Server timestamp (ms since epoch).
Example