<!-- source: https://secondlayer.tools/docs/api-reference#list-subgraph-rows -->

## List a table's rows

`GET /v1/subgraphs/{name}/{table}`

Rows from one subgraph table, keyset-paginated. By default pages walk `_id`; `_sort` walks one column instead, with `_id` as the tiebreaker. `next_cursor` is set on every page that returned rows and is `null` only on an empty page: pass it back as `cursor` to continue, or tail new rows with `cursor = next_cursor ?? cursor`. `_offset` is refused (400): deep OFFSET scans hurt on big tables. `_limit` defaults to 50.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | string, required | Subgraph name, as deployed (the `name` in its definition). |
| `table` | string, required | Table name, one of the keys of the definition's `schema`. `GET /v1/subgraphs/{name}` lists them. |

### Filters

| Name | Type | Description |
| --- | --- | --- |
| `_search` | string | Case-insensitive contains match across every column marked `search: true` in the definition, ORed. 400 on a table with no searchable column. |
| `filters` | object | Column filters, one query param each, ANDed. Any table column or system column (`_id`, `_block_height`, `_tx_id`, `_created_at`) works. `col=value` is equality; `col.op=value` applies an operator, one of `gte`, `lte`, `gt`, `lt`, `neq`, `like`, `in`, `notIn`. `like` is a case-insensitive contains match. `in` and `notIn` take a comma-separated list. An unknown column is 400 `INVALID_COLUMN`; an unknown operator, or the misplaced form `col=op.value`, is 400 `VALIDATION_ERROR`. Bare `limit`, `offset`, `sort`, `order`, `fields` and `search` are 400: control params take a leading underscore. |

### Range and paging

| Name | Type | Description |
| --- | --- | --- |
| `_limit` | integer · 1 to 1000 | Page size, 1 to 1000. A non-integer, 0, a negative, or anything over 1000 is 400, not clamped. |
| `cursor` | string | The previous page's `next_cursor`, verbatim. Opaque: its shape depends on `_sort`, so never build one. A cursor issued under one `_sort`/`_order` is 400 under another. |
| `_sort` | string | One column to sort by. A comma list and `jsonb` columns are 400. Omit to page by `_id`. |
| `_order` | enum | Direction of the `_sort` column, or of `_id` without `_sort`. Anything but `asc` or `desc` is 400. Values: `asc`, `desc`. |
| `_fields` | string | Comma-separated columns to return. An unknown name is 400 `INVALID_COLUMN`. The cursor still works: `_id` and the `_sort` column are read for it and dropped from rows you did not ask them for. |

### Returns

One `SubgraphRowsPage` object.

### Responses

- `200` One page of rows
- `400` A parameter, filter, cursor or body field was refused; `code` says which
- `401` This bind requires the instance token, and it was missing or wrong
- `404` No readable subgraph by that name (`SUBGRAPH_NOT_FOUND`), or it has no such table (`TABLE_NOT_FOUND`)
- `429` Hosted only: rate limited; retry after `Retry-After` seconds. Self-hosted reads are not rate limited

### Example

```bash
curl -G https://api.secondlayer.tools/v1/subgraphs/{name}/{table} \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY" \
  -d filters=[object Object]
```

```json
{
  "rows": [
    {
      "_id": "48138",
      "_block_height": "9048926",
      "_tx_id": "0x926f5ff4326155dea077126d21810fc7954568647898dbfb2f66a28b880dc5c9",
      "_created_at": "2026-09-23T15:10:29.114Z",
      "sender": "SP1TPYSSG52FKCDHHN8Y76ABMA12P069BZBFAYEAF",
      "recipient": "SP3EWCDA3V8HCP64CSETSNYXZ25WC4AJ95EC0ZEST.zr-d-0",
      "amount": "14000",
      "asset_identifier": "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token::sbtc-token"
    }
  ],
  "next_cursor": "48138",
  "tip": {
    "block_height": 9048931,
    "subgraph_height": 9048931,
    "blocks_behind": 0
  }
}
```
