# 印度尼西亚地震资讯对外 API

该接口用于向外部单位输出印度尼西亚地震监测数据，包括 AI 行动简报、相关新闻和 USGS 区域地震事件。后台每 30 分钟自动更新一次数据。

## Endpoint

```http
GET https://resqai.org/api/indonesia_earthquake_export.php
```

## Query Parameters

| 参数 | 默认值 | 说明 |
| --- | --- | --- |
| `lang` | `zh` | 输出语言。支持 `zh`, `en`, `id`, `es`, `pt`, `fr`, `ru`, `ar`。非中文会调用 DeepSeek 翻译并使用缓存。 |
| `limit` | `20` | 新闻条数，范围 `1-50`。 |
| `include` | `all` | 输出模块。支持 `all`, `brief`, `news`, `earthquakes`，也可逗号组合，如 `brief,news`。 |

## Examples

中文完整输出：

```http
GET https://resqai.org/api/indonesia_earthquake_export.php?lang=zh&limit=20&include=all
```

英文新闻和 AI 简报：

```http
GET https://resqai.org/api/indonesia_earthquake_export.php?lang=en&limit=10&include=brief,news
```

Bahasa Indonesia 完整输出：

```http
GET https://resqai.org/api/indonesia_earthquake_export.php?lang=id&limit=20&include=all
```

只输出震情事件：

```http
GET https://resqai.org/api/indonesia_earthquake_export.php?include=earthquakes
```

## Response Shape

```json
{
  "success": true,
  "data": {
    "meta": {
      "api_version": "1.0",
      "language": "zh",
      "language_name": "简体中文",
      "generated_at": "2026-08-15T00:30:00+00:00",
      "served_at": "2026-08-15T00:35:00+00:00",
      "source_brief_id": 1,
      "window_days": 30,
      "update_frequency": "*/30 * * * *",
      "update_frequency_text": "后台每30分钟抓取新闻、震情并生成AI简报",
      "translation_cached": true
    },
    "country": {
      "code": "ID",
      "name": "Indonesia",
      "name_zh": "印度尼西亚",
      "timezone": "Asia/Makassar"
    },
    "sources": {
      "news": "World News API + GDACS EMM",
      "seismic": "USGS Earthquake Hazards Program",
      "analysis": "DeepSeek"
    },
    "brief": {
      "risk_level": "高",
      "overview": "...",
      "key_points": [],
      "rescue_actions": [],
      "watch_items": []
    },
    "news": {
      "count": 20,
      "limit": 20,
      "items": [
        {
          "id": "...",
          "title": "...",
          "summary": "...",
          "title_original": "...",
          "summary_original": "...",
          "source_language": "id",
          "source_country": "id",
          "source_name": "GDACS EMM",
          "image": "https://resqai-1256073586.cos.ap-beijing.myqcloud.com/...",
          "image_original": "https://...",
          "url": "https://...",
          "published_at": {
            "raw": "2026-08-15 08:20:00",
            "utc": "2026-08-15T00:20:00+00:00",
            "china": "2026-08-15T08:20:00+08:00",
            "indonesia": "2026-08-15T08:20:00+08:00",
            "assumed_source_timezone": "Asia/Shanghai"
          }
        }
      ]
    },
    "earthquakes": {
      "count": 15,
      "items": [
        {
          "id": "us7000abcd",
          "magnitude": 7.7,
          "place": "Flores region, Indonesia",
          "url": "https://earthquake.usgs.gov/...",
          "longitude": 122.1,
          "latitude": -8.5,
          "depth_km": 20,
          "alert": "red",
          "status": "reviewed",
          "event_time": {
            "utc": "2026-08-15T00:10:00+00:00",
            "china": "2026-08-15T08:10:00+08:00",
            "indonesia": "2026-08-15T08:10:00+08:00"
          }
        }
      ]
    }
  }
}
```

## Field Notes

- `country.code` 为印度尼西亚国家代码 `ID`，`country.name` 为 `Indonesia`，`country.name_zh` 为 `印度尼西亚`。
- 印度尼西亚本地时间使用 `Asia/Makassar`，即 UTC `+08:00`，页面标记为“印尼中部”。
- `brief` 为 AI 生成的中文行动简报；多语言请求会翻译该模块。
- `news` 来源为 World News API 与 GDACS EMM；重点监测 GDACS 红色警报 M7.7 事件 `1558059`（Flores / East Nusa Tenggara）。
- `news.items[].image` 优先返回腾讯云 COS 镜像地址；`image_original` 保留原始新闻图片地址。
- `earthquakes.items[].event_time.utc` 来自 USGS 事件时间，`event_time.indonesia` 为 `Asia/Makassar` 当地时间。
- `include=earthquakes` 可用于只拉取 USGS 震情事件，降低响应体大小。

## Update Frequency

后台任务每 30 分钟更新一次数据库数据。新闻来源为 World News API + GDACS EMM，震情来源为 USGS Earthquake Hazards Program，AI 简报由 DeepSeek 生成。

外部系统建议每 5-30 分钟轮询一次。非中文请求会触发翻译或读取翻译缓存，不建议高频轮询多语言接口。中文接口可按业务需要更频繁读取，但建议保留本地缓存。

## Related Internal Page

```http
https://resqai.org/indonesia-earthquake/
```