news-api-integration
하는 일
이 스킬은 AI 에이전트가 헤드라인과 검색 결과를 얻기 위해 뉴스 API를 호출하는 방법을 설명합니다. 최신 기사를 보여 주는 뉴스 피드나 도구를 만드는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓앱이나 대시보드에 헤드라인 피드를 보여 주고 싶을 때.
- ✓주제나 키워드로 뉴스를 검색해야 할 때.
- ✓기술이나 경제처럼 분류별로 뉴스를 걸러 보고 싶을 때.
스킬 링크
https://github.com/HKUDS/AgentPilot/blob/main/openspace/legacy/v1/showcase/skills/news-api-integration/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 대시보드에 뉴스 API를 사용해 기술 헤드라인 피드를 추가하고, 주제를 검색할 수 있게 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 키와 함께 분류 또는 검색어로 뉴스 API를 호출한 뒤 반환된 기사를 읽습니다. 스킬은 GNews를 무료 요금제에서 쓰기 좋은 추천 옵션으로 설명하고, NewsAPI를 다른 선택지로 소개합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
News API Integration
Multiple news APIs available. GNews is recommended for free tier usability.
Recommended: GNews
- Docs: https://gnews.io/docs/v4
- Base URL:
https://gnews.io/api/v4 - Auth: Query param
token=API_KEY - Free tier: 100 requests/day, 10 articles per request
- CORS: Yes
Top Headlines
GET /top-headlines?category=general&lang=en&max=10&token=API_KEY
Categories: general, world, nation, business, technology, entertainment, sports, science, health
Search
GET /search?q=artificial+intelligence&lang=en&max=10&token=API_KEY
Response Shape
{
"totalArticles": 1234,
"articles": [
{
"title": "Article Title",
"description": "Short description...",
"content": "Full article content (truncated)...",
"url": "https://example.com/article",
"image": "https://example.com/image.jpg",
"publishedAt": "2024-01-15T12:00:00Z",
"source": {
"name": "CNN",
"url": "https://cnn.com"
}
}
]
}
Alternative: NewsAPI.org
- Docs: https://newsapi.org/docs
- Free tier: 100 requests/day, for development only
- Note: Free plan does NOT support production use (requires paid plan for CORS from browser)
GET /v2/top-headlines?country=us&apiKey=API_KEY
GET /v2/everything?q=bitcoin&apiKey=API_KEY
Other Alternatives (from public-apis)
| API | Free Tier | Best For |
|---|---|---|
| GNews | 100 req/day | General news, good free tier |
| Currents API | 600 req/day | Real-time news, good rate |
| NewsData.io | 200 req/day | News + crypto news |
| The Guardian | Unlimited (rate limited) | UK/international news |
| New York Times | 500 req/day | US news, archives |
| Mediastack | 500 req/month | Multi-source aggregation |
| TheNews API | 100 req/day | Simple aggregation |
| MarketAux | 100 req/day | Financial news with sentiment |
| HackerNews | No limit | Tech/startup news (no key needed) |
Frontend Service Implementation
// src/services/news.ts
import { createCircuitBreaker } from '@/utils/circuit-breaker';
export interface NewsArticle {
title: string;
description: string;
url: string;
source: string;
publishedAt: string;
image?: string;
}
const newsBreaker = createCircuitBreaker<NewsArticle[]>({
name: 'News',
cacheTtlMs: 5 * 60_000, // 5 minutes
});
export async function fetchNews(category = 'general'): Promise<NewsArticle[]> {
return newsBreaker.execute(async () => {
const resp = await fetch(`/api/news?category=${category}`);
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const data = await resp.json();
return data.articles || [];
}, []);
}
export async function searchNews(query: string): Promise<NewsArticle[]> {
const resp = await fetch(`/api/news?q=${encodeURIComponent(query)}`);
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
const data = await resp.json();
return data.articles || [];
}
HackerNews (No API Key Needed)
For tech news, HackerNews API is free and unlimited:
// Fetch top 30 stories
const topIds = await fetch('https://hacker-news.firebaseio.com/v0/topstories.json').then(r => r.json());
const stories = await Promise.all(
topIds.slice(0, 30).map((id: number) =>
fetch(`https://hacker-news.firebaseio.com/v0/item/${id}.json`).then(r => r.json())
)
);
// Each story: { title, url, score, by, time, descendants }
Panel Rendering Pattern
private render(articles: NewsArticle[]): void {
const rows = articles.map(a => `
<div class="news-item">
<a href="${a.url}" target="_blank" rel="noopener" class="news-title">${escapeHtml(a.title)}</a>
<div class="news-meta">
<span class="news-source">${escapeHtml(a.source)}</span>
<span class="news-time">${formatTime(new Date(a.publishedAt))}</span>
</div>
</div>
`).join('');
this.setContent(`<div class="news-list">${rows}</div>`);
}
Always escape user-controlled strings with escapeHtml() to prevent XSS.
자주 묻는 질문
어떤 뉴스 API가 추천되나요?
스킬은 무료 요금제에서 쓰기 편하다는 이유로 GNews를 추천하며, 브라우저 CORS를 지원한다고 설명합니다.
NewsAPI는 운영 환경에서 무료인가요?
아니요, 스킬은 NewsAPI의 무료 요금제가 개발용이라 브라우저에서 운영 환경 사용을 지원하지 않는다고 설명합니다.
어떤 분류가 있나요?
일반, 비즈니스, 기술, 스포츠, 과학, 건강 같은 분류를 나열합니다.
상세 정보
작성자의 원본 설명
Integrate with news APIs (GNews, NewsAPI, etc.) for aggregated news feeds. Covers headline fetching, search, and category filtering.
repo: HKUDS/AgentPilot
인기도
- GitHub 스타
- 7.8k
- 순위
- #13061
- 라이선스
- MIT
- 업데이트
- 2026. 11. 1.
댓글
- …
이 저장소의 다른 스킬
agentpilot
7.8k작업을 준비하고 AgentPilot 루프를 실행해 변경을 제안, 테스트, 점수화하면서 프로젝트를 단계적으로 개선하도록 돕습니다.
openspace
7.8k에이전트 스킬을 저장하고 가져오는 도구인 OpenSpace를 설정하고, MCP를 통해 AI 앱에 연결하도록 돕습니다.
rsi-arena
7.8kAIME나 Terminal-Bench 같은 표준 AI 벤치마크 테스트를 설정하고 실행해 서로 다른 개선 방법을 비교하도록 돕습니다.
experiment-guide
7.8k프로그램을 개선하는 방법을 조사하면서 작은 실험을 계획하고, 결과를 읽고, 발견 사항을 기록하도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.