-
노션 API와 주식 API를 통해서 주식종목 정리하기(2) - 노션 API 사용준비코딩 2023. 1. 12. 23:16
Notion API를 사용하기 위해서 Notion Developers Docs로 먼저 들어가 보았습니다.
쭉 내려보다가 Additional resources에 있는 TypeScript starter template 발견하고선 fork 해서 바로 사용해 보았습니다.
index.ts
를 살펴보니 실행시켜보지 않아도세팅이 좀 더 필요해 보입니다.
NOTION_TOKEN
,database_id : "FIXME"
이 2개가 필히 수정되어야 할거 같군요.그래도 실행시켜 봅니다.
네 역시나 에러가 뜹니다.
README.md
파일을 보니 내가 복사하고 난 이후에 뭘 해야 하는지 친절하게 적혀있습니다.Notion intergration을 통해서 token을 발급받아 보겠습니다.
아래의 링크를 통해서 들어가셔서 프로세스를 진행하시면 됩니다.
https://www.notion.so/my-integrations
.env
파일을 만들어서 NOTION_TOKEN 세팅하기Page와 Integration 연결시키기
수정하고자 하는 Page의 상단 우측에 더 보기 버튼을 클릭해서 Add Connections를 통해서 생성 해둔 Integration을 연결시켜 주면
Notion API를 사용하기 위한 모든 준비가 끝납니다.
※ 참고.
database_id
가 어딨 는지 찾다가 노션 문서에서 발견했는데
노션의 링크 URL을 참고하면 아래와 같은 구조로 되어있으니 참고하면 되겠습니다.다음 포스팅에서는 주식 API 사용법에 대해서 알아보겠습니다.
'코딩' 카테고리의 다른 글
노션 API와 주식 API를 통해서 주식종목 정리하기(3) - 주식 API 사용해보기 (0) 2023.01.29 노션 API와 주식 API를 통해서 주식종목 정리하기(1) - 계기 (0) 2023.01.10