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

# Get Extraction Table Rows

> Get paginated rows from an extraction table

Retrieves paginated rows from a specific table in an extraction. This endpoint is useful for accessing large tables efficiently.

## Usage Notes

* Use pagination to retrieve rows from large tables
* Row indexes are 0-based, meaning the first row has an index of 0
* When no `offset` or `limit` is provided, defaults to offset 0 and limit 100
* Multiple filters can be combined using comma-separated values (e.g., `filter=error,warn`)

## Request

<ParamField path="id" type="string" required>
  The ID of the extraction.
</ParamField>

<ParamField path="tableKey" type="string" required>
  The key of the table to retrieve rows from.
</ParamField>

<ParamField query="offset" type="integer" default="0">
  The number of rows to skip. Minimum value is 0.
</ParamField>

<ParamField query="limit" type="integer" default="100">
  The maximum number of rows to return. Minimum value is 1, maximum value is
  1000\.
</ParamField>

<ParamField query="filter" type="string" default="all">
  Filter rows by status or validation state. Supports comma-separated values for multiple filters.

  * `all` - Return all rows (default)
  * `valid` - Rows that pass all validations
  * `invalid` - Rows that fail at least one validation
  * `error` - Rows with error-severity validations
  * `warn` - Rows with warning-severity validations
  * `info` - Rows with info-severity validations
</ParamField>

<ParamField query="column_validations" type="string">
  Filter to only return rows that have validations in specific columns. Provide column keys as
  comma-separated values (e.g., `column_validations=unit_price,quantity`). Only rows with
  validation issues in any of the specified columns will be returned.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.tableflow.com/v2/extractions/uT2bJNWN75YPU95r/tables/line_items/rows?offset=0&limit=100 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const axios = require("axios");

  async function getTableRows(extractionId, tableKey, offset, limit, filter = "all") {
    try {
      const response = await axios.get(
        `https://api.tableflow.com/v2/extractions/${extractionId}/tables/${tableKey}/rows`,
        {
          params: {
            offset,
            limit,
            filter,
          },
          headers: {
            Authorization: "Bearer YOUR_API_KEY",
          },
        }
      );
      return response.data;
    } catch (error) {
      console.error(error);
      throw error;
    }
  }

  // Example usage
  getTableRows("uT2bJNWN75YPU95r", "line_items", 0, 100)
    .then(result => {
      console.log(`Fetched ${result.rows.length} rows out of ${result.pagination.total}`);
      // Process the rows
      result.rows.forEach(row => {
        console.log(`Row ${row.index}: ${row.values.description}`);
      });
    });
  ```

  ```python Python theme={null}
  import requests

  def get_table_rows(extraction_id, table_key, offset, limit, filter_type="all"):
      url = f"https://api.tableflow.com/v2/extractions/{extraction_id}/tables/{table_key}/rows"
      headers = {
          "Authorization": "Bearer YOUR_API_KEY"
      }
      params = {
          "offset": offset,
          "limit": limit,
          "filter": filter_type
      }
      
      response = requests.get(url, headers=headers, params=params)
      response.raise_for_status()  # Raise exception for 4XX/5XX responses
      
      return response.json()

  # Example usage
  try:
      result = get_table_rows("uT2bJNWN75YPU95r", "line_items", 0, 100)
      print(f"Fetched {len(result['rows'])} rows out of {result['pagination']['total']}")
      
      # Process the rows
      for row in result['rows']:
          print(f"Row {row['index']}: {row['values']['description']}")
          
  except requests.exceptions.HTTPError as e:
      print(f"Error fetching table rows: {e}")
  ```
</RequestExample>

## Response

<ResponseField name="pagination" type="object">
  Pagination information.

  <Expandable title="pagination">
    <ResponseField name="offset" type="integer">
      Current offset.
    </ResponseField>

    <ResponseField name="limit" type="integer">
      Current limit.
    </ResponseField>

    <ResponseField name="total" type="integer">
      Total number of rows in the table.
    </ResponseField>

    <ResponseField name="next_offset" type="integer">
      Offset for the next page of results. Will be null on the last page.
    </ResponseField>

    <ResponseField name="filter" type="string">
      The applied filter (e.g., "all", "valid", "invalid", "error").
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="rows" type="array">
  Array of table rows.

  <Expandable title="rows">
    <ResponseField name="index" type="integer">
      The row index (0-based).
    </ResponseField>

    <ResponseField name="values" type="object">
      Map of column keys to their cell values.

      <Expandable title="values">
        <ResponseField name="{column_key}" type="string">
          The value of this cell.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="validations" type="object">
      Map of column keys to arrays of validation issues.

      <Expandable title="validations">
        <ResponseField name="{column_key}" type="array">
          Array of validation issues for the cell.

          <Expandable title="validation">
            <ResponseField name="validate" type="string">
              The validation that failed.
            </ResponseField>

            <ResponseField name="severity" type="string">
              Severity of the validation issue ("error", "warn", "info").
            </ResponseField>

            <ResponseField name="message" type="string">
              Error message describing the validation issue.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "pagination": {
      "offset": 0,
      "limit": 100,
      "total": 3,
      "next_offset": null,
      "filter": "all"
    },
    "rows": [
      {
        "index": 0,
        "values": {
          "description": "Ergonomic Office Chair",
          "quantity": "1",
          "unit_price": "249.99",
          "amount": "249.99"
        },
        "validations": {}
      },
      {
        "index": 1,
        "values": {
          "description": "Wireless Keyboard",
          "quantity": "2",
          "unit_price": "59.95",
          "amount": "119.90"
        },
        "validations": {}
      },
      {
        "index": 2,
        "values": {
          "description": "27-inch Monitor",
          "quantity": "2",
          "unit_price": "329.99",
          "amount": "659.98"
        },
        "validations": {}
      }
    ]
  }
  ```
</ResponseExample>

## Error Responses

<ResponseField name="error" type="string">
  Error message describing what went wrong.
</ResponseField>

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "error": "The parameter 'filter' contains invalid value: unknown"
  }
  ```
</ResponseExample>
