サンプル
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
このセクションでは、Google スライドの意図したアクションを Google スライド API リクエストに変換する方法を示す一連のサンプル アプリケーションと「レシピ」の例を紹介します。
Codelab

Slides の Codelab では、Google Slides API をカスタム プレゼンテーション ツールとして使用して、最もよく使われているソフトウェア ライセンスの分析結果を報告する方法を学習します。
このチュートリアルでは、BigQuery を使用して GitHub のすべてのオープンソース コードに対してクエリを実行し、Slides API を使用して結果をプレゼンテーションするためのファイルを作成する方法を学びます。
サンプル アプリケーション

Markdown to Slides コマンドライン ツールを使用すると、マークダウン ファイルからスライドデッキを生成できます。
このリポジトリを使用して Slides API を探索したり、リポジトリをフォークしてコードを変更し、JavaScript アプリケーションに Slides の出力を提供したりできます。
レシピ
このセクションの例では、スライドの一般的なアクションを Slides API リクエストとして表現する方法を示します。
これらの例は、言語に依存しない HTTP リクエストとして示されています。Google API クライアント ライブラリを使用して特定の言語で Slides API リクエスト プロトコルを実装する方法については、次のガイドをご覧ください。
このセクションのレシピは、次のカテゴリに分類されています。
Slides API を使用して特定のタスクを完了する方法は、多くの場合複数あります。可能な限りバッチメソッド presentations.batchUpdate
を使用して、複数の更新リクエストを 1 つのメソッド呼び出しにバンドルします。これにより、クライアントの HTTP オーバーヘッドが減少し、クエリの数が減り、プレゼンテーションの変更数が最小限に抑えられ、すべての変更がアトミックに適用されます。
パフォーマンスをさらに向上させるには、プレゼンテーション、ページ、ページ要素の読み取りと更新を行うときにフィールド マスクを使用します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[],[],null,["# Samples\n\nThis section presents a set of sample applications and \"recipe\" examples that\ndemonstrate how to translate an intended Google Slides action into an\nGoogle Slides API request.\n\nCodelabs\n--------\n\nThe [Slides\ncodelab](https://codelabs.developers.google.com/codelabs/slides-api)\nteaches you how to use Google Slides API as a custom presentation tool for an\nanalysis of the most common software licenses.\n\nYou'll learn how to query all open source code on GitHub using [BigQuery](https://cloud.google.com/bigquery) and create a\nslide deck using Slides API to present your results.\n\nSample applications\n-------------------\n\nThe [Markdown to\nSlides](https://github.com/googleworkspace/md2googleslides)\ncommand-line tool lets you generate slide decks from markdown files.\n\nYou can use this to explore the Slides API, or fork the repository and\nmodify the code to provide Slides output to your JavaScript\napplication.\n\nRecipes\n-------\n\nThe examples listed in this section demonstrate how to express common actions in\nSlides as Slides API requests.\n\nThese examples are presented as HTTP requests to be language neutral. To learn\nhow to implement Slides API request protocols in a specific language\nusing Google API client libraries, see the following guides:\n\n- [Create a slide](/workspace/slides/api/guides/create-slide)\n- [Add shapes and text](/workspace/slides/api/guides/add-shape)\n- [Merge data into a presentation](/workspace/slides/api/guides/merge)\n- [Add charts to a slide](/workspace/slides/api/guides/add-chart)\n- [Edit and style text](/workspace/slides/api/guides/styling)\n\nRecipes in this section are divided into the following categories:\n\n- [Basic reading](/workspace/slides/api/samples/reading)---Recipes that show common ways of reading information from a presentation.\n- [Basic writing](/workspace/slides/api/samples/writing)---Recipes that show common ways of writing to a presentation.\n- [Element operations](/workspace/slides/api/samples/elements)---Recipes that show common page element creation and editing tasks.\n- [Presentation operations](/workspace/slides/api/samples/presentation)---Recipes that show how to create and manipulate a presentation.\n- [Slide operations](/workspace/slides/api/samples/slides)---Recipes that show how to create, move, and delete slides in a presentation.\n- [Table operations](/workspace/slides/api/samples/tables)---Recipes that show how to create and edit tables within a slide.\n- [Transform operations](/workspace/slides/api/samples/transform)---Recipes that show how to alter the size and positioning of elements within a slide.\n\nThere's often more than one way to complete a given task with the\nSlides API. Use the batch method\n[`presentations.batchUpdate`](/workspace/slides/api/reference/rest/v1/presentations/batchUpdate)\nwherever possible to bundle multiple update requests into a single method call.\nThis reduces client HTTP overhead, reduces the number of queries, minimizes the\nnumber of revisions on the presentation, and applies all the changes atomically.\n\nTo further improve performance, use [field\nmasks](/workspace/slides/api/guides/field-masks) when reading and updating presentations,\npages, and page elements."]]