이더.dev REST API
외부에서 블로그 글을 발행하고 조회할 수 있는 REST API. Bearer token 인증으로 쓰기 작업을 보호하며, 읽기는 누구나 가능합니다.
https://radarlog.krEndpoints
POST
/api/v1/posts AuthGET
/api/v1/postsGET
/api/v1/posts/:id인증 (Authentication)
쓰기 API(POST)는 API Key 인증이 필요합니다. 관리자 페이지(/admin/settings)에서 발급받을 수 있습니다.
Authorization: Bearer YOUR_API_KEY글 발행
POST/api/v1/postsRequest Body
{
"title": "글 제목",
"content": "마크다운 본문",
"category": "articles",
"tags": ["태그1", "태그2"],
"published": true
}필수 필드
| Field | Type | Description |
|---|---|---|
title | string | 글 제목 |
content | string | 마크다운 본문 |
category | string | commits articles techlab casual |
선택 필드
| Field | Type | Description |
|---|---|---|
slug | string | URL 슬러그 (미지정 시 제목에서 자동 생성) |
subtitle | string | 부제목 |
excerpt | string | 요약문 (미지정 시 본문 앞 200자) |
coverImage | string | 커버 이미지 URL |
published | boolean | 발행 여부 (기본 false) |
tags | string[] | 태그 배열 |
repoName | string | GitHub 레포 이름 |
commitHash | string | 커밋 해시 |
commitUrl | string | 커밋 URL |
filesChanged | number | 변경된 파일 수 |
Response
{
"success": true,
"data": {
"id": "clxxx...",
"slug": "글-제목",
"title": "글 제목",
"published": true,
"createdAt": "2026-03-10T..."
}
}{
"success": false,
"error": "Invalid API key"
}글 목록 조회
GET/api/v1/posts인증 없이 누구나 조회 가능합니다.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
category | string | 카테고리 필터 |
tag | string | 태그 필터 |
published | boolean | 발행 상태 필터 |
page | number | 페이지 번호 (기본 1) |
limit | number | 페이지당 개수 (기본 20, 최대 100) |
Response
{
"success": true,
"data": [ ... ],
"meta": {
"page": 1,
"limit": 20,
"total": 42,
"totalPages": 3
}
}curl 예시
curl -X POST https://radarlog.kr/api/v1/posts \
-H "Authorization: Bearer sk-abc123..." \
-H "Content-Type: application/json" \
-d '{
"title": "테스트 글",
"content": "## 제목\n본문 내용입니다.",
"category": "articles",
"tags": ["test"],
"published": true
}'GitHub Webhook
API를 직접 호출하지 않아도, GitHub 레포에 push하면 AI가 자동으로 블로그 글을 생성합니다.
1. /admin/settings에서 GitHub 레포 등록
2. GitHub 레포 → Settings → Webhooks → Add webhook
3. Payload URL: https://radarlog.kr/api/webhooks/github
4. Content type: application/json
5. Secret: GITHUB_WEBHOOK_SECRET 값과 동일하게
6. Events: Just the push event
참고
- 읽기(GET)는 인증 없이 누구나 호출 가능합니다.
- 쓰기(POST)는 반드시 API Key가 필요합니다.
- API Key는 관리자 페이지에서만 발급 가능하며, 발급 후 다시 확인할 수 없습니다.
- 응답 형식:
{ success, data?, error? }