Skip to content

Commit bb82914

Browse files
committed
오픈 api link 주기적인 신선도 검사, workflow 및 py 코드 추가
1 parent 7889cb2 commit bb82914

File tree

7 files changed

+2511
-25
lines changed

7 files changed

+2511
-25
lines changed
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
name: "Link Health Check"
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
file_to_check:
7+
description: '검사할 파일'
8+
required: false
9+
default: 'README.md'
10+
type: choice
11+
options:
12+
- 'README.md'
13+
- 'README_EN.md'
14+
- 'both'
15+
16+
schedule:
17+
- cron: '0 9 * * 1'
18+
19+
push:
20+
branches: [ main, master ]
21+
paths:
22+
- 'README.md'
23+
- 'README_EN.md'
24+
25+
jobs:
26+
check_links:
27+
name: "API 링크 상태 검사"
28+
runs-on: ubuntu-latest
29+
30+
strategy:
31+
matrix:
32+
python-version: [3.9]
33+
34+
steps:
35+
- name: 📁 체크아웃
36+
uses: actions/checkout@v4
37+
38+
- name: 🐍 Python 설정
39+
uses: actions/setup-python@v4
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
43+
- name: 📦 의존성 설치
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install aiohttp
47+
48+
- name: 🔍 README.md 링크 검사
49+
id: check_readme
50+
if: github.event.inputs.file_to_check != 'README_EN.md'
51+
run: |
52+
echo "=== 한국어 README 검사 시작 ==="
53+
python scripts/link_health_check.py README.md --save-json --concurrent 25
54+
continue-on-error: true
55+
56+
- name: 🔍 README_EN.md 링크 검사
57+
id: check_readme_en
58+
if: github.event.inputs.file_to_check == 'README_EN.md' || github.event.inputs.file_to_check == 'both'
59+
run: |
60+
echo "=== 영어 README 검사 시작 ==="
61+
python scripts/link_health_check.py README_EN.md --save-json --concurrent 25
62+
mv link_health_report.json link_health_report_en.json
63+
continue-on-error: true
64+
65+
- name: 📊 검사 결과 업로드
66+
uses: actions/upload-artifact@v3
67+
if: always()
68+
with:
69+
name: link-health-reports
70+
path: |
71+
link_health_report.json
72+
link_health_report_en.json
73+
retention-days: 30
74+
75+
- name: 🚨 깨진 링크 이슈 생성
76+
if: failure() && github.event_name == 'schedule'
77+
uses: actions/github-script@v6
78+
with:
79+
script: |
80+
const fs = require('fs');
81+
82+
let brokenLinks = [];
83+
let reportContent = '';
84+
85+
// 한국어 README 결과 확인
86+
try {
87+
const koReport = JSON.parse(fs.readFileSync('link_health_report.json', 'utf8'));
88+
const koBroken = koReport.results.filter(link => !link.is_working);
89+
brokenLinks = brokenLinks.concat(koBroken.map(link => ({...link, file: 'README.md'})));
90+
} catch (e) {
91+
console.log('한국어 리포트 파일을 찾을 수 없습니다.');
92+
}
93+
94+
// 영어 README 결과 확인
95+
try {
96+
const enReport = JSON.parse(fs.readFileSync('link_health_report_en.json', 'utf8'));
97+
const enBroken = enReport.results.filter(link => !link.is_working);
98+
brokenLinks = brokenLinks.concat(enBroken.map(link => ({...link, file: 'README_EN.md'})));
99+
} catch (e) {
100+
console.log('영어 리포트 파일을 찾을 수 없습니다.');
101+
}
102+
103+
if (brokenLinks.length > 0) {
104+
// 에러 타입별로 그룹화
105+
const errorGroups = {};
106+
brokenLinks.forEach(link => {
107+
const errorType = link.error_type;
108+
if (!errorGroups[errorType]) {
109+
errorGroups[errorType] = [];
110+
}
111+
errorGroups[errorType].push(link);
112+
});
113+
114+
let issueBody = `## 🚨 링크 부패 감지 알림\n\n`;
115+
issueBody += `**총 ${brokenLinks.length}개의 깨진 링크가 발견되었습니다.**\n\n`;
116+
117+
// 에러 타입별 상세 내용
118+
for (const [errorType, links] of Object.entries(errorGroups)) {
119+
issueBody += `### 📋 ${errorType} (${links.length}개)\n\n`;
120+
121+
links.forEach(link => {
122+
issueBody += `- ❌ **[${link.api_name}](${link.url})**\n`;
123+
issueBody += ` - 📁 파일: ${link.file}\n`;
124+
issueBody += ` - 📂 카테고리: ${link.category}\n`;
125+
issueBody += ` - ⚠️ 오류: ${link.error_message}\n`;
126+
if (link.redirect_url) {
127+
issueBody += ` - 🔄 리다이렉트: ${link.redirect_url}\n`;
128+
}
129+
issueBody += `\n`;
130+
});
131+
}
132+
133+
issueBody += `\n### 🔧 수정 방법\n\n`;
134+
issueBody += `1. **서비스 상태 확인**: 해당 API 서비스가 종료되었는지 확인\n`;
135+
issueBody += `2. **URL 변경 확인**: 공식 문서에서 새로운 URL 확인\n`;
136+
issueBody += `3. **대체 서비스 조사**: 동일한 기능의 대체 API 조사\n`;
137+
issueBody += `4. **항목 제거**: 복구 불가능한 경우 해당 항목 제거\n\n`;
138+
issueBody += `---\n`;
139+
issueBody += `**자동 생성 시간**: ${new Date().toLocaleString('ko-KR', {timeZone: 'Asia/Seoul'})}\n`;
140+
issueBody += `**검사 주기**: 매주 월요일\n`;
141+
142+
// 이슈 생성
143+
await github.rest.issues.create({
144+
owner: context.repo.owner,
145+
repo: context.repo.repo,
146+
title: `🔗 주간 링크 상태 점검: ${brokenLinks.length}개 링크 수정 필요`,
147+
body: issueBody,
148+
labels: ['🐛 bug', '🔗 link-rot', '🔧 maintenance', '📋 weekly-check']
149+
});
150+
151+
console.log(`이슈가 생성되었습니다: ${brokenLinks.length}개 깨진 링크`);
152+
} else {
153+
console.log('모든 링크가 정상적으로 작동합니다! 🎉');
154+
}
155+
156+
- name: 💬 PR에 결과 댓글 작성
157+
if: github.event_name == 'pull_request' && (failure() || success())
158+
uses: actions/github-script@v6
159+
with:
160+
script: |
161+
const fs = require('fs');
162+
163+
let allBroken = [];
164+
let totalLinks = 0;
165+
let workingLinks = 0;
166+
167+
// 결과 파일들 읽기
168+
try {
169+
const koReport = JSON.parse(fs.readFileSync('link_health_report.json', 'utf8'));
170+
totalLinks += koReport.total_links;
171+
workingLinks += koReport.working_links;
172+
const koBroken = koReport.results.filter(link => !link.is_working);
173+
allBroken = allBroken.concat(koBroken.map(link => ({...link, file: 'README.md'})));
174+
} catch (e) {}
175+
176+
try {
177+
const enReport = JSON.parse(fs.readFileSync('link_health_report_en.json', 'utf8'));
178+
totalLinks += enReport.total_links;
179+
workingLinks += enReport.working_links;
180+
const enBroken = enReport.results.filter(link => !link.is_working);
181+
allBroken = allBroken.concat(enBroken.map(link => ({...link, file: 'README_EN.md'})));
182+
} catch (e) {}
183+
184+
const successRate = totalLinks > 0 ? ((workingLinks / totalLinks) * 100).toFixed(1) : 0;
185+
186+
let commentBody = `## 🔗 링크 상태 검사 결과\n\n`;
187+
188+
if (allBroken.length === 0) {
189+
commentBody += `✅ **모든 링크가 정상적으로 작동합니다!**\n\n`;
190+
commentBody += `📊 **통계**: ${totalLinks}개 링크 중 ${workingLinks}개 정상 (${successRate}%)\n`;
191+
} else {
192+
commentBody += `⚠️ **일부 링크에 문제가 발견되었습니다.**\n\n`;
193+
commentBody += `📊 **통계**: ${totalLinks}개 링크 중 ${allBroken.length}개 문제 (성공률: ${successRate}%)\n\n`;
194+
commentBody += `### 🚨 문제가 있는 링크들:\n\n`;
195+
196+
allBroken.slice(0, 10).forEach(link => {
197+
commentBody += `- ❌ **${link.api_name}** (${link.file})\n`;
198+
commentBody += ` - URL: ${link.url}\n`;
199+
commentBody += ` - 오류: ${link.error_message}\n\n`;
200+
});
201+
202+
if (allBroken.length > 10) {
203+
commentBody += `... 그리고 ${allBroken.length - 10}개 더\n\n`;
204+
}
205+
206+
commentBody += `🔧 **수정 후 다시 검사를 받으시기 바랍니다.**\n`;
207+
}
208+
209+
commentBody += `\n---\n 링크 상태 자동 검사`;
210+
211+
await github.rest.issues.createComment({
212+
issue_number: context.issue.number,
213+
owner: context.repo.owner,
214+
repo: context.repo.repo,
215+
body: commentBody
216+
});
217+

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
| [SK텔레콤 Open API](https://openapi.sk.com/) | T맵, NUGU, AI/IoT 플랫폼 46개 API | `apiKey` |
119119
| [KT API Link](https://apilink.kt.co.kr/) | Geo Master, Cloud API, GiGA Genie AI | `apiKey` |
120120
| [KT Cloud AI API](https://github.com/gigagenie/cloud-aiapi) | 음성인식(Dictation), TTS(Voice), 개인화 TTS | `apiKey` |
121-
| [LG U+ Open API](https://www.lguplus.com/business/openapi) | IMS 센트릭스, SMS API, DCS Rest API | `apiKey` |
122121

123122
**[⬆ 목차로 돌아가기](#목차)**
124123

@@ -163,7 +162,7 @@
163162
| --- | --- | --- |
164163
| [삼성헬스 SDK](https://developer.samsung.com/health) | 건강 데이터 읽기/쓰기 (심박수, 산소포화도, 혈당, 혈압 등) | `Partnership` |
165164
| [건강보험심사평가원 의료기관정보](https://opendata.hira.or.kr/op/opc/selectOpenApiInfoView.do) | 전국 의료기관 상세정보 서비스 | `apiKey` |
166-
| [식품의약품안전처 의약품정보](https://data.mfds.go.kr/cntnts/20) | 의약품 허가정보 및 안전성 정보 | `apiKey` |
165+
| [식품의약품안전처 의약품정보](https://data.mfds.go.kr/OPCAA01F01) | 의약품 허가정보 및 안전성 정보 | `apiKey` |
167166
| [국민건강보험공단 검진기관정보](https://www.data.go.kr/data/15001672/openapi.do) | 건강검진 및 암검진 기관정보 | `apiKey` |
168167
| [질병관리청 감염병정보](https://dportal.kdca.go.kr/pot/www/COMMON/ATRPT/INTRCN.jsp) | 법정감염병 발생현황 및 통계 | `apiKey` |
169168

@@ -234,7 +233,7 @@
234233

235234
| API | 설명 | 인증 |
236235
|---------------------------------------------------------------------------------------------| --- | --- |
237-
| [쿠팡 Open API](https://developers.coupangcorp.com/hc/en-us) | 쿠팡 파트너스 및 셀러 API | `apiKey` |
236+
| [쿠팡 Open API](https://developers.coupangcorp.com/hc/ko) | 쿠팡 파트너스 및 셀러 API | `apiKey` |
238237
| [11번가 Open API](https://openapi.11st.co.kr/) | 11번가 상품정보 및 주문관리 API | `apiKey` |
239238
| [G마켓 Open API](https://etapi.gmarket.com/pages/API-%EA%B0%80%EC%9D%B4%EB%93%9C) | G마켓 상품검색 및 카테고리 API | `apiKey` |
240239
| [네이버 쇼핑 검색 API](https://developers.naver.com/docs/serviceapi/search/shopping/shopping.md) | 네이버 쇼핑 상품 검색 서비스 | `apiKey` |
@@ -400,14 +399,6 @@
400399

401400
---
402401

403-
## 참고 자료
404-
405-
- [공공데이터포털](https://www.data.go.kr) - 정부 및 공공기관 API 통합 플랫폼
406-
- [네이버 개발자센터](https://developers.naver.com) - 네이버 오픈 API 플랫폼
407-
- [카카오 개발자센터](https://developers.kakao.com) - 카카오 오픈 API 플랫폼
408-
- [SK 오픈 API](https://openapi.sk.com) - SK텔레콤 오픈 API 플랫폼
409-
- [금융결제원 오픈뱅킹](https://www.openbanking.or.kr) - 금융 오픈 API 통합 플랫폼
410-
411402
## 기여하기
412403

413404
이 목록에 새로운 API를 추가하거나 정보를 수정하고 싶으시다면 Pull Request를 보내주세요.
@@ -421,5 +412,5 @@
421412

422413
---
423414

424-
**마지막 업데이트**: 2025년 8월 20일
425-
**총 API 수**: 200개 이상
415+
**마지막 업데이트**: 2025년 8월 22일
416+
**총 API 수**: 170개 이상

README_EN.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ This project systematically organizes all public APIs that developers can utiliz
111111
| [SK Telecom Open API](https://openapi.sk.com/) | T Map, NUGU, AI/IoT platform 46 APIs | `apiKey` |
112112
| [KT API Link](https://apilink.kt.co.kr/) | Geo Master, Cloud API, GiGA Genie AI | `apiKey` |
113113
| [KT Cloud AI API](https://github.com/gigagenie/cloud-aiapi) | Voice recognition (Dictation), TTS (Voice), personalized TTS | `apiKey` |
114-
| [LG U+ Open API](https://www.lguplus.com/business/openapi) | IMS Centrix, SMS API, DCS Rest API | `apiKey` |
115114

116115
**[⬆ Back to Table of Contents](#table-of-contents)**
117116

@@ -156,7 +155,7 @@ This project systematically organizes all public APIs that developers can utiliz
156155
| --- | --- | --- |
157156
| [Samsung Health SDK](https://developer.samsung.com/health) | Health data read/write (heart rate, blood oxygen saturation, blood sugar, blood pressure, etc.) | `Partnership` |
158157
| [HIRA Medical Institution Information](https://opendata.hira.or.kr/op/opc/selectOpenApiInfoView.do) | Detailed information service for medical institutions nationwide | `apiKey` |
159-
| [MFDS Drug Information](https://data.mfds.go.kr/cntnts/20) | Drug approval information and safety information | `apiKey` |
158+
| [MFDS Drug Information](https://data.mfds.go.kr/OPCAA01F01) | Drug approval information and safety information | `apiKey` |
160159
| [NHIS Health Screening Institution Information](https://www.data.go.kr/data/15001672/openapi.do) | Health screening and cancer screening institution information | `apiKey` |
161160
| [KDCA Infectious Disease Information](https://dportal.kdca.go.kr/pot/www/COMMON/ATRPT/INTRCN.jsp) | Legal infectious disease occurrence status and statistics | `apiKey` |
162161

@@ -227,7 +226,7 @@ This project systematically organizes all public APIs that developers can utiliz
227226

228227
| API | Description | Auth |
229228
| --- | --- | --- |
230-
| [Coupang Open API](https://developers.coupangcorp.com/hc/en-us) | Coupang Partners and Seller API | `apiKey` |
229+
| [Coupang Open API](https://developers.coupangcorp.com/hc/ko) | Coupang Partners and Seller API | `apiKey` |
231230
| [11st Open API](https://openapi.11st.co.kr/) | 11st product information and order management API | `apiKey` |
232231
| [Gmarket Open API](https://etapi.gmarket.com/pages/API-%EA%B0%80%EC%9D%B4%EB%93%9C) | Gmarket product search and category API | `apiKey` |
233232
| [Naver Shopping Search API](https://developers.naver.com/docs/serviceapi/search/shopping/shopping.md) | Naver Shopping product search service | `apiKey` |
@@ -405,13 +404,6 @@ This project systematically organizes all public APIs that developers can utiliz
405404

406405
If you would like to add new APIs to this list or modify information, please send a Pull Request.
407406

408-
### Addition Criteria
409-
- APIs serviced in South Korea
410-
- Publicly available APIs
411-
- Actively maintained APIs
412-
- APIs with clear documentation provided
413-
- Actually accessible URLs
414-
415407
### How to Contribute
416408
1. Fork this repository
417409
2. Create a new branch (`git checkout -b feature/add-new-api`)
@@ -425,5 +417,5 @@ This project is distributed under the MIT License.
425417

426418
---
427419

428-
**Last Updated**: August 21, 2025
429-
**Total API Count**: 200+
420+
**Last Updated**: August 22, 2025
421+
**Total API Count**: 170+

0 commit comments

Comments
 (0)