---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://appmetrica.yandex.com/docs/en/mobile-api/index.md
  - https://appmetrica.yandex.com/docs/ru/mobile-api/index.md
  - https://appmetrica.yandex.com/docs/zh/mobile-api/index.md
  - href: https://appmetrica.yandex.com/docs/zh/mobile-api/index.md
    type: text/markdown
    title: Markdown version
  - href: https://appmetrica.yandex.com/docs/zh/llms.txt?revision=r21744630
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.com/docs/zh/llms.txt?revision=r21744630

# 简介

您可以使用 [AppMetrica](https://appmetrica.yandex.com) API 来：

- 在不使用网页界面情况下管理您的应用。
- 获取应用统计数据（用户数、设备数等）。
- 生成报告，包括分段报告。

要访问 AppMetrica API，必须 [使用 OAuth 令牌进行授权](https://appmetrica.yandex.com/docs/zh/mobile-api/intro/authorization.md)。 您必须在每次 API 请求中传递访问令牌。

为了展示 API 的功能，参考指南提供了访问服务的示例。 示例中的方法会返回样本数据，所有用户都可以查看。

## API结构 {#structure}

API 包含以下部分：

- 用于添加、编辑和删除应用的[管理 API](https://appmetrica.yandex.com/docs/zh/mobile-api/management/intro.md)
- 用于获取应用统计数据的[报告 API](https://appmetrica.yandex.com/docs/zh/mobile-api/stat/intro.md)
- The [日志 API](https://appmetrica.yandex.com/docs/zh/mobile-api/logs/about.md) 用于获取您应用的原始数据。
- 用于导出数据为 CSV 或 JSON 文件的 [数据流 API](https://appmetrica.yandex.com/docs/zh/mobile-api/datastream/about.md)
- [上传事件信息的 Post API](https://appmetrica.yandex.com/docs/zh/mobile-api/post/about.md)
- 用于创建推送营销的[推送 API](https://appmetrica.yandex.com/docs/zh/mobile-api/push/about.md)

## Versioning {#version}

所有 AppMetrica API 的部分都支持版本控制。 每个版本都有特定的标识符（v1、v2 等）。 当发布API的新版本时，前一个版本仍会继续运行以支持向后兼容。

如果您刚开始使用 API，请使用最新版本。 如果您已经使用了API的旧版本，我们建议逐步迁移到最新版本，因为旧版本的支持时间有限。

在发出API请求时，请始终指定您要使用的版本。

```
https://api.appmetrica.yandex.com/stat/v1/data?id=...
https://api.appmetrica.yandex.com/stat/v2/data?id=...
```

## Resources {#recource}

The AppMetrica API 基于 REST 原则构建。

通过API可以管理的所有内容都以资源的形式表示：统计数据、计数器列表、计数器本身、计数器目标和每个具体目标、计数器访问权限等。

所以资源是系统的一个重要组成部分，您可以与之进行操作：

- 读取资源的内容和当前状态（GET）。
- 修改内容和状态，并将其写入资源（PUT）。
- 删除资源（DELETE）。
- 执行特殊操作，例如向列表中添加新元素（POST）。

每个资源都有其独特的 URL。 所有操作均通过资源 URL 对应的 HTTP 方法执行。

### 另请参见 {#see-also}

- [表示状态传输（维基百科，英文版）](http://en.wikipedia.org/wiki/Representational_State_Transfer)
- [REST（维基百科，俄语版本）](http://ru.wikipedia.org/wiki/REST)

<!-- source: zh/_includes/feedback-button.md -->
如果您没有找到所需答案，可以通过反馈表单提交您的问题。 请尽可能详细地描述问题。 如果可能，请附上截图。

<a href="../troubleshooting/feedback-new">
  <span class="button">联系支持</span>
</a>

<a href="../troubleshooting/feedback-docs">
  <span class="button">为文档提出改进建议</span>
</a>
<!-- endsource: zh/_includes/feedback-button.md -->
