Get Polygon span info
https://api.triport.io/v1/polygon/bor/span/6789Returns the bor span with the given id — its block range, validator set, and selected block producers.
A span is the unit Polygon's bor layer uses to assign block-producer
duties. Each span fixes the active validator set, the subset of validators
selected to produce blocks for that span, and the contiguous range of bor
blocks the span covers. This endpoint returns the span identified by
span_id.
Use it to learn which validators were responsible for a stretch of Polygon
blocks — for example to attribute a block to its producer, to audit producer
rotation, or to drive consensus dashboards. Spans are immutable once committed,
so a successful response for a given span_id will not change.
This is the REST wrapper over the bor_getSpan JSON-RPC method. If you already
speak JSON-RPC, see bor_getSpan for the
equivalent call.
Parameters
Path parameters
span_idinteger (int64, minimum 0)required0.Response
Response fields
| Field | Type | Description |
|---|---|---|
span_id | integer (int64) | The id of the returned span. Echoes the path parameter. |
start_block | integer (int64) | First bor block (inclusive) covered by this span. |
end_block | integer (int64) | Last bor block covered by this span. |
validators | array<object> | Full validator set active for this span (see below). Optional — omitted when the upstream returns no set. |
validators[].id | integer (int64) | Validator id. |
validators[].signer | string | Validator's 0x-prefixed signer address. |
validators[].power | integer (int64) | Validator voting power for this span. |
validators[].accum | integer (int64) | Proposer-priority accumulator (may be negative). |
selected_producers | array<string> | 0x-prefixed addresses chosen to produce blocks during this span (a subset of validators). Optional. |
chain_id | string | Chain id of the network the span belongs to ("137" for Polygon mainnet). Optional. |
Only span_id, start_block, and end_block are guaranteed present; the
remaining fields are populated when available.
Errors
| Code | Meaning | When it happens |
|---|---|---|
401 | unauthorized / trial_expired / subscription_expired | Missing or invalid Authorization header, or the key's trial/subscription has lapsed. |
403 | tier_insufficient / method_unknown | The key's tier is below basic, or the method is not part of its product. The X-Required-Tier header carries the minimum tier. |
404 | resource_not_found | No span exists for the supplied span_id. |
429 | rate_limited | Sustained requests exceeded your tier's per-second limit. Honor Retry-After. |
All errors share the standard envelope (error, message, request_id). See
errors.md for the full envelope and shared codes.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/polygon/bor/span/6789", {
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
},
});
if (res.status === 404) {
throw new Error("span not found");
}
const span = await res.json();
console.log(`span ${span.span_id}: blocks ${span.start_block}–${span.end_block}`);
console.log("producers:", span.selected_producers);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const client = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const span = await client.polygon.bor.getSpan(6789);
console.log(span.start_block, span.end_block);
console.log(span.selected_producers);Python (triport-sdk)
import os
from triport import Triport
client = Triport(api_key=os.environ["TRIPORT_API_KEY"])
span = client.polygon.bor.get_span(6789)
print(span["span_id"], span["start_block"], span["end_block"])
print(span["selected_producers"])Notes
- Span ids are sequential. They start at
0and increase as the chain progresses; each span covers a fixed contiguous block range. To find the span for a given block, divide through the span size or walk ids untilstart_block <= block <= end_block. - Selected producers ⊆ validators.
selected_producersis the rotation of block producers for the span and is always a subset of thevalidatorsset. - Related endpoints. For the live validator set rather than a historical
span, use
GET /v1/polygon/bor/validators/current. The JSON-RPC equivalent of this endpoint isbor_getSpan. - Rate limits are enforced per second per tier (no daily cap). On
429, wait for theRetry-Afterinterval before retrying.