fix: correct KIS overseas ranking API TR_IDs, paths, and exchange codes #142

Merged
jihoson merged 3 commits from feature/issue-141-fix-overseas-ranking-api into main 2026-02-18 01:13:07 +09:00
Collaborator

Summary

  • KIS 해외주식 랭킹 API의 TR_ID, Path, 거래소 코드가 모두 잘못되어 모든 거래소에서 404 반환
  • 등락율 TR_ID: HHDFS76200100 → HHDFS76290000, Path: inquire-updown-rank → updown-rate
  • 거래량 TR_ID: HHDFS76200200 → HHDFS76270000, Path: inquire-volume-rank → volume-surge
  • 거래소 코드 매핑 추가: NASD→NAS, NYSE→NYS, AMEX→AMS (랭킹 API 전용)
  • 불필요한 4가지 param variant 시도 로직 제거, 올바른 파라미터 1세트 사용

Test plan

  • 19개 단위 테스트 추가 (거래소 매핑, config 기본값, API 파라미터, 에러 처리)
  • 전체 테스트 571/572 통과 (1개 실패는 기존 cooldown 테스트, 무관)
  • 실제 paper trading 실행하여 overseas ranking scan 동작 확인

Fixes #141

🤖 Generated with Claude Code

## Summary - KIS 해외주식 랭킹 API의 TR_ID, Path, 거래소 코드가 모두 잘못되어 모든 거래소에서 404 반환 - 등락율 TR_ID: HHDFS76200100 → HHDFS76290000, Path: inquire-updown-rank → updown-rate - 거래량 TR_ID: HHDFS76200200 → HHDFS76270000, Path: inquire-volume-rank → volume-surge - 거래소 코드 매핑 추가: NASD→NAS, NYSE→NYS, AMEX→AMS (랭킹 API 전용) - 불필요한 4가지 param variant 시도 로직 제거, 올바른 파라미터 1세트 사용 ## Test plan - [x] 19개 단위 테스트 추가 (거래소 매핑, config 기본값, API 파라미터, 에러 처리) - [x] 전체 테스트 571/572 통과 (1개 실패는 기존 cooldown 테스트, 무관) - [ ] 실제 paper trading 실행하여 overseas ranking scan 동작 확인 Fixes #141 🤖 Generated with [Claude Code](https://claude.com/claude-code)
agentson added 1 commit 2026-02-18 01:04:05 +09:00
fix: correct KIS overseas ranking API TR_IDs, paths, and exchange codes
Some checks failed
CI / test (pull_request) Has been cancelled
b625f41621
The overseas ranking API was returning 404 for all exchanges because the
TR_IDs, API paths, and exchange codes were all incorrect. Updated to match
KIS official API documentation:
- TR_ID: HHDFS76290000 (updown-rate), HHDFS76270000 (volume-surge)
- Path: /uapi/overseas-stock/v1/ranking/{updown-rate,volume-surge}
- Exchange codes: NASD→NAS, NYSE→NYS, AMEX→AMS via ranking-specific mapping

Fixes #141

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
agentson added 1 commit 2026-02-18 01:04:45 +09:00
docs: add requirements log entry for overseas ranking API fix
Some checks failed
CI / test (pull_request) Has been cancelled
1288181e39
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
agentson added 1 commit 2026-02-18 01:12:10 +09:00
fix: align cooldown test with wait-and-retry behavior + boost overseas coverage
Some checks failed
CI / test (pull_request) Has been cancelled
b484f0daff
- test_token_refresh_cooldown: updated to match the wait-then-retry
  behavior introduced in aeed881 (was expecting fail-fast ConnectionError)
- Added 22 tests for OverseasBroker: get_overseas_price, get_overseas_balance,
  send_overseas_order, _get_currency_code, _extract_ranking_rows
- src/broker/overseas.py coverage: 52% → 100%
- All 594 tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jihoson merged commit 0c5c90201f into main 2026-02-18 01:13:07 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#142