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

# 分段玩家计数教程

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

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

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

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

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

<img src="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" alt="Get Segment Player Count" width="1833" height="387" data-path="images/playfab/data-analytics/acting-data/get-segment-player-count.png" />

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


## Related topics

- [导出分段中玩家的教程](/zh-CN/services/playfab/live-service-management/game-configuration/segmentation/segmentation-export-players-in-a-segment.md)
- [实时服务管理概述](/zh-CN/services/playfab/live-service-management/overview.md)
- [针对整个玩家分段的批量操作](/zh-CN/services/playfab/data-analytics/acting-data/action-rules-bulk-actions-for-an-entire-player-segment.md)
- [分段配置](/zh-CN/services/playfab/live-service-management/game-configuration/segmentation/segmentation-configuration.md)
- [玩家分段](/zh-CN/services/playfab/live-service-management/game-configuration/segmentation/segmentation-quickstart.md)
