> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 分段玩家计数教程

> 使用新的 GetSegmentPlayerCount API（预览版）检索 PlayFab 分段的玩家数量，该 API 取代了已弃用的 GetPlayersInSegment 端点。

# 分段玩家计数（预览版）

> [!NOTE]
>
> GetSegmentPlayerCount API 为预览版。随着我们继续收集反馈并针对客户使用进行优化，预计它会持续变化。

本教程将引导你使用新的 GetSegmentPlayerCount API（当前为预览版）获取给定分段的玩家数量。这些 API 与 ExportPlayersInSegment API 和 GetSegmentExport API 一起，完全取代了已弃用的 GetPlayersInSegment API 的功能。若要开始使用导出 API，请遵循此教程：[导出分段中玩家的教程 - PlayFab | Microsoft Learn。](https://docs.xbox.com/zh-CN/services/playfab/live-service-management/game-configuration/segmentation/segmentation-export-players-in-a-segment.md)

向 GetSegmentPlayerCount API 发送一个 POST 请求，其中 payload 为 Segment ID。响应中的 "ProfilesInSegment" 即为该分段的玩家数量。

![Get Segment Player Count](https://mintcdn.com/microsoft-4404708b/IwSYTY5BEqd_x-HK/images/playfab/data-analytics/acting-data/get-segment-player-count.png?fit=max\&auto=format\&n=IwSYTY5BEqd_x-HK\&q=85\&s=6ffdf5b78fa010288319a7538599f230)

> [!NOTE]
>
> 该 API 要求 "X-SecretKey" 标头，其值为 Title Secret key。"Content-Type" 标头应设置为 "application/json"。


## Related topics

- [导出分段中玩家的教程](https://docs.xbox.com/zh-CN/services/playfab/live-service-management/game-configuration/segmentation/segmentation-export-players-in-a-segment.md)
- [实时服务管理概述](https://docs.xbox.com/zh-CN/services/playfab/live-service-management/overview.md)
- [分段配置](https://docs.xbox.com/zh-CN/services/playfab/live-service-management/game-configuration/segmentation/segmentation-configuration.md)
- [玩家分段](https://docs.xbox.com/zh-CN/services/playfab/live-service-management/game-configuration/segmentation/segmentation-quickstart.md)
- [使用 PlayFab 进行玩家进程管理](https://docs.xbox.com/zh-CN/services/playfab/player-progression/player-progression-overview.md)
