# GET /v1/zones/{id}/code

获取广告位嵌入代码

返回广告位的嵌入代码片段。需要权限范围`publisher:read`（API密钥或网页会话）。速率限制等级：`read`。

- 所需权限范围: `publisher:read`
- 速率限制: `read` — 120 次请求/60秒窗口 每个API密钥或网页会话

## 参数

| 名称 | 位置 | 类型 | 必填 |
|---|---|---|---|
| `id` | path | integer | 是 |

## 响应

```
{ direct_url: string | null; loader: string; tag: { adblock_rate: number | null; last_load_at: string | null; last_request_at: string | null; loads_24h: integer; requests_24h: integer; state: "never" | "stale" | "live"; via: "tag" | "smart_link" | "both" | null } }
```

## 错误

有速率限制的路由会返回`RateLimit-Limit`、`RateLimit-Remaining`和`RateLimit-Reset`（距窗口结束的秒数）；429响应还会带有`Retry-After`。限流器暂时不可用时，这些响应头可能缺失（此时请求会被放行）。

| 状态码 | 含义 |
|---|---|
| 401 | API密钥缺失、无效或已被撤销。 |
| 403 | 该密钥缺少所需的权限范围，或该主体无权执行此操作。 |
| 429 | 已超出速率限制；请等待`Retry-After`秒后重试。 |
| 404 | Default Response |

HTML文档: https://agimone.com/zh/developers/api/#get-zone-code
API 2026-10
