1.7.3 • Published 4 months ago

neis-api.ts v1.7.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

neis-api.ts

License npm

NEIS OPEN API를 쉽게 사용할 수 있는 API Wrapper 라이브러리 입니다.

새로운 기능 (Version =>1.7.0)

stats를 사용하여 API의 HTTP 요청/응답에 대한 통계를 간략하게 확인할 수 있다.

사용자 선택에 따라 적용하거나 적용하지 않아도 된다.

const neis = new NeisApi({
  key: NEIS_API_KEY,
  stats: true, <-- true를 사용해 활성화
});

// [API Http Stats - Endpoint: schoolInfo | Response Time: 251ms] <-- API 호출 및 응답 시간 출력 기능

설치 방법 (npm, yarn, pnpm)

npm install neis-api.ts
yarn add neis-api.ts
pnpm add neis-api.ts

엔드포인트 (12가지)

기본인자

변수명타입변수 설명설명
keySTRING(필수)인증키기본값 : ❌
typeSTRING(선택)호출 문서(xml, json)기본값 : json
pIndexINTEGER(선택)페이지 위치기본값 : 1
pSizeINTEGER(선택)페이지 당 신청 숫자기본값 : 100
statsBOOLEAN(선택)API 호출/응답 시간기본값 : false

사용 방법 (예시)

import NeisApi from "neis-api.ts";

const neis = new NeisApi({
  key: NEIS_API_KEY,
});

const fetch = async () => {
  try {
    const response = await neis.getSchoolInfo({
      ATPT_OFCDC_SC_CODE: "시도교육청코드",
      SD_SCHUL_CODE: "행정표준코드",
    });
    console.log("API response:", response);
  } catch (error) {
    console.error("Error:", error);
  }
};

fetch();

NEIS API 문서 및 정보 출처 링크

1.7.3

4 months ago

1.7.2

5 months ago

1.7.1

5 months ago

1.7.0

5 months ago

1.6.0

5 months ago

1.5.1

5 months ago

1.5.0

5 months ago

1.4.0

5 months ago

1.3.0

5 months ago

1.2.0

5 months ago

1.1.0

5 months ago

1.0.0

5 months ago