# Find datasets

GET http://localhost:5173/api/v1/private/datasets

Find datasets

Reference: https://www.comet.com/docs/opik/reference/rest-api/datasets/find-datasets

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: Find datasets
  version: endpoint_datasets.findDatasets
paths:
  /v1/private/datasets:
    get:
      operationId: find-datasets
      summary: Find datasets
      description: Find datasets
      tags:
        - - subpackage_datasets
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
        - name: size
          in: query
          required: false
          schema:
            type: integer
            default: 10
        - name: with_experiments_only
          in: query
          required: false
          schema:
            type: boolean
        - name: with_optimizations_only
          in: query
          required: false
          schema:
            type: boolean
        - name: prompt_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: name
          in: query
          required: false
          schema:
            type: string
        - name: sorting
          in: query
          required: false
          schema:
            type: string
        - name: filters
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Dataset resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetPage_Public'
components:
  schemas:
    DatasetPublicVisibility:
      type: string
      enum:
        - value: private
        - value: public
    DatasetPublicStatus:
      type: string
      enum:
        - value: unknown
        - value: processing
        - value: completed
        - value: failed
    DatasetVersionSummary_Public:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the version
        version_hash:
          type: string
          description: Hash of the version content
        version_name:
          type: string
          description: Sequential version name formatted as 'v1', 'v2', etc.
        change_description:
          type: string
          description: Description of changes in this version
        tags:
          type: array
          items:
            type: string
          description: Tags associated with this version
    Dataset_Public:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        visibility:
          $ref: '#/components/schemas/DatasetPublicVisibility'
        tags:
          type: array
          items:
            type: string
        description:
          type: string
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
        last_updated_at:
          type: string
          format: date-time
        last_updated_by:
          type: string
        experiment_count:
          type: integer
          format: int64
        dataset_items_count:
          type: integer
          format: int64
        optimization_count:
          type: integer
          format: int64
        most_recent_experiment_at:
          type: string
          format: date-time
        last_created_experiment_at:
          type: string
          format: date-time
        most_recent_optimization_at:
          type: string
          format: date-time
        last_created_optimization_at:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/DatasetPublicStatus'
        latest_version:
          $ref: '#/components/schemas/DatasetVersionSummary_Public'
      required:
        - name
    DatasetPage_Public:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Dataset_Public'
        page:
          type: integer
        size:
          type: integer
        total:
          type: integer
          format: int64
        sortableBy:
          type: array
          items:
            type: string

```

## SDK Code Examples

```python
import requests

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

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'http://localhost:5173/api/v1/private/datasets';
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"

	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")

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")
  .asString();
```

```php
<?php

$client = new \GuzzleHttp\Client();

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

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

```csharp
var client = new RestClient("http://localhost:5173/api/v1/private/datasets");
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")! 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()
```