npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-public-data-tour-api

v0.3.0

Published

공공데이터 포탈의 다국어 관광정보 API 사용하기

Downloads

6

Readme

공공데이터포털 다국어관광정보 API

npm version npm downloads

설치(Installing)

npm 사용:

$ npm i node-public-data-tour-api

yarn 사용:

$ yarn add nnode-public-data-tour-api

API 제공 언어

  • 영문 EngService
  • 일문 JpnService
  • 중문간체 ChsService
  • 중문번체 ChtService
  • 독어(독일어) GerService
  • 불어(프랑스어) FreService
  • 서어(스페인어) SpnService
  • 노어(러시아어) RusService

API 종류

  • areaCode 지역코드조회
  • categoryCode 서비스 분류코드 조회
  • areaBasedList 지역기반 관광정보 조회
  • locationBasedList 위치기반 관광정보 조회
  • searchKeyword 키워드 검색 조회
  • searchFestival 행사정보 조회
  • searchStay 숙박정보 조회
  • detailCommon 공통정보 조회 (상세정보1)
  • detailIntro 소개정보 조회 (상세정보2)
  • detailInfo 반복정보 조회 (상세정보3)
  • detailImage 이미지정보 조회 (상세정보4)

예제

const SERVICE_KEY = "공공데이터포탈 service key";

지역코드조회

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await areaCode({
      language: "Eng",
      numOfRows: 50,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

서비스 분류코드 조회

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await categoryCode({
      language: "Eng",
      numOfRows: 50,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      contentTypeId: 76, // 없으면 대분류 전체
      cat1: "A01", // 특정 대분류만 조회   cat2: 중분류, cat3: 소분류
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

지역기반 관광정보 조회

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await areaBasedList({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      contentTypeId: 77,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

위치기반 관광정보 조회

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await locationBasedList({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      mapX: 126.981611,
      mapY: 37.568477,
      radius: 1000,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

키워드 검색 조회

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await searchKeyword({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      keyword: "seoul",
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

행사정보 조회

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await searchFestival({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      eventStartDate: 20180110,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

숙박정보 조회

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await searchStay({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

공통정보 조회 (상세정보1)

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await detailCommon({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      contentId: 1891502,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

소개정보 조회 (상세정보2)

try {
  // contentid: 1752884,
  // contenttypeid: 76,
  // contentid: 1870509,
  // contenttypeid: 78,
  // contentid: 2523275,
  // contenttypeid: 85,
  // contentid: 1064078,
  // contenttypeid: 75,
  // contentid: 2708003,
  // contenttypeid: 80,
  // contentid: 2499122,
  // contenttypeid: 79,
  // contentid: 2694940,
  // contenttypeid: 82,
  // contentid: 1128279,
  // contenttypeid: 77,
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await detailIntro<IDetailIntro78>({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      contentId: 1128279,
      contentTypeId: 77,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

반복정보 조회 (상세정보3)

try {
  // 관광지	76
  // 문화시설	78
  // 행사/공연/축제	85
  // 레포츠	75
  // 쇼핑	79
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await detailInfo({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      contentId: 1752884,
      contentTypeId: 76,
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

이미지정보 조회 (상세정보4)

try {
  const { resultCode, resultMsg, items, numOfRows, pageNo, totalCount } =
    await detailImage({
      language: "Eng",
      numOfRows: 5,
      pageNo: 1,
      MobileOS: "ETC",
      MobileApp: "apptest",
      ServiceKey: SERVICE_KEY,
      contentId: 2507421,
      imageYN: "Y",
    });
  console.log(totalCount);
  if (resultCode === "0000") {
    console.log(items);
  }
} catch (err) {
  console.log(err);
}

Resources

License

MIT