# getBlocksWithLimit

## getBlocksWithLimit RPC Method

> Returns a list of confirmed blocks starting at the given slot. This method provides an efficient way to retrieve a range of  sequential block slots, which is useful for block explorers,  analytics tools, and applications that need to process historical  blockchain data in batches.\
> \
> \*\*Important\*\*: The limit must be no more than 500,000 blocks  higher than the start\_slot.<br>

````json
{"openapi":"3.0.3","info":{"title":"Solana RPC API - getBlocksWithLimit Method","version":"1.0.0"},"tags":[{"name":"Block Data","description":"Methods related to block data retrieval. These methods provide\ninformation about confirmed blocks, their transactions, and metadata.\n"}],"servers":[{"url":"https://public.rpc.solanavibestation.com"},{"url":"https://basic.rpc.solanavibestation.com"},{"url":"https://ultra.rpc.solanavibestation.com"},{"url":"https://elite.rpc.solanavibestation.com"},{"url":"https://epic.rpc.solanavibestation.com"},{"url":"https://basic.swqos.solanavibestation.com"},{"url":"https://ultra.swqos.solanavibestation.com"},{"url":"https://elite.swqos.solanavibestation.com"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization header for API key authentication.\n\n**Example:**\n```\nAuthorization: your-api-key-here\n```\n"},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"API key passed as a URL parameter for authentication.\n\n**Example:**\n```\nhttps://public.rpc.solanavibestation.com/historical?api_key=your-api-key-here\n```\n"}},"schemas":{"GetBlocksWithLimitRequest":{"type":"object","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier that will be returned in the response"},"method":{"type":"string","description":"The RPC method name","enum":["getBlocksWithLimit"]},"params":{"type":"array","description":"Method parameters:\n\n1. Start slot (u64) - The slot to start searching from\n2. Limit (u64) - The number of blocks to return (must be no more than 500,000 blocks higher than the start_slot)\n","minItems":1,"maxItems":2,"items":[{"type":"integer","format":"int64","description":"Start slot - The slot to start searching from","minimum":0},{"type":"integer","format":"int64","description":"Limit - The number of blocks to return","minimum":1,"maximum":500000}]}}},"GetBlocksWithLimitResponse":{"type":"object","description":"RPC response containing the list of confirmed block slots","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier matching the original request"},"result":{"type":"array","items":{"type":"integer","format":"int64","description":"Block slot number","minimum":0},"description":"An array of u64 integers listing confirmed blocks starting at  start_slot for up to limit blocks, inclusive. The array may  contain fewer blocks than requested if some slots in the range  do not have confirmed blocks. An empty array indicates no  confirmed blocks were found in the specified range.\n"},"error":{"$ref":"#/components/schemas/RpcError"}}},"RpcError":{"type":"object","description":"Standard JSON-RPC error object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Numeric error code following JSON-RPC 2.0 specification:\n- `-32700`: Parse error\n- `-32600`: Invalid request  \n- `-32601`: Method not found\n- `-32602`: Invalid params\n- `-32603`: Internal error\n- `-32005`: Too Many Requests\n- `-32003`: Unauthorized\n"},"message":{"type":"string","description":"Human-readable error message"},"data":{"type":"object","description":"Additional structured error information (optional)","additionalProperties":true}}}}},"paths":{"/historical":{"post":{"summary":"getBlocksWithLimit RPC Method","description":"Returns a list of confirmed blocks starting at the given slot. This method provides an efficient way to retrieve a range of  sequential block slots, which is useful for block explorers,  analytics tools, and applications that need to process historical  blockchain data in batches.\n\n**Important**: The limit must be no more than 500,000 blocks  higher than the start_slot.\n","operationId":"getBlocksWithLimit","tags":["Block Data"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBlocksWithLimitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBlocksWithLimitResponse"}}}},"401":{"description":"Unauthorized","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"Too Many Requests","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
````
