> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://humanloop.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://humanloop.com/docs/_mcp/server.

# List Datapoints

GET https://api.humanloop.com/v5/datasets/{id}/datapoints

List all Datapoints for the Dataset with the given ID.

Reference: https://humanloop.com/docs/api/datasets/list-datapoints

## Authentication

- `X-API-KEY` header (required) — API Key authentication via header

## Request

### Path parameters

- `id` (string, required) — Unique identifier for Dataset.

### Query parameters

- `version_id` (string, optional) — A specific Version ID of the Dataset to retrieve.
- `environment` (string, optional) — Name of the Environment to retrieve a deployed Version from.
- `page` (integer, optional, default: 1) — Page number for pagination.
- `size` (integer, optional, default: 50) — Page size for pagination. Number of Datapoints to fetch.

## Response

### 200

Successful Response

- `records` (list of DatapointResponse, required)
- `page` (integer, required)
- `size` (integer, required)
- `total` (integer, required)

## Errors

### 422 List Datapoints Datasets ID Datapoints Get Request Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### DatapointResponse

- `id` (string, required) — Unique identifier for the Datapoint. Starts with `dp_`.
- `inputs` (map from string to string, optional) — The inputs to the prompt template.
- `messages` (list of ChatMessage, optional) — List of chat messages to provide to the model.
- `target` (map from string to DatapointResponseTargetValue, optional) — Object with criteria necessary to evaluate generations with this Datapoint. This is passed in as an argument to Evaluators when used in an Evaluation.

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ChatMessage

- `role` (enum, required) — Role of the message author.
  - Allowed values: `user`, `assistant`, `system`, `tool`, `developer`
- `content` (ChatMessageContent, optional) — The content of the message.
- `name` (string, optional) — Optional name of the message author.
- `tool_call_id` (string, optional) — Tool call that this message is responding to.
- `tool_calls` (list of ToolCall, optional) — A list of tool calls requested by the assistant.
- `thinking` (list of ChatMessageThinkingItem, optional) — Model's chain-of-thought for providing the response. Present on assistant messages if model supports it.

### DatapointResponseTargetValue

### ValidationErrorLocItem

### ChatMessageContent

The content of the message.

### ToolCall

A tool call to be made.

- `id` (string, required)
- `type` ("function", required) — The type of tool to call.
- `function` (FunctionTool, required) — A function tool to be called by the model where user owns runtime.

### ChatMessageThinkingItem

### FunctionTool

A function tool to be called by the model where user owns runtime.

- `name` (string, required)
- `arguments` (string, optional)

### AnthropicThinkingContent

- `type` ("thinking", required)
- `thinking` (string, required) — Model's chain-of-thought for providing the response.
- `signature` (string, required) — Cryptographic signature that verifies the thinking block was generated by Anthropic.

### AnthropicRedactedThinkingContent

- `type` ("redacted_thinking", required)
- `data` (string, required) — Thinking block Anthropic redacted for safety reasons. User is expected to pass the block back to Anthropic

## Examples

**Response**

```json
{
  "records": [
    {
      "id": "dp_901stu",
      "messages": [
        {
          "role": "user",
          "content": "What is the capital of France?"
        }
      ],
      "target": {
        "answer": "Paris"
      }
    },
    {
      "id": "dp_234vwx",
      "messages": [
        {
          "role": "user",
          "content": "Who wrote Hamlet?"
        }
      ],
      "target": {
        "answer": "William Shakespeare"
      }
    }
  ],
  "page": 1,
  "size": 10,
  "total": 2
}
```

**SDK Code**

```python List datapoints
import requests

url = "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints"

querystring = {"size":"1"}

headers = {"X-API-KEY": "<apiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```typescript List datapoints
import { HumanloopClient } from "humanloop";

const client = new HumanloopClient({ apiKey: "YOUR_API_KEY" });
const response = await client.datasets.listDatapoints("ds_b0baF1ca7652", {
    size: 1
});
for await (const item of response) {
    console.log(item);
}

// Or you can manually iterate page-by-page
const page = await client.datasets.listDatapoints("ds_b0baF1ca7652", {
    size: 1
});
while (page.hasNextPage()) {
    page = page.getNextPage();
}

```

```go List datapoints
package main

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

func main() {

	url := "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1"

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

	req.Header.Add("X-API-KEY", "<apiKey>")

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

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

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

}
```

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

url = URI("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1")

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

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<apiKey>'

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

```java List datapoints
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1")
  .header("X-API-KEY", "<apiKey>")
  .asString();
```

```php List datapoints
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1', [
  'headers' => [
    'X-API-KEY' => '<apiKey>',
  ],
]);

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

```csharp List datapoints
using RestSharp;

var client = new RestClient("https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1");
var request = new RestRequest(Method.GET);
request.AddHeader("X-API-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift List datapoints
import Foundation

let headers = ["X-API-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.humanloop.com/v5/datasets/ds_b0baF1ca7652/datapoints?size=1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```