---
title: Get IDs in a Segment
description: This endpoint is rate limited to 100
product: general
token_estimate: 1165
---
# Get IDs in a Segment

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Get IDs in a Segment

**GET** `/console/v1/segments/{id}/id_list`

Full URL: `https://statsigapi.net/console/v1/segments/{id}/id_list`

Get IDs in a Segment

This endpoint is rate limited to 100

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| id (path) | string | Yes | — | — |

## Query parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| limit (query) | integer | No | 10 | Results per page Constraints: string, number |
| page (query) | integer | No | 1 | Page number Constraints: string, number |

## Response (application/json)

**200** — IDs read successfully

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | {"name":"Example List","count":5,"ids":["id1","id2","id3","id4","id5"]} | Schema for a list of IDs with a name and count |
| data.name | string | Yes | Example List | The name associated with the list of IDs |
| data.count | number | Yes | 5 | The count of IDs in the list Constraints: format: double |
| data.ids | string[] | Yes | ["id1","id2","id3","id4","id5"] | The array of IDs |
| pagination | object | Yes | — | Pagination metadata for checking if there is next page for example. |
| pagination.itemsPerPage | number | Yes | — | Constraints: format: double |
| pagination.pageNumber | number | Yes | — | Constraints: format: double |
| pagination.nextPage | string | Yes | — | Constraints: nullable |
| pagination.previousPage | string | Yes | — | Constraints: nullable |
| pagination.totalItems | number | No | — | Constraints: format: double |
| pagination.all | string | No | — | — |

```json
{
  "message": "Segments listed successfully.",
  "data": {
    "name": "small_id_list",
    "count": 3,
    "ids": [
      "1, 2, 3"
    ]
  }
}
```

## Code samples

### cURL

```bash
curl -X GET "https://statsigapi.net/console/v1/segments/{id}/id_list?limit=10&page=1" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://statsigapi.net/console/v1/segments/{id}/id_list?limit=10&page=1",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/segments/{id}/id_list?limit=10&page=1", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/segments/{id}/id_list?limit=10&page=1");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("GET", "https://statsigapi.net/console/v1/segments/{id}/id_list?limit=10&page=1", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/segments/{id}/id_list?limit=10&page=1"))
      .method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/segments/{id}/id_list?limit=10&page=1")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

