[{"data":1,"prerenderedAt":84},["ShallowReactive",2],{"blog-tags":3,"header-recruit-jobs":17,"blog-post-gas-notion-api":26},[4,5,6,7,8,9,10,11,12,13,14,15,16],"Notion AI","Notionカレンダー","Notionサイト","Notionメール","インテグレーション \u002F 外部ツール連携","データベース","プラン \u002F 請求 \u002F 料金 \u002F 支払い","ページ \u002F ブロック","マーケットプレイス \u002F テンプレート","ワークスペース \u002F サイドバー","共有 \u002F コラボレーション","数式","設定",[18,22],{"path":19,"title":20,"order":21},"\u002Frecruit\u002Fnotion-consultant","Notionエンジニア\u002Fコンサルタント",1,{"path":23,"title":24,"order":25},"\u002Frecruit\u002Fpresales","Notion導入ソリューションセールス",2,{"slug":27,"title":28,"date":29,"lastUpdatedAt":30,"excerpt":31,"categories":32,"tags":34,"author":35,"noIndex":42,"html":43,"headings":44,"qas":82,"relatedQAsByTag":83},"gas-notion-api","GASでNotion APIを使う方法【無料で自動化】","2023-09-22T00:00:00.000Z","2024-10-12T00:00:00.000Z","GAS（Google Apps Script）でNotion APIを使う方法について解説しています。GASとNotion APIを連携させて、データベースからのデータの取得やプロパティの更新するためのサンプルコードもいくつか記載しています。無料で自動化することが可能です。",[33],"個人利用",[8],{"id":36,"name":37,"image":38,"description":39,"url":39,"descriptionHTML":40,"SNSHTML":41},"c2f976ab-4882-4e4e-a80e-91d829bd59ca","チャベス","\u002Fblog\u002Ficon\u002Fchabesu.png","","Webライター・ディレクター。Notion公式のおすすめのテンプレートクリエイター。個人でNotionをちょっと便利にするChrome拡張機能を開発中。代表作は「NotionSidebarHider」「Notion文字数カウント」。本業はメーカーで研究開発をしているエンジニア。","\u003Ca href=\"https:\u002F\u002Fx.com\u002FChabesuB\" class=\"article-link\" target=\"_blank\">X\u003C\u002Fa> \u002F \u003Ca href=\"https:\u002F\u002Fwww.notion.so\u002Fja-jp\u002F@chabesu\" class=\"article-link\" target=\"_blank\">Notion\u003C\u002Fa>",false,"\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">この記事では、GAS（Google Apps Script）でNotion APIを使う方法について解説します。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Notion APIの概要や具体的な活用例、Notion APIを活用したサービスなどを知りたい場合は以下の記事を参考にしてください。\u003C\u002Fp>\n        \u003Cdetails class=\"table-of-contents mb-6 hidden\" open=\"\">\n          \u003Csummary class=\"text-[.9em] leading-[1.6] font-semibold tracking-[1px] mb-2\">\n            目次\n          \u003C\u002Fsummary>\n          \u003Cul class=\"toc-list flex flex-col gap-1 ml-5\">\n      \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#gasgoogle-apps-scriptの使い方\" class=\"toc-link text-sm text-black6 font-bold\">\n                GAS（Google Apps Script）の使い方\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"ml-4\">\n              \u003Ca href=\"#gasgoogle-apps-script-とは\" class=\"toc-link text-sm text-black6 \">\n                GAS（Google Apps Script） とは\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"ml-4\">\n              \u003Ca href=\"#google-apps-scriptエディタの開き方\" class=\"toc-link text-sm text-black6 \">\n                Google Apps Scriptエディタの開き方\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"ml-4\">\n              \u003Ca href=\"#gasでこんにちはと表示\" class=\"toc-link text-sm text-black6 \">\n                GASで「こんにちは」と表示\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#gasのスクリプトプロパティにインテグレーションキーを登録\" class=\"toc-link text-sm text-black6 font-bold\">\n                GASのスクリプトプロパティにインテグレーションキーを登録\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#gasでデータベースにページを作成\" class=\"toc-link text-sm text-black6 font-bold\">\n                GASでデータベースにページを作成\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#gasでデータベースのページを更新\" class=\"toc-link text-sm text-black6 font-bold\">\n                GASでデータベースのページを更新\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#gasでデータベースからページを検索取得\" class=\"toc-link text-sm text-black6 font-bold\">\n                GASでデータベースからページを検索（取得）\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#gasで取得したnotionのデータをスプレッドシートに入力\" class=\"toc-link text-sm text-black6 font-bold\">\n                GASで取得したNotionのデータをスプレッドシートに入力\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#notionに蓄積されたデータを1日に1回-スプシに吐き出し\" class=\"toc-link text-sm text-black6 font-bold\">\n                Notionに蓄積されたデータを1日に1回 スプシに吐き出し\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#notion-apiの公式ページ\" class=\"toc-link text-sm text-black6 font-bold\">\n                Notion APIの公式ページ\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n            \u003Cli class=\"mt-0.5\">\n              \u003Ca href=\"#おわりに\" class=\"toc-link text-sm text-black6 font-bold\">\n                おわりに\n              \u003C\u002Fa>\n            \u003C\u002Fli>\n        \n          \u003C\u002Ful>\n        \u003C\u002Fdetails>\n      \u003Ca href=\"#gasgoogle-apps-scriptの使い方\" id=\"gasgoogle-apps-scriptの使い方\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">GAS（Google Apps Script）の使い方\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">まずは 基本的なGAS（Google Apps Script）の使い方から解説します。GASの使い方についてすでに知っているという方はこのセクションを飛ばしてください。\u003C\u002Fp>\u003Ca href=\"#gasgoogle-apps-script-とは\" id=\"gasgoogle-apps-script-とは\" style=\"pointer-events: none; cursor: text;\">\u003Ch3 class=\"mt-4 relative pl-4 font-bold text-[17px] md:text-[18px] leading-[1.6] tracking-[0.05em] font-feature-palt before:content-[''] before:absolute before:left-0 before:top-[0.2em] before:bottom-[0.2em] before:w-[3px] before:bg-black -mb-1\">GAS（Google Apps Script） とは\u003C\u002Fh3>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">GAS（Google Apps Script）とは、Googleが提供しているプログラミング言語で、Googleアカウントとブラウザ（インターネット環境）があれば無料で利用可能です。GAS（ガス）と呼ばれています。GmailやGoogleカレンダーなど、Google関連のサービスを連携、自動化させることができる上にWeb APIを活用すればNotionなど、Google以外のサービスとも連携が可能です。\u003C\u002Fp>\u003Ca href=\"#google-apps-scriptエディタの開き方\" id=\"google-apps-scriptエディタの開き方\" style=\"pointer-events: none; cursor: text;\">\u003Ch3 class=\"mt-4 relative pl-4 font-bold text-[17px] md:text-[18px] leading-[1.6] tracking-[0.05em] font-feature-palt before:content-[''] before:absolute before:left-0 before:top-[0.2em] before:bottom-[0.2em] before:w-[3px] before:bg-black -mb-1\">Google Apps Scriptエディタの開き方\u003C\u002Fh3>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">まずは、スプレッドシート（スプシ）を開きます。Googleドライブ、もしくは、\u003Ca href=\"https:\u002F\u002Fsheets.google.com\u002F\" class=\"text-black6 article-link\" target=\"_blank\" rel=\"noopener noreferrer\">sheets.google.com\u003C\u002Fa>&nbsp;でスプレッドシートのホーム画面を開き、新規アイコン&nbsp;「+」をクリックすると、新しいスプレッドシートが作成されて開きます。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-1.png\" alt=\"スプレッドシートを開いた様子\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">スプレッドシートを開いた様子\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">「拡張機能」→「Apps Script」をクリックします。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-2.png\" alt=\"Apps Scriptをクリック\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Apps Scriptをクリック\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Google Apps Scriptエディタを開くことができます。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-3.png\" alt=\"Google Apps Scriptエディタ\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Google Apps Scriptエディタ\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Ca href=\"#gasでこんにちはと表示\" id=\"gasでこんにちはと表示\" style=\"pointer-events: none; cursor: text;\">\u003Ch3 class=\"mt-4 relative pl-4 font-bold text-[17px] md:text-[18px] leading-[1.6] tracking-[0.05em] font-feature-palt before:content-[''] before:absolute before:left-0 before:top-[0.2em] before:bottom-[0.2em] before:w-[3px] before:bg-black -mb-1\">GASで「こんにちは」と表示\u003C\u002Fh3>\u003C\u002Fa>\u003Col class=\"list-decimal pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">まずは以下のような関数をエディタ部分に入力します。\u003C\u002Fli>\u003C\u002Fol>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-javascript text-sm\">function myFunction() {\n  console.log(\"こんにちは\");\n}\u003C\u002Fcode>\u003C\u002Fpre>\u003Col class=\"list-decimal pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">「実行」をクリックします。\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">実行ログに「こんにちは」と表示されます。\u003Cbr>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-4.png\" alt=\"GASで「こんにちは」と表示\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">GASで「こんにちは」と表示\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003C\u002Fli>\u003C\u002Fol>\n    \u003Cdiv class=\"template-text-section mb-6\" data-cta-id=\"task-trial\" data-cta-position=\"after-h2-2\" data-cta-variant=\"default\" data-audience=\"toC\" data-post-slug=\"gas-notion-api\">\n      \n      \u003Csection class=\"flex flex-col gap-y-5 mb-4 bg-white border border-black px-6 pt-6 pb-7 md:px-8\">\n        \u003Cdiv>\n          \u003Ch2 class=\"blog-heading font-feature-palt\">\n            Notionタスク管理ロードマップ体験版を無料プレゼント\n          \u003C\u002Fh2>\n        \u003C\u002Fdiv>\n        \u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\n          Notionでのタスク管理を基礎から体系的に学べる「タスク管理ロードマップ」の体験版を無料で配布しています。公式LINEの友だち追加だけで、すぐに受け取れます。\n        \u003C\u002Fp>\n        \u003Cimg src=\"https:\u002F\u002Flp.notion-university.jp\u002Fimages\u002Ftrial-task.jpg\" alt=\"Notionタスク管理ロードマップ体験版のプレビュー\" class=\"w-full border border-grayLight20\" loading=\"lazy\">\n        \u003Cdiv class=\"flex flex-col items-center gap-3 pt-1\">\n          \u003Ca href=\"https:\u002F\u002Flp.notion-university.jp\u002Ftrial-0621\u002F?utm_source=blog&amp;utm_medium=referral&amp;utm_campaign=trial0621&amp;utm_content=article_cta&amp;utm_term=gas-notion-api\" class=\"blog-button blog-button--line\" target=\"_blank\" rel=\"noopener\">\n            \u003Cspan>体験版を無料で受け取る\u003C\u002Fspan>\n          \u003C\u002Fa>\n          \u003Cp class=\"text-xs text-black6\">簡単3分！公式LINEの友だち追加だけですぐに受け取れます\u003C\u002Fp>\n        \u003C\u002Fdiv>\n      \u003C\u002Fsection>\n    \n    \u003C\u002Fdiv>\n  \u003Ca href=\"#gasのスクリプトプロパティにインテグレーションキーを登録\" id=\"gasのスクリプトプロパティにインテグレーションキーを登録\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">GASのスクリプトプロパティにインテグレーションキーを登録\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Notion APIで使用するインテグレーションキーをGASのスクリプトプロパティに登録します。スクリプトプロパティは、インテグレーションキーのように流出してはいけないものを保存しておける場所です。コード内にインテグレーションキーを書くこともできますが、意図せずコードを公開してしまった時にインテグレーションキーも見られてしまうので危険です。スクリプトプロパティにインテグレーションキーを登録しておけば、コードを公開してもインテグレーションキーが見られることはないので安全です。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">スクリプトプロパティは左のメニューの「⚙️」から設定することができます。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">「プロパティ」：任意のキー名（今回はNOTION_API_KEY）\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">「値」：インテグレーションキー（secret_*****）\u003C\u002Fli>\u003C\u002Ful>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-5.png\" alt=\"スクリプトプロパティにインテグレーションキーを登録\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">スクリプトプロパティにインテグレーションキーを登録\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">もし、インテグレーションキーをまだ取得していない場合は、以下の記事を参考にしてください。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">\u003Ca href=\"https:\u002F\u002Fnotion-lab.jp\u002F2023-09-21-notion-api\u002F\" class=\"text-black6 article-link\" target=\"_blank\" rel=\"noopener noreferrer\">Notion APIとは？できることや使い方を初心者向けに解説 - Notionラボ\u003C\u002Fa>\u003C\u002Fli>\u003C\u002Ful>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">設定したスクリプトプロパティは以下のコードで取得することができます。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-javascript text-sm\">const key = PropertiesService.getScriptProperties().getProperty('NOTION_API_KEY');\u003C\u002Fcode>\u003C\u002Fpre>\n      \u003Cdiv class=\"notion-callout bg-grayLight5 border-grayLight20 text-black p-4 border\">\n        \u003Cdiv class=\"flex items-start\">\n          \u003Cdiv class=\"flex-shrink-0 mr-3\">\n            \u003Ca href=\"\u002Fblog\u002Fauthors\u002Fチャベス\" class=\"flex flex-col items-center\">\n              \u003Cimg src=\"\u002Fblog\u002Ficon\u002Fchabesu.png\" alt=\"チャベスのアイコン\" class=\"w-12 h-12 rounded-full border border-grayLight20 bg-white mb-1\">\n              \u003Cspan class=\"text-xs text-black6\">チャベス\u003C\u002Fspan>\n            \u003C\u002Fa>\n          \u003C\u002Fdiv>\n          \u003Cdiv class=\"flex-1\">\n            \u003Cdiv class=\"text-[.9em] leading-[1.6] font-normal tracking-[1px] flex flex-col gap-1\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">インテグレーションキーのみではなく、データベースIDなども登録しておくことができます。\u003C\u002Fp>\u003C\u002Fdiv>\n          \u003C\u002Fdiv>\n        \u003C\u002Fdiv>\n      \u003C\u002Fdiv>\n    \n\n\u003Ca href=\"#gasでデータベースにページを作成\" id=\"gasでデータベースにページを作成\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">GASでデータベースにページを作成\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Notion API接続用のデータベースを準備します。今回はテスト用に以下のようなデータベースを作成しました。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">名前：タイトルプロパティ\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">タグ：マルチセレクトプロパティ\u003Cbr>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-6.png\" alt=\"テスト用DB\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">テスト用DB\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003C\u002Fli>\u003C\u002Ful>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">上記のデータベースに以下のページを追加します。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">名前：「GASで追加」\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">タグ：「GAS」\u003C\u002Fli>\u003C\u002Ful>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">まずはデータベースのIDを取得します。テスト用のデータベースのURLは以下です。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-plain text text-sm\">https:\u002F\u002Fwww.notion.so\u002Fchabesu-blog\u002F22e5dc3676004661a16a6c45e5ee1a4c?v=1cc5044e126b415899a940fb284cab66\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">上記のURLの22e5dc3676004661a16a6c45e5ee1a4cがデータベースIDです。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">データベースにページを追加するコードは以下のように書きます。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-javascript text-sm\">function createPage() {\n  const NOTION_API_KEY = PropertiesService.getScriptProperties().getProperty('NOTION_API_KEY');\n  const database_id = '22e5dc3676004661a16a6c45e5ee1a4c';\n\n  const url = 'https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fpages';\n\n  const payload = {\n    'parent': { 'database_id': database_id },\n    'properties': {\n      '名前': {\n        'title': [\n          {\n            'text': {\n              'content': 'GASで追加'\n            }\n          }\n        ]\n      },\n      'タグ': {\n        'multi_select': [\n          {\n          'name': 'GAS'\n          \n          }\n        ]\n      }\n    }\n  };\n\n  const opts = {\n    'method': 'POST',\n    'headers': {\n      'Notion-Version': '2022-06-28',\n      'Authorization': 'Bearer ' + NOTION_API_KEY,\n      'Content-Type': 'application\u002Fjson'\n    },\n    'payload': JSON.stringify(payload),\n  };\n\n  UrlFetchApp.fetch(url, opts);\n}\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数名はcreatePageに変更したので、実行する関数をcreatePageに変更し、「実行」をクリックします。実行ログにエラーが出ず、「実行完了」と表示されればOKです。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-7.png\" alt=\"関数を実行\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数を実行\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">ただし、実行初回は以下のような表示が出ます。まずは「権限を確認」をクリックします。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-8.png\" alt=\"権限を確認をクリック\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">権限を確認をクリック\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">続いて、「詳細」をクリックします。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-9.png\" alt=\"詳細をクリック\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">詳細をクリック\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">「Notion APIテスト（安全ではないページ）に移動」をクリックします。「Notion APIテスト」の部分はファイル名なので、人によって変わります。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-10.png\" alt=\"Notion APIテスト（安全ではないページ）に移動をクリック\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Notion APIテスト（安全ではないページ）に移動をクリック\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数を実行し、成功していればデータベースに「GASで追加」が追加されています。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-11.png\" alt=\"「GASで追加」が追加されている\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">「GASで追加」が追加されている\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Ca href=\"#gasでデータベースのページを更新\" id=\"gasでデータベースのページを更新\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">GASでデータベースのページを更新\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">上記のデータベースの「GASで追加」ページの「GAS」タグを「タグ2」に変更します。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">まずは、「GASで追加」ページのURLを確認して、ページIDを取得します。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-plain text text-sm\">https:\u002F\u002Fwww.notion.so\u002Fchabesu-blog\u002FGAS-00e45997dc8f4537a232efe2760b148c\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">上記のURLの00e45997dc8f4537a232efe2760b148cの部分がページIDです。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">ページIDを取得したら、ページを更新するコードを書きます。先ほどのページ作成のコードとの違いとして以下のような点に注意してください。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">methodがPOST → PATCHに変更\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">database_idをpage_idに変更\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">urlを変更\u003C\u002Fli>\u003C\u002Ful>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-javascript text-sm\">function updatePage() {\n  const NOTION_API_KEY = PropertiesService.getScriptProperties().getProperty('NOTION_API_KEY');\n  const page_id = '00e45997dc8f4537a232efe2760b148c';\n\n  const url = 'https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fpages\u002F' + page_id;\n\n  const payload = {\n    'properties': {\n      'タグ': {\n        'multi_select': [\n          {\n          'name': 'タグ2'\n          }\n        ]\n      }\n    }\n  };\n\n  const opts = {\n    'method': 'PATCH',\n    'headers': {\n      'Notion-Version': '2022-06-28',\n      'Authorization': 'Bearer ' + NOTION_API_KEY,\n      'Content-Type': 'application\u002Fjson'\n    },\n    'payload': JSON.stringify(payload),\n  };\n\n  UrlFetchApp.fetch(url, opts);\n}\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数名はupdatePageに変更したので、実行する関数をupdatePageに変更し、「実行」をクリックします。実行ログにエラーが出ず、「実行完了」と表示されればOKです。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-12.png\" alt=\"関数を実行（リライトした関係上、ページIDが上記の説明とは異なっています）\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数を実行（リライトした関係上、ページIDが上記の説明とは異なっています）\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数を実行し、成功していればタグが「タグ2」に変更されています。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-13.png\" alt=\"「タグ2」に変更\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">「タグ2」に変更\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Ca href=\"#gasでデータベースからページを検索取得\" id=\"gasでデータベースからページを検索取得\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">GASでデータベースからページを検索（取得）\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">データベースから以下の条件に該当するページを取得します。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">「タグ」プロパティが「タグ2」に等しい\u003C\u002Fli>\u003C\u002Ful>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">ページを検索するコードを記載します。以下に注意してください。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">database_idを使用\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">methodがPOST \u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">urlにはqueryを使用\u003C\u002Fli>\u003C\u002Ful>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-javascript text-sm\">function queryPage() {\n  const NOTION_API_KEY = PropertiesService.getScriptProperties().getProperty('NOTION_API_KEY');\n  const database_id = '22e5dc3676004661a16a6c45e5ee1a4c';\n\n  const url = 'https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fdatabases\u002F' + database_id + '\u002Fquery';\n\n  const payload = {\n    'filter': {\n      'property': 'タグ',\n      'multi_select': {\n        'contains': 'タグ2'\n      }\n    }\n  };\n\n  const opts = {\n    'method': 'POST',\n    'headers': {\n      'Notion-Version': '2022-06-28',\n      'Authorization': 'Bearer ' + NOTION_API_KEY,\n      'Content-Type': 'application\u002Fjson'\n    },\n    'payload': JSON.stringify(payload),\n  };\n\n    let result = JSON.parse(UrlFetchApp.fetch(url, opts));\n  \u002F\u002F 取得したページのプロパティの情報を表示\n  console.log(result.results[0].properties);\n}\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数名はqueryPageに変更したので、実行する関数をqueryPageに変更し、「実行」をクリックします。実行ログにエラーが出ず、ページの情報が表示されれば成功です。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-json text-sm\">{ 'タグ': { id: 'iZgD', type: 'multi_select', multi_select: [ [Object] ] },\n  '名前': { id: 'title', type: 'title', title: [ [Object] ] } }\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-14.png\" alt=\"関数を実行\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数を実行\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">ただし実行結果がわかりづらいので、コードの最後の部分を以下のように変更します。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-javascript text-sm\">\u002F\u002F 取得したページのプロパティの情報を表示\nconsole.log(result.results[0].properties['名前']);\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">再び実行すると以下のような出力となり、「GASで追加」のページが取得できていることがわかります。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-json text-sm\">{ id: 'title',\n  type: 'title',\n  title: \n   [ { type: 'text',\n       text: [Object],\n       annotations: [Object],\n       plain_text: 'GASで追加',\n       href: null } ] }\u003C\u002Fcode>\u003C\u002Fpre>\n      \u003Cdiv class=\"notion-callout bg-grayLight5 border-grayLight20 text-black p-4 border\">\n        \u003Cdiv class=\"flex items-start\">\n          \u003Cdiv class=\"flex-shrink-0 mr-3\">\n            \u003Ca href=\"\u002Fblog\u002Fauthors\u002Fチャベス\" class=\"flex flex-col items-center\">\n              \u003Cimg src=\"\u002Fblog\u002Ficon\u002Fchabesu.png\" alt=\"チャベスのアイコン\" class=\"w-12 h-12 rounded-full border border-grayLight20 bg-white mb-1\">\n              \u003Cspan class=\"text-xs text-black6\">チャベス\u003C\u002Fspan>\n            \u003C\u002Fa>\n          \u003C\u002Fdiv>\n          \u003Cdiv class=\"flex-1\">\n            \u003Cdiv class=\"text-[.9em] leading-[1.6] font-normal tracking-[1px] flex flex-col gap-1\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">フィルタ条件の指定方法はプロパティ毎に違います。詳細は、下記の公式ページを参照して下さい。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">\u003Ca href=\"https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpost-database-query-filter\" class=\"text-black6 article-link\" target=\"_blank\" rel=\"noopener noreferrer\">Filter database entries\u003C\u002Fa>\u003C\u002Fli>\u003C\u002Ful>\u003C\u002Fdiv>\n          \u003C\u002Fdiv>\n        \u003C\u002Fdiv>\n      \u003C\u002Fdiv>\n    \n\n\u003Ca href=\"#gasで取得したnotionのデータをスプレッドシートに入力\" id=\"gasで取得したnotionのデータをスプレッドシートに入力\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">GASで取得したNotionのデータをスプレッドシートに入力\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">データベースから以下の条件に該当するページを取得し、スプレッドシートのA1 セルに「名前」プロパティ、B1 セルに「タグ」プロパティを書き込みます。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">「タグ」プロパティが「タグ2」に等しい\u003C\u002Fli>\u003C\u002Ful>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">事前にスプレッドシートのIDを取得しておきます。スプレッドシートのIDは スプレッドシートのURLのうちの一部です。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">今回のスプレッドシートのURLは以下です。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-plain text text-sm\">https:\u002F\u002Fdocs.google.com\u002Fspreadsheets\u002Fd\u002F1ZXbGHy7-mKEqQK0bOQLX7W77EVgJxAQHxcM4mHDcRGI\u002Fedit#gid=0\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">上記のURLのうち、1ZXbGHy7-mKEqQK0bOQLX7W77EVgJxAQHxcM4mHDcRGIの部分がスプレッドシートのIDです。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">また、今回のスプレッドシートのシート名は「シート1」です。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">ページを検索（取得） → スプレッドシートに書き込むコードは以下です。\u003C\u002Fp>\u003Cpre class=\"bg-grayLight5 border border-grayLight20 p-4 overflow-x-auto mb-4\">\u003Ccode class=\"language-javascript text-sm\">function main() {\n  \u002F\u002F スプレッドシートのID\n  const sheet_id = \"1ZXbGHy7-mKEqQK0bOQLX7W77EVgJxAQHxcM4mHDcRGI\"\n  \u002F\u002F スプレッドシートのシート名\n  const sheet_name = \"シート1\"\n\n  const NOTION_API_KEY = PropertiesService.getScriptProperties().getProperty('NOTION_API_KEY');\n  const database_id = '22e5dc3676004661a16a6c45e5ee1a4c';\n\n  const url = 'https:\u002F\u002Fapi.notion.com\u002Fv1\u002Fdatabases\u002F' + database_id + '\u002Fquery';\n\n  const payload = {\n    'filter': {\n      'property': 'タグ',\n      'multi_select': {\n        'contains': 'タグ2'\n      }\n    }\n  };\n\n  const opts = {\n    'method': 'POST',\n    'headers': {\n      'Notion-Version': '2022-06-28',\n      'Authorization': 'Bearer ' + NOTION_API_KEY,\n      'Content-Type': 'application\u002Fjson'\n    },\n    'payload': JSON.stringify(payload),\n  };\n\n  let result = JSON.parse(UrlFetchApp.fetch(url, opts));\n  let page_name = result.results[0].properties[\"名前\"].title[0].plain_text;\n  let tag_name = result.results[0].properties[\"タグ\"].multi_select[0].name;\n\n  \u002F\u002Fスプレッドシートのシートのクラスを取得\n  const sheet = SpreadsheetApp.openById(sheet_id).getSheetByName(sheet_name);\n\n  sheet.getRange(\"A1\").setValue(page_name);\n  sheet.getRange(\"B1\").setValue(tag_name);\n}\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-15.png\" alt=\"関数を実行\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">関数を実行\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">成功すると、以下のようにスプレッドシートのA1 セルに「名前」プロパティ、B1 セルに「タグ」プロパティが書き込まれます。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">\u003C\u002Fp>\u003Cfigure>\n    \u003Cimg src=\"\u002Fblog\u002Fimages\u002Fpost\u002F2023-09-22-gas-notion-api-16.png\" alt=\"GASでスプレッドシートに書き込み\" class=\"border border-grayLight20 md:max-w-[80%] m-auto\" loading=\"lazy\">\n    \u003Cfigcaption class=\"text-center leading-5\" style=\"font-size: .85rem; color: #999;\">\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">GASでスプレッドシートに書き込み\u003C\u002Fp>\u003C\u002Ffigcaption>\n  \u003C\u002Ffigure>\u003Cp>\u003C\u002Fp>\u003Ca href=\"#notionに蓄積されたデータを1日に1回-スプシに吐き出し\" id=\"notionに蓄積されたデータを1日に1回-スプシに吐き出し\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">Notionに蓄積されたデータを1日に1回 スプシに吐き出し\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">以下の記事では、\u003C\u002Fp>\u003Col class=\"list-decimal pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">Notion側に蓄積されたデータをGAS（Google Apps Script）を使って1日に1回Googleシートに吐き出し\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">Notion側で付けたタグごとにGoogleシート内で集計\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">Googleシート内でグラフとして可視化\u003Cbr>ということをGASで行っています（GASを使うのは 1. のみ）。GASを使った実践的なNotion APIの使い方が載っているので、ぜひ参考にしてみてください。\u003C\u002Fli>\u003C\u002Fol>\u003Ca href=\"#notion-apiの公式ページ\" id=\"notion-apiの公式ページ\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">Notion APIの公式ページ\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">Notion APIについてさらに詳しく知りたい方は、Notion APIの公式ページを参照してください。\u003C\u002Fp>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">例えば、今回解説した内容は公式では以下のリンクに掲載されています。\u003C\u002Fp>\u003Cul class=\"list-square pl-6\">\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">データベースにページを作成：\u003Ca href=\"https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpost-page\" class=\"text-black6 article-link\" target=\"_blank\" rel=\"noopener noreferrer\">Create a page\u003C\u002Fa>\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">データベースのページを更新：\u003Ca href=\"https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fupdate-a-database\" class=\"text-black6 article-link\" target=\"_blank\" rel=\"noopener noreferrer\">Update a database\u003C\u002Fa>\u003C\u002Fli>\u003Cli class=\"text-[15px] md:text-[16px] leading-[1.9] [li+&amp;]:mt-1\">データベースからページを検索（取得）：\u003Ca href=\"https:\u002F\u002Fdevelopers.notion.com\u002Freference\u002Fpost-database-query\" class=\"text-black6 article-link\" target=\"_blank\" rel=\"noopener noreferrer\">Query a database\u003C\u002Fa>\u003C\u002Fli>\u003C\u002Ful>\u003Ca href=\"#おわりに\" id=\"おわりに\" style=\"pointer-events: none; cursor: text;\">\u003Ch2 class=\"blog-heading mt-8 mb-3 font-feature-palt\">おわりに\u003C\u002Fh2>\u003C\u002Fa>\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">今回は、GASを使用してNotion APIを使用する方法を紹介しました。JavaScriptやPythonでNotion APIを使用する方法については以下の記事を参考にしてください。\u003C\u002Fp>\u003Chr>\n\u003Cp class=\"text-[15px] md:text-[16px] leading-[1.9]\">参考：\u003Ca href=\"https:\u002F\u002Fsqripts.com\u002F2022\u002F07\u002F07\u002F20402\u002F\" class=\"text-black6 article-link\" target=\"_blank\" rel=\"noopener noreferrer\">Notion APIを使ってみた話 | Sqripts\u003C\u002Fa>\u003C\u002Fp>",[45,49,53,56,59,62,65,68,71,74,77,80],{"id":46,"text":47,"type":48},"gasgoogle-apps-scriptの使い方","GAS（Google Apps Script）の使い方","heading_2",{"id":50,"text":51,"type":52},"gasgoogle-apps-script-とは","GAS（Google Apps Script） とは","heading_3",{"id":54,"text":55,"type":52},"google-apps-scriptエディタの開き方","Google Apps Scriptエディタの開き方",{"id":57,"text":58,"type":52},"gasでこんにちはと表示","GASで「こんにちは」と表示",{"id":60,"text":61,"type":48},"gasのスクリプトプロパティにインテグレーションキーを登録","GASのスクリプトプロパティにインテグレーションキーを登録",{"id":63,"text":64,"type":48},"gasでデータベースにページを作成","GASでデータベースにページを作成",{"id":66,"text":67,"type":48},"gasでデータベースのページを更新","GASでデータベースのページを更新",{"id":69,"text":70,"type":48},"gasでデータベースからページを検索取得","GASでデータベースからページを検索（取得）",{"id":72,"text":73,"type":48},"gasで取得したnotionのデータをスプレッドシートに入力","GASで取得したNotionのデータをスプレッドシートに入力",{"id":75,"text":76,"type":48},"notionに蓄積されたデータを1日に1回-スプシに吐き出し","Notionに蓄積されたデータを1日に1回 スプシに吐き出し",{"id":78,"text":79,"type":48},"notion-apiの公式ページ","Notion APIの公式ページ",{"id":81,"text":81,"type":48},"おわりに",[],[],1795082103579]