# Get dataset items

GET http://localhost:5173/api/v1/private/datasets/{id}/items

Get dataset items

Reference: https://www.comet.com/docs/opik/reference/rest-api/datasets/get-dataset-items

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: Get dataset items
  version: endpoint_datasets.getDatasetItems
paths:
  /v1/private/datasets/{id}/items:
    get:
      operationId: get-dataset-items
      summary: Get dataset items
      description: Get dataset items
      tags:
        - - subpackage_datasets
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
        - name: size
          in: query
          required: false
          schema:
            type: integer
            default: 10
        - name: version
          in: query
          required: false
          schema:
            type: string
        - name: filters
          in: query
          required: false
          schema:
            type: string
        - name: truncate
          in: query
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Dataset items resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetItemPage_Public'
components:
  schemas:
    DatasetItemPublicSource:
      type: string
      enum:
        - value: manual
        - value: trace
        - value: span
        - value: sdk
    JsonNode:
      type: object
      properties: {}
    ExperimentItemPublicTraceVisibilityMode:
      type: string
      enum:
        - value: default
        - value: hidden
    ExperimentItem_Public:
      type: object
      properties:
        id:
          type: string
          format: uuid
        experiment_id:
          type: string
          format: uuid
        dataset_item_id:
          type: string
          format: uuid
        trace_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        last_updated_at:
          type: string
          format: date-time
        created_by:
          type: string
        last_updated_by:
          type: string
        trace_visibility_mode:
          $ref: '#/components/schemas/ExperimentItemPublicTraceVisibilityMode'
      required:
        - experiment_id
        - dataset_item_id
        - trace_id
    DatasetItem_Public:
      type: object
      properties:
        id:
          type: string
          format: uuid
        dataset_item_id:
          type: string
          format: uuid
        trace_id:
          type: string
          format: uuid
        span_id:
          type: string
          format: uuid
        source:
          $ref: '#/components/schemas/DatasetItemPublicSource'
        data:
          $ref: '#/components/schemas/JsonNode'
        tags:
          type: array
          items:
            type: string
        experiment_items:
          type: array
          items:
            $ref: '#/components/schemas/ExperimentItem_Public'
        dataset_id:
          type: string
          format: uuid
        created_at:
          type: string
          format: date-time
        last_updated_at:
          type: string
          format: date-time
        created_by:
          type: string
        last_updated_by:
          type: string
      required:
        - source
        - data
    ColumnPublicTypesItems:
      type: string
      enum:
        - value: string
        - value: number
        - value: object
        - value: boolean
        - value: array
        - value: 'null'
    Column_Public:
      type: object
      properties:
        name:
          type: string
        types:
          type: array
          items:
            $ref: '#/components/schemas/ColumnPublicTypesItems'
        filter_field_prefix:
          type: string
        filterField:
          type: string
          description: The field to use for filtering
    DatasetItemPage_Public:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/DatasetItem_Public'
        page:
          type: integer
        size:
          type: integer
        total:
          type: integer
          format: int64
        columns:
          type: array
          items:
            $ref: '#/components/schemas/Column_Public'
        sortableBy:
          type: array
          items:
            type: string

```

## SDK Code Examples

```python
import requests

url = "http://localhost:5173/api/v1/private/datasets/id/items"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'http://localhost:5173/api/v1/private/datasets/id/items';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:5173/api/v1/private/datasets/id/items"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:5173/api/v1/private/datasets/id/items")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
HttpResponse<String> response = Unirest.get("http://localhost:5173/api/v1/private/datasets/id/items")
  .asString();
```

```php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:5173/api/v1/private/datasets/id/items');

echo $response->getBody();
```

```csharp
var client = new RestClient("http://localhost:5173/api/v1/private/datasets/id/items");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:5173/api/v1/private/datasets/id/items")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```