---
schema_version: "1"
id: fff669f0e5b495e6cf382b338656a0eba4336a9f6acdce79a9e597426e2518b0
title: Get SQL Query Rows
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-query-api-reference/query-services/query-api-v3-get-rows.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-rows.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6e1f3dd3dc96e22927b676193fe32916f3e4ee4ac6c3e72b93a2cfcec09041f5
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# Get SQL Query Rows

Use the `GET /api/v3/query/{queryId}/rows` endpoint of the Data 360 Query API to retrieve results from a completed query using offset-based pagination. Use this endpoint to page through large result sets by specifying an `offset` and optional `limit` or `byteLimit`. Responses are available in JSON or Apache Arrow format.

## Syntax

- **HTTP Method**: GET
- **Format**: REST
- **URI**: `/api/v3/query/{queryId}/rows`

## Path Parameters

| Parameter | Type   | Description                                                                                                                   |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `queryId` | string | Required. The unique identifier of the query returned from `POST /api/v3/query`. Example: `MTAuMjcuMTgxLjE0OTo3NDg0_1cfc8d35`. |

## Query Parameters

| Parameter    | Required | Type    | Description                                                         |
| ------------ | -------- | ------- | ------------------------------------------------------------------- |
| `offset`     | Yes      | integer | Row offset to start from.                                           |
| `limit`      | No       | integer | Maximum number of rows to return.                                   |
| `byteLimit`  | No       | integer | Maximum bytes to return. Default and maximum is 20 MB (`20000000`). |
| `omitSchema` | No       | boolean | `true` to omit schema metadata from the response. Default `false`.  |

## Request Headers

| Header          | Value                                                       |
| --------------- | ----------------------------------------------------------- |
| `Authorization` | `Bearer {accessToken}`                                      |
| `Accept`        | `application/json` or `application/vnd.apache.arrow.stream` |

## Response Structure

| Field          | Description                                                                                         |
| -------------- | --------------------------------------------------------------------------------------------------- |
| `metadata`     | Object containing column schema. Not included when `omitSchema=true`.                               |
| `data`         | Array of result rows, where each row is an array of values ordered by the `metadata.columns` schema. |
| `returnedRows` | Number of rows returned in this response. Arrow responses omit this field.                          |

## Examples

This example shows a row retrieval request and response.

### Request

```http
GET https://{dne_cdpInstanceUrl}/api/v3/query/MTAuMjcuMTgxLjE0OTo3NDg0_1cfc8d35-464c-9185-1f41-3eb638a71f7a/rows?offset=0&limit=100
Authorization: Bearer {accessToken}
```

### Response

```json
{
  "metadata": {
    "columns": [
      { "name": "id__c", "type": "varchar", "nullable": false },
      { "name": "name__c", "type": "varchar", "nullable": true }
    ]
  },
  "data": [
    ["c1ce2a48-9d03-4eed-938d", "Alice Johnson"],
    ["2", "Bob Smith"]
  ],
  "returnedRows": 2
}
```

### Apache Arrow Response

Set `Accept: application/vnd.apache.arrow.stream` to receive results as a binary Arrow IPC stream instead of JSON. Arrow is recommended for large result sets — it reduces payload size and deserialization overhead compared to JSON. The `omitSchema` query parameter has no effect on Arrow responses; the schema is always embedded in the Arrow stream.

## Related Resources

**note:** For large result sets, [Get SQL Query Chunks](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-chunk.md) is the preferred retrieval method.

- [Submit SQL Query](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-post.md)
- [Get SQL Query Status](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-query.md)
- [Get SQL Query Chunks](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/data-cloud-query-api-reference/query-api-v3-get-chunk.md)
- [Query Services Status Codes](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/c360a-api-queryservices-statuscodes.md)
