<br />

The Gemini Notebook API is a REST interface for programmatically creating and
managing notebooks and sources in Gemini Notebook. Ingest web pages, YouTube
videos, plain text, Markdown, and uploaded files (such as PDFs, documents,
audio, and images) into persistent notebooks.

> [!WARNING]
> **Early Access Public Preview:** The Gemini Notebook API and
> [MCP server](https://developers.google.com/notebook/docs/mcp.md.txt) are in an early access Public
> Preview, and we're actively working on our
> [roadmap](https://developers.google.com/notebook/docs/roadmap.md.txt). We'd love to hear what you want
> the API and MCP server to do. Please
> [file
> feature requests in our Issue Tracker](https://issuetracker.google.com/issues/new?component=2300807). We're excited to build this out,
> and there's more to come!
>
> During the preview, the API is available for personal Google Accounts.
> Google Workspace accounts are not yet supported.

[Start building](https://developers.google.com/notebook/docs/quickstart.md.txt) Just want to get started? Go to the
[Quickstart](https://developers.google.com/notebook/docs/quickstart.md.txt), copy the setup prompt,
and give it to your coding agent.

### Python

```python
import requests

API = "https://notebook.googleapis.com/v1"
headers = {
    "Authorization": f"Bearer {ACCESS_TOKEN}",
    "x-goog-user-project": PROJECT_ID,
    "Content-Type": "application/json",
}

# 1. Create a notebook
nb = requests.post(f"{API}/notebooks", headers=headers, json={
    "display_name": "My Research"
}).json()

# 2. Add a source
requests.post(f"{API}/{nb['name']}/sources", headers=headers, json={
    "display_name": "Gemini API Guide",
    "web_content": {"url": "https://ai.google.dev/gemini-api/docs"}
})
```

### JavaScript

```javascript
const API = "https://notebook.googleapis.com/v1";
const headers = {
  "Authorization": `Bearer ${ACCESS_TOKEN}`,
  "x-goog-user-project": PROJECT_ID,
  "Content-Type": "application/json"
};

// 1. Create a notebook
const nb = await (await fetch(`${API}/notebooks`, {
  method: "POST",
  headers,
  body: JSON.stringify({ display_name: "My Research" })
})).json();

// 2. Add a source
await fetch(`${API}/${nb.name}/sources`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    display_name: "Gemini API Guide",
    web_content: { url: "https://ai.google.dev/gemini-api/docs" }
  })
});
```

### REST

```bash
# 1. Create a notebook
NOTEBOOK=$(curl -s -X POST "https://notebook.googleapis.com/v1/notebooks" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "x-goog-user-project: $PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{"display_name": "My Research"}')

NOTEBOOK_NAME=$(echo "$NOTEBOOK" | python3 -c "import sys, json; print(json.load(sys.stdin)['name'])")

# 2. Add a source
curl -s -X POST "https://notebook.googleapis.com/v1/${NOTEBOOK_NAME}/sources" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "x-goog-user-project: $PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "Gemini API Guide",
    "web_content": {"url": "https://ai.google.dev/gemini-api/docs"}
  }'
```

## Guides and resources

[REST API reference](https://developers.google.com/notebook/reference/rest.md.txt) [Notebooks
Create, list, and update notebooks.](https://developers.google.com/notebook/docs/notebooks) [Sources
Add web pages, YouTube videos, plain text, Markdown, or uploaded files to a notebook.](https://developers.google.com/notebook/docs/sources) [Model Context Protocol (MCP)
Connect AI coding agents and IDEs to the remote Gemini Notebook MCP server.](https://developers.google.com/notebook/docs/mcp) [Authentication
Configure OAuth 2.0 access tokens and scopes for API requests.](https://developers.google.com/notebook/docs/authentication) [Rate limits and quotas
Review request rate limits, per-source word limits, and tier capacity.](https://developers.google.com/notebook/docs/rate-limits) [Roadmap
See items on the Gemini Notebook API roadmap.](https://developers.google.com/notebook/docs/roadmap)

## Feedback

We'd love to hear what you want the Gemini Notebook API and
[MCP server](https://developers.google.com/notebook/docs/mcp.md.txt) to do. See our
[roadmap](https://developers.google.com/notebook/docs/roadmap.md.txt) for upcoming capabilities, and
[file feature requests or bug reports in our Issue Tracker](https://issuetracker.google.com/issues/new?component=2300807).