ポッドキャストを生成する(API メソッド)
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
重要: Podcast API へのアクセスは、一部の Google Cloudのお客様が利用できます。詳細やこの機能の使用のお申し込みについては、Google Cloud 営業担当者 にお問い合わせください。
Gemini Enterprise には、ソースドキュメントに基づいてポッドキャストを生成できる API が用意されています。出力は、エンドユーザーがノートブック内から生成できるポッドキャストと非常によく似ています。
API を介したポッドキャストの生成は、数十冊または数百冊の書籍、記事、コースがあり、それぞれにポッドキャストを生成する場合のバッチジョブに適しています。
Podcast API はスタンドアロンの API です。つまり、NotebookLM Enterprise ノートブック、Gemini Enterprise ライセンス、データストアは必要ありません。必要なのは、有効な Google Cloud プロジェクトと Podcast API ユーザーのロールだけです。
API の入力は context
要素の配列です。これは、ポッドキャストの生成元となるソースマテリアルです。入力は、テキスト、画像、音声、動画の形式にできます。コンテキスト配列のコンテンツの合計は 100,000 トークン未満にする必要があります。
サポートされているタイプの一覧については、Gemini 2.5 Flash に関するこのページの画像、ドキュメント、動画、音声の技術仕様をご覧ください。
出力
API からの出力は、MP3 形式のポッドキャストです。
始める前に
API を使用してポッドキャストを生成するには、次のものが必要です。
コンテキスト入力からポッドキャストを生成する
次のコマンドを使用して、podcast メソッドを呼び出してポッドキャストを生成します。
入力は、テキスト、画像、音声クリップ、動画クリップなどのマルチメディア オブジェクトの配列です。
REST
ポッドキャストを生成してエクスポートする手順は次のとおりです。
次の curl コマンドを実行します。
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID /locations/global/podcasts" \
-d '{
"podcastConfig": {
"focus": "FOCUS ",
"length": "LENGTH ",
"languageCode": "LANGUAGE_CODE "
},
"contexts": [
{
"MEDIA_TYPE_1 ": "MEDIA_CONTENT_1 "
},
{
"MEDIA_TYPE_2 ": "MEDIA_CONTENT_2 "
}
],
"title": "PODCAST_TITLE ",
"description": "PODCAST_DESCRIPTION "
}'
次のように置き換えます。
PROJECT_ID
: 実際のプロジェクトの ID。
FOCUS
: ポッドキャストの焦点となる内容を提案するプロンプト。
LENGTH
: 次の 2 つのオプションがあります。
SHORT
(通常 4 ~ 5 分)
STANDARD
(通常は約 10 分ですが、データセットが小さい場合は短くなることがあります)
LANGUAGE_CODE
: 省略可。ポッドキャストの言語コードを指定します。BCP47 で定義されている言語タグを使用します。言語コードが指定されていない場合、ポッドキャストは英語で生成されます。
MEDIA_TYPE_N
: ポッドキャストの生成に使用するメディアのタイプを指定します。使用できる型は次のとおりです。
text
。書式なしテキスト。
blob
。プレーン テキスト以外のすべてのメディア タイプでは、このタイプを使用して、データを未加工のバイトとしてアップロードします。
MEDIA_CONTENT_N
: プレーン テキストまたは未加工のバイト形式のコンテンツ自体。コンテキスト配列の合計コンテンツは 100K トークン未満にする必要があります。
PODCAST_TITLE
: ポッドキャストのタイトル。これは内部で使用することも、エンドユーザーに表示することもできます。
PODCAST_DESCRIPTION
: ポッドキャストの説明。これは内部で使用することも、エンドユーザーに表示することもできます。
コマンドの例と結果
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1/projects/my-project-123/locations/global/podcasts" \
-d '{
"podcastConfig": {
"focus": "Can you talk about how to find a job in Google?",
"length": "SHORT"
},
"contexts": [
{
"text": "Breaking into Google is a highly competitive endeavor, attracting millions of applicants globally due to its reputation as a top employer, its innovative work, and comprehensive perks. Success hinges on a multi-faceted approach, starting with meticulously tailored online applications that incorporate job description keywords for ATS and showcasing Googlyness—a blend of curiosity, collaborative spirit, and leadership potential. The rigorous, multi-stage interview process involves recruiter screens, behavioral interviews (often using the STAR method), and for technical roles, demanding coding challenges and system design questions that assess not just correct answers but also problem-solving thought processes and communication skills. Networking for referrals and informational interviews can significantly boost visibility, but ultimately, thorough preparation through mock interviews and platforms like LeetCode, combined with patience and resilience through the often lengthy process, are paramount for navigating this challenging but rewarding path."
},
{
"text": "Finding your way into a career at Google begins with their comprehensive careers website, a digital gateway brimming with opportunities. To embark on this journey, you first navigate the job board, using keywords like software engineer or product manager to pinpoint potential roles. To refine your search, utilize the array of filters available for location, experience level, degree, skills, and even specific Google organizations. You can even browse by team if you have a particular department in mind, like Engineering and Technology or Marketing and Communications. Once you discover a promising position, delve into its detailed description, paying close attention to the minimum qualifications – these are the foundational criteria against which your application will be assessed. Remember, Google seeks out leaders who can perform at the highest level, and while experience is valued, internships or graduate programs can be a great entry point for those earlier in their career. When you are ready to apply, you will need to create a Careers Profile, using your Google Account for seamless sign-in and communication. Crucially, tailor your resume for each specific role, highlighting relevant experiences and quantifying your achievements with concrete data. While a one-page resume is generally preferred, a two-page resume is acceptable for those with more extensive experience. Notably, cover letters are not typically required unless explicitly stated in the job description. Google encourages quality over quantity, so strategically apply for up to three jobs every 30 days, choosing roles that truly align with your skills and passions. Once you have submitted your applications, your Careers Profile becomes your tracking center, where you can monitor the status of each submission, from Draft to Submitted. If you do not hear back within eight weeks, the search continues, though Google recruiters may proactively reach out for other opportunities later. Remember, perseverance and a solid understanding of Google values, combined with a continuously refined skill set and a well-prepared resume, will greatly enhance your chances of securing a position at this innovative company."
}
],
"title": "Find a job at Google ",
"description": "This podcast is based on two plain text documents that describe various aspects of getting a job at Google."
}'
{
"name": "projects/123456/locations/global/operations/create-podcast-54321"
}
ポッドキャストの生成には数分かかります。
オペレーション名をメモします。ステップ 4 でポッドキャストをダウンロードする際に必要になります。上記の例では、オペレーション名は projects/123456/locations/global/operations/create-podcast-54321
です。
省略可。ポッドキャスト作成オペレーションのステータスをポーリングします。長時間実行オペレーションの詳細を取得する をご覧ください。
オペレーションが完了したら、次の curl コマンドを実行してポッドキャストをダウンロードします。
curl -v \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://discoveryengine.googleapis.com/v1/OPERATION_NAME :download?alt=media" \
--output FILENAME .mp3 -L
次のように置き換えます。
OPERATION_NAME
: ステップ 2 でメモしたオペレーションの名前。
FILENAME
: ポッドキャストのファイル名。
このコマンドは、ポッドキャストをローカル ディレクトリの MP3 ファイルにダウンロードします。
コマンドの例と結果
curl -v \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://discoveryengine.googleapis.com/v1/projects/123456/locations/global/operations/create-podcast-54321:download?alt=media" \
--output my-podcast.mp3 -L
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Host discoveryengine.googleapis.com:443 was resolved.
...
{ [42044 bytes data]
100 14.3M 100 14.3M 0 0 10.9M 0 0:00:01 0:00:01 --:--:-- 29.7M
* Connection #0 to host discoveryengine.googleapis.com left intact
コンプライアンス
Podcast API は、顧客管理の暗号鍵である Gemini Enterprise の CMEK に準拠していません。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンス により使用許諾されます。コードサンプルは Apache 2.0 ライセンス により使用許諾されます。詳しくは、Google Developers サイトのポリシー をご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-10-19 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-10-19 UTC。"],[],[]]