# 내 알림

Bark·위챗 워크 등 채널이 받는 것과 같은 푸시(웹 설정으로 필터링).

> Source: https://tokenearly.com/ko/developers/rest/alerts · Docs index: https://tokenearly.com/ko/developers/llms.txt · OpenAPI: https://api.tokenearly.com/v1/openapi.json

`GET https://api.tokenearly.com/v1/alerts`

내 알림 스트림: 웹에서 설정한 소스 스위치, 키워드, 알림 언어(원문 먼저, 번역은 추가 전송), 플랜 지연을 거친 뒤 실제로 보내지는 푸시로, Bark·위챗 워크가 받는 것과 같습니다. 토픽 이벤트(`GET /v1/events`)와는 다른 데이터입니다. [내 알림 스트림](https://tokenearly.com/ko/developers/my-alerts) 참고. 먼저 웹의 전역 알림 관리 → 알림 채널에서 「개발자 API」 스위치를 켜야 새 내 알림이 생성되며, 응답의 `channel_enabled`가 스위치 상태입니다. 기본은 최신순이며 `before`로 페이지를 넘기고, 끊긴 뒤에는 `after=<마지막 알림 id>`로 오래된 순으로 따라잡습니다. 최근 7일분을 보관합니다.

**API 키 필요**

## 파라미터

| 파라미터 | 위치 | 타입 | 필수 | 설명 |
|---|---|---|---|---|
| `after` | query | string |  | 이 내 알림 이후의 것만 오래된 순으로(따라잡기용). |
| `before` | query | string |  | 이 내 알림 이전의 것만 최신순으로(페이지용). |
| `limit` | query | integer |  | 최대 개수 1–200, 기본 50. |

## 요청 예시

**cURL**

```bash
curl "https://api.tokenearly.com/v1/alerts?limit=5" \
  -H "Authorization: Bearer $TOKENEARLY_API_KEY"
```

**Python**

```python
import os, requests

resp = requests.get(
    "https://api.tokenearly.com/v1/alerts?limit=5",
    headers={"Authorization": f"Bearer {os.environ['TOKENEARLY_API_KEY']}"},
    timeout=10,
)
resp.raise_for_status()
print(resp.json())
```

**Node.js**

```javascript
// Node 18+ (built-in fetch)
async function main() {
  const resp = await fetch("https://api.tokenearly.com/v1/alerts?limit=5", {
    headers: { Authorization: `Bearer ${process.env.TOKENEARLY_API_KEY}` },
  });
  const body = await resp.json();
  if (!resp.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
  console.log(body);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.tokenearly.com/v1/alerts?limit=5", nil)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("TOKENEARLY_API_KEY"))
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.Status, string(body))
}
```

## 응답 예시

```json
{
  "alerts": [
    {
      "id": "6af57203e1b0c95f3a7d2e47",
      "category": "announcement",
      "source": {
        "id": "binance",
        "name": "Binance"
      },
      "followup": true,
      "lang": "zh",
      "label": "translation",
      "title": "【币安(BINANCE)】",
      "text": "【译文】\n币安将上线 Fooken (FOO) 并添加种子标签\n— — — — — — — — — —\nhttps://www.binance.com/zh-CN/support/announcement/detail/abc123\n— — — — — — — — — —\n2026-11-12 16:00:00 (UTC+8)",
      "url": "https://www.binance.com/zh-CN/support/announcement/detail/abc123",
      "titles": {
        "en": "Binance Will List Fooken (FOO) with Seed Tag Applied",
        "zh": "币安将上线 Fooken (FOO) 并添加种子标签",
        "ko": "바이낸스, 시드 태그가 적용된 Fooken(FOO) 상장"
      },
      "ref": {
        "type": "announcement",
        "topic": "announcement.binance",
        "event_id": "6af57200e1b0c95f3a7d2e40"
      },
      "created_at": 1794470403
    },
    {
      "id": "6af57201e1b0c95f3a7d2e41",
      "category": "announcement",
      "source": {
        "id": "binance",
        "name": "Binance"
      },
      "followup": false,
      "lang": "en",
      "label": "original",
      "title": "【币安(BINANCE)】",
      "text": "【原文·英文】\nBinance Will List Fooken (FOO) with Seed Tag Applied\n— — — — — — — — — —\nhttps://www.binance.com/en/support/announcement/detail/abc123\n— — — — — — — — — —\n2026-11-12 16:00:00 (UTC+8)",
      "url": "https://www.binance.com/en/support/announcement/detail/abc123",
      "titles": {
        "en": "Binance Will List Fooken (FOO) with Seed Tag Applied"
      },
      "ref": {
        "type": "announcement",
        "topic": "announcement.binance",
        "event_id": "6af57200e1b0c95f3a7d2e40"
      },
      "created_at": 1794470401
    }
  ],
  "has_more": true,
  "next_cursor": "6af57201e1b0c95f3a7d2e41",
  "cursor_param": "before",
  "channel_enabled": true
}
```

## 오류

| 코드 | HTTP | 설명 |
|---|---|---|
| `missing_api_key` | 401 | 키가 없습니다. `Authorization: Bearer <키>`를 쓰세요. |
| `invalid_api_key` | 401 | 키가 없거나 재설정 또는 폐기되었습니다. |
| `key_expired` | 401 | 체험 키가 만료되었습니다. 새 체험 키를 신청하거나 구독 후 정식 키를 만드세요. |
| `plan_required` | 403 | 현재 플랜에 개발자 API(또는 해당 기능)가 없습니다. |
| `ip_not_allowed` | 403 | 키에 IP 허용 목록이 설정되어 있고 요청 IP가 목록에 없습니다. |
| `invalid_cursor` | 400 | after / before가 올바른 ID가 아니거나(이벤트는 이벤트 ID, 내 알림은 내 알림 ID) 둘 다 보냈거나, (이벤트만) updated_after와 before를 함께 썼습니다. |
| `invalid_parameter` | 400 | 파라미터 타입이나 값이 잘못되었습니다(예: limit 범위 초과). |
| `rate_limited` | 429 | 이 키의 요청 빈도를 넘었습니다(REST와 MCP 합산, 간격은 `/v1/me`의 `limits.rest_interval_seconds`). Retry-After 초만큼 기다린 뒤 다시 시도하세요. |
