TriportRPC

Get Polygon span info

GEThttps://api.triport.io/v1/polygon/bor/span/6789

Returns the bor span with the given id — its block range, validator set, and selected block producers.

Polygonpolygon_borbasic (and above) — per-second rate limit by tier, no daily cap. See [rate-limits-and-tiers.md](../../rate-limits-and-tiers.md).

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)required
The id of the span to fetch. Span ids are sequential, starting at 0.

Response

Response fields

FieldTypeDescription
span_idinteger (int64)The id of the returned span. Echoes the path parameter.
start_blockinteger (int64)First bor block (inclusive) covered by this span.
end_blockinteger (int64)Last bor block covered by this span.
validatorsarray<object>Full validator set active for this span (see below). Optional — omitted when the upstream returns no set.
validators[].idinteger (int64)Validator id.
validators[].signerstringValidator's 0x-prefixed signer address.
validators[].powerinteger (int64)Validator voting power for this span.
validators[].accuminteger (int64)Proposer-priority accumulator (may be negative).
selected_producersarray<string>0x-prefixed addresses chosen to produce blocks during this span (a subset of validators). Optional.
chain_idstringChain 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

CodeMeaningWhen it happens
401unauthorized / trial_expired / subscription_expiredMissing or invalid Authorization header, or the key's trial/subscription has lapsed.
403tier_insufficient / method_unknownThe key's tier is below basic, or the method is not part of its product. The X-Required-Tier header carries the minimum tier.
404resource_not_foundNo span exists for the supplied span_id.
429rate_limitedSustained 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 0 and 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 until start_block <= block <= end_block.
  • Selected producers ⊆ validators. selected_producers is the rotation of block producers for the span and is always a subset of the validators set.
  • 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 is bor_getSpan.
  • Rate limits are enforced per second per tier (no daily cap). On 429, wait for the Retry-After interval before retrying.