> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magicblock.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# getBlocksWithLimit

> Returns a list of confirmed blocks starting at the given slot for a given limit.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://devnet-as.magicblock.app/ \
    --header 'Content-Type: application/json' \
    --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getBlocksWithLimit",
    "params": [
      5,
      3
    ]
  }'
  ```
</RequestExample>


## OpenAPI

````yaml /pages/ephemeral-rollups-ers/api-reference/rpc/openapi/openapi-rpc-getBlocksWithLimit.json POST /
openapi: 3.1.0
info:
  title: MagicBlock Solana RPC API
  description: >-
    Solana JSON-RPC method getBlocksWithLimit on MagicBlock devnet RPC
    endpoints.
  version: 1.0.0
servers:
  - url: https://devnet-as.magicblock.app/
    description: Devnet AS - RPC
  - url: https://devnet-us.magicblock.app/
    description: Devnet US - RPC
  - url: https://devnet-eu.magicblock.app/
    description: Devnet EU - RPC
  - url: https://devnet-tee.magicblock.app/
    description: Devnet TEE - RPC
  - url: https://as.magicblock.app/
    description: Mainnet AS - RPC
  - url: https://us.magicblock.app/
    description: Mainnet US - RPC
  - url: https://eu.magicblock.app/
    description: Mainnet EU - RPC
  - url: https://mainnet-tee.magicblock.app/
    description: Mainnet TEE - RPC
security: []
paths:
  /:
    post:
      summary: getBlocksWithLimit
      description: >-
        Returns a list of confirmed blocks starting at the given slot for a
        given limit.
      operationId: getBlocksWithLimitRpc
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  enum:
                    - getBlocksWithLimit
                  default: getBlocksWithLimit
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                params:
                  type: array
                  items:
                    type:
                      - string
                      - object
                  description: Start slot and limit. See Solana RPC docs for exact shape.
                  minItems: 1
                  maxItems: 2
                  default:
                    - '5'
                    - '3'
                id:
                  oneOf:
                    - type: integer
                    - type: string
                  default: 1
              default:
                method: getBlocksWithLimit
                jsonrpc: '2.0'
                params:
                  - '5'
                  - '3'
                id: 1
              required:
                - jsonrpc
                - id
                - method
                - params
            example:
              method: getBlocksWithLimit
              jsonrpc: '2.0'
              params:
                - '5'
                - '3'
              id: 1
            examples:
              default:
                summary: Default getBlocksWithLimit request
                value:
                  method: getBlocksWithLimit
                  jsonrpc: '2.0'
                  params:
                    - '5'
                    - '3'
                  id: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                    default: '2.0'
                  id:
                    oneOf:
                      - type: integer
                      - type: string
                  result:
                    type: array
                    items:
                      type: integer
                    description: Array of confirmed slot numbers.
                required:
                  - jsonrpc
                  - id
              example:
                jsonrpc: '2.0'
                result:
                  - 5
                  - 6
                  - 7
                id: 1
      externalDocs:
        description: Official Solana RPC documentation
        url: https://solana.com/docs/rpc/http/getblockswithlimit

````