API 문서

이 API는 포켓몬 데이터를 조회할 수 있는 RESTful API입니다.
기본 정보
API 정보
  • 이름: 포켓몬 API
  • 버전: 1.0.0
  • 기본 URL: http://localhost:3000/api
  • 응답 형식: JSON
상태 코드
  • 200성공
  • 400잘못된 요청
  • 404리소스를 찾을 수 없음
  • 500서버 오류
헬스 체크
GET /api/health

서버 상태를 확인합니다.

GET /api/health
 
응답:
{
  "status": "OK",
  "uptime": 1234.567,
  "timestamp": "2025-01-27T10:30:00.000Z",
  "environment": "development"
}
포켓몬 API
GET /api/pokemon

모든 포켓몬을 조회합니다. 페이지네이션, 검색, 필터링을 지원합니다.

쿼리 매개변수
매개변수타입필수설명
pagenumber아니오페이지 번호
limitnumber아니오페이지당 항목 수
searchstring아니오이름으로 검색
typestring아니오타입으로 필터링
sortBystring아니오정렬 기준 (id, name, pokedex_number)
sortOrderstring아니오정렬 순서 (ASC, DESC)
GET /api/pokemon?page=1&limit=20&search=피카츄&type=전기&sortBy=name&sortOrder=ASC
GET /api/pokemon/:id

ID로 특정 포켓몬을 조회합니다.

GET /api/pokemon/1
 
응답:
{
  "success": true,
  "data": {
    "id": 1,
    "name": "피카츄",
    "pokedex_number": "025",
    "type": "전기",
    "category": "쥐포켓몬",
    "height": "0.4m",
    "weight": "6.0kg"
  }
}
GET /api/pokemon/pokedex/:number

도감 번호로 포켓몬을 조회합니다.

GET /api/pokemon/pokedex/025
GET /api/pokemon/search/name/:name

이름으로 포켓몬을 검색합니다.

GET /api/pokemon/search/name/피카츄
GET /api/pokemon/type/:type

특정 타입의 포켓몬을 조회합니다.

GET /api/pokemon/type/전기
GET /api/pokemon/stats/overview

포켓몬 통계를 조회합니다.

GET /api/pokemon/stats/overview
 
응답:
{
  "success": true,
  "data": {
    "total": 1200,
    "byType": [...],
    "byCategory": [...]
  }
}
응답 예시
성공 응답
{
  "success": true,
  "data": { ... },
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1200,
    "totalPages": 60
  }
}
오류 응답
{
  "success": false,
  "error": "오류 메시지"
}
API 테스트 결과