API 문서

더모음 API를 시작하는 데 필요한 모든 것

🔑 API 인증

모든 API 요청에는 X-API-Key 헤더가 필요합니다.

API 키 발급 방법:

  1. 대시보드에서 회원가입
  2. 설정 → API Keys → 새 키 생성
  3. 환경변수 DEMOUM_API_KEY에 저장
모든 요청 예시
curl -H "X-API-Key: dmk_your_api_key_here" https://api.demoum.com/v1/health

💚 헬스체크

API 서버 상태를 확인합니다.

GET /v1/health
curl
curl -H "X-API-Key: dmk_xxx" http://localhost:8000/v1/health
응답
{
  "status": "ok",
  "service": "demoum",
  "version": "0.1.0"
}

🏢 기업 정보

DART 기업 개요, 재무제표, 공시를 한 번에 조회합니다.

GET /v1/company/{corp_code}?years=3
파라미터타입설명
corp_codestring기업코드 또는 사업자번호 (필수)
yearsint조회할 재무 연도 수 (기본 3, 최대 10)
curl
curl -H "X-API-Key: dmk_xxx" "http://localhost:8000/v1/company/00126380?years=3"

📊 재무제표

기업별 재무제표만 조회합니다.

GET /v1/company/{corp_code}/financials?years=3
curl
curl -H "X-API-Key: dmk_xxx" "http://localhost:8000/v1/company/00126380/financials?years=5"

📰 뉴스 검색

기업명으로 뉴스를 검색하고 감성 분석 결과를 함께 반환합니다.

GET /v1/news/{company_name}?count=20
파라미터타입설명
company_namestring기업명 (필수)
countint결과 수 (기본 20, 최대 100)
curl
curl -H "X-API-Key: dmk_xxx" "http://localhost:8000/v1/news/삼성전자?count=10"

🤖 AI 분석

LLM을 활용한 기업 데이터 분석. 자연어로 질문하면 AI가 데이터를 수집·분석합니다.

POST /v1/ai/analyze
요청 Body
{
  "query": "삼성전자의 최근 재무 상태를 분석해줘",
  "model": "gpt-4o-mini",
  "data_sources": ["financials", "news"]
}
curl
curl -X POST \
  -H "X-API-Key: dmk_xxx" \
  -H "Content-Type: application/json" \
  -d '{"query":"삼성전자 재무 분석","model":"gpt-4o-mini","data_sources":["financials","news"]}' \
  http://localhost:8000/v1/ai/analyze

🐍 Python SDK

3줄이면 끝나는 Python SDK로 더 빠르게 통합하세요.

설치

pip install demoum

기본 사용법

from demoum import DemoumClient

# 클라이언트 초기화
client = DemoumClient(api_key="dmk_your_api_key")

# 기업 정보 조회
company = client.get_company("00126380")
print(company.company.corp_name)

# 뉴스 검색
news = client.get_news("삼성전자", count=10)
for article in news:
    print(f"{article.sentiment}: {article.title}")

# AI 분석
result = client.analyze(
    query="이 회사 투자해도 될까?",
    model="gpt-4o-mini",
)
print(result.result)

자세한 내용은 GitHub 저장소를 참조하세요.