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

# get_records_json

### get\_records\_json

<ul>
  <li>
    get\_records\_json(\
    &#x20;table\_name: string,\
    &#x20;column\_names?: string\[] | null,\
    &#x20;offset?: number,\
    &#x20;limit?: number,\
    &#x20;expression?: string | null,\
    &#x20;orderby\_columns?: string\[] | null,\
    &#x20;having\_clause?: string | null,\
    &#x20;callback?: [GPUdbCallback](https://docs.kinetica.com/content/api/nodejs/types/GPUdbCallback.md),\
    ): Promise\<[GetRecordsJsonResponse](https://docs.kinetica.com/content/api/nodejs/interfaces/GetRecordsJsonResponse.md)>

    Retrieves records as JSON, via `/get/records/json`.Only `table_name` is required; every other parameter is optional. Like `insert_records_from_json`, this endpoint takes its parameters in the query string and is sent with an empty body.

    #### Parameters

    <ul>
      <li>
        table\_name: string

        Table to read from
      </li>

      <li>
        `Optional`column\_names: string\[] | null

        Columns to return; all columns if omitted
      </li>

      <li>
        `Optional`offset: number

        Record offset; negative values are treated as 0
      </li>

      <li>
        `Optional`limit: number

        Maximum records; negative values mean END\_OF\_SET
      </li>

      <li>
        `Optional`expression: string | null

        Optional filter expression
      </li>

      <li>
        `Optional`orderby\_columns: string\[] | null

        Optional ordering columns
      </li>

      <li>
        `Optional`having\_clause: string | null

        Optional HAVING clause
      </li>

      <li>
        `Optional`callback: [GPUdbCallback](https://docs.kinetica.com/content/api/nodejs/types/GPUdbCallback.md)

        Optional callback function
      </li>
    </ul>

    #### Returns Promise\<[GetRecordsJsonResponse](https://docs.kinetica.com/content/api/nodejs/interfaces/GetRecordsJsonResponse.md)>

    Promise resolving to the matching records

    #### Example

    ```
    const response = await gpudb.get_records_json(
        'my_table', ['id', 'name'], 0, 100, 'value > 10', ['id'], '');
    response.records;                  // [{ id: 3, name: 'Charlie' }, ...]
    response.total_number_of_records;  // matches ignoring the limit
    ```

    <ul>
      <li>Defined in [src/GPUdb.ts:16271](https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L16271)</li>
    </ul>
  </li>
</ul>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.