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

# 快速开始

> 5 分钟内完成你的第一次 Endfield API 调用。

## 1. 获取 API Key

获取 API Key 用于接口请求认证

<Steps>
  <Step title="注册账号">
    前往 [协议终端](https://end.shallow.ink/login) 注册并登录。
  </Step>

  <Step title="创建 API Key">
    进入 [开发者 → API 密钥](https://end.shallow.ink/dashboard/developer/apikeys) 页面，点击「创建密钥」。
  </Step>

  <Step title="保存密钥">
    复制生成的 API Key（格式：`ef_xxxxxxxxxxxx`）。

    <Warning>
      API Key 请勿泄露，避免无故滥用。
    </Warning>
  </Step>
</Steps>

## 2. 发送第一个请求

使用你的凭证调用健康检查接口，验证连接：

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  curl https://api.end.shallow.ink/health
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  const response = await fetch('https://api.end.shallow.ink/health');
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  import requests

  response = requests.get('https://api.end.shallow.ink/health')
  print(response.json())
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  resp, err := http.Get("https://api.end.shallow.ink/health")
  ```
</CodeGroup>

响应：

```json theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
{
  "code": 0,
  "message": "成功",
  "data": {
    "status": "healthy",
    "timestamp": "2026-01-26T14:00:00+08:00",
    "uptime": 123.45,
    "memory": {
      "alloc_mb": 5,
      "total_alloc_mb": 10,
      "sys_mb": 15
    },
    "runtime": {
      "version": "go1.21.0",
      "goroutines": 10,
      "os": "windows",
      "arch": "amd64"
    }
  }
}
```

## 3. 查询 Wiki 数据

使用认证凭证查询游戏百科数据：

<CodeGroup>
  ```bash Curl theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  curl https://api.end.shallow.ink/api/wiki/categories \
    -H "X-API-Key: your_api_key"
  ```
</CodeGroup>

## 4. 查询游戏数据（需要 Framework Token）

游戏数据查询需要额外的 **Framework Token**（通过森空岛登录获取）：

```bash theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
curl https://api.end.shallow.ink/api/endfield/user \
  -H "X-API-Key: your_api_key" \
  -H "X-Framework-Token: your_framework_token"
```

<Note>
  Framework Token 是游戏数据查询凭证，通过扫码登录或手机登录获取。接口认证（API Key / JWT / Anonymous Token）和游戏数据凭证（Framework Token）是独立的两层。
</Note>

## 下一步

<CardGroup cols={2}>
  <Card title="凭证体系" icon="shield" href="/concepts/credentials">
    分清楚接口凭证和游戏数据凭证。
  </Card>

  <Card title="API 参考" icon="file-json" href="/api-reference">
    查看完整的 API 端点列表和交互式文档。
  </Card>

  <Card title="错误码" icon="circle-x" href="/concepts/error-codes">
    了解所有可能的错误码及其含义。
  </Card>

  <Card title="速率限制" icon="gauge" href="/concepts/rate-limiting">
    了解不同计划的配额和限流规则。
  </Card>
</CardGroup>
