notion-hello-world
Create a minimal working Notion API example. Use when starting a new Notion integration, testing your setup, or learning basic Notion API patterns (search, pages, users). Trigger with phrases like "notion hello world", "notion example", "notion quick start", "simple notion code", "first notion API call".
Best use case
notion-hello-world is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Create a minimal working Notion API example. Use when starting a new Notion integration, testing your setup, or learning basic Notion API patterns (search, pages, users). Trigger with phrases like "notion hello world", "notion example", "notion quick start", "simple notion code", "first notion API call".
Teams using notion-hello-world should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/notion-hello-world/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How notion-hello-world Compares
| Feature / Agent | notion-hello-world | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Create a minimal working Notion API example. Use when starting a new Notion integration, testing your setup, or learning basic Notion API patterns (search, pages, users). Trigger with phrases like "notion hello world", "notion example", "notion quick start", "simple notion code", "first notion API call".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Notion Hello World
## Overview
Three minimal examples covering the Notion API core surfaces: searching for pages, creating a test page in a database, and verifying the created page by retrieving it back.
## Prerequisites
- Completed `notion-install-auth` setup
- `NOTION_TOKEN` environment variable set (internal integration token from https://www.notion.so/my-integrations)
- At least one database shared with your integration via the Connections menu
- Node.js 18+ with `@notionhq/client` or Python 3.8+ with `notion-client`
## Instructions
### Step 1: Search for Pages in Your Workspace
```typescript
import { Client } from '@notionhq/client';
const notion = new Client({ auth: process.env.NOTION_TOKEN });
async function searchPages(query: string) {
const { results } = await notion.search({
query,
filter: { property: 'object', value: 'page' },
sort: { direction: 'descending', timestamp: 'last_edited_time' },
page_size: 5,
});
for (const page of results) {
if (page.object === 'page' && 'properties' in page) {
// Title lives under a property with type "title"
const titleProp = Object.values(page.properties).find(
(p) => p.type === 'title'
);
const title = titleProp?.type === 'title'
? titleProp.title.map((t) => t.plain_text).join('')
: '(untitled)';
console.log(`Page: ${title} (${page.id})`);
}
}
return results;
}
// Usage: searchPages('meeting notes');
```
**What this does:** The `search` endpoint queries across all pages and databases your integration can access. The `filter` narrows results to pages only (use `value: 'database'` for databases). Results come back as partial page objects with properties included.
### Step 2: Create a Test Page in a Database
```typescript
async function createTestPage(databaseId: string) {
const page = await notion.pages.create({
parent: { database_id: databaseId },
properties: {
Name: {
title: [{ text: { content: 'Hello from the API!' } }],
},
},
// Optional: add inline content blocks
children: [
{
heading_2: {
rich_text: [{ text: { content: 'Getting Started' } }],
},
},
{
paragraph: {
rich_text: [
{ text: { content: 'This page was created via the ' } },
{ text: { content: 'Notion API' }, annotations: { bold: true } },
{ text: { content: ' at ' + new Date().toISOString() + '.' } },
],
},
},
],
});
console.log(`Created page: ${page.id}`);
console.log(`URL: ${page.url}`);
return page;
}
```
**What this does:** `pages.create` adds a new row to the target database. The `properties` object must match the database schema — `Name` with type `title` is the only universally required property. The optional `children` array appends block content (headings, paragraphs, to-dos, etc.) directly at creation time instead of requiring a separate `blocks.children.append` call.
### Step 3: Verify by Retrieving the Created Page
```typescript
async function verifyPage(pageId: string) {
const page = await notion.pages.retrieve({ page_id: pageId });
// Extract title
if ('properties' in page) {
const titleProp = Object.values(page.properties).find(
(p) => p.type === 'title'
);
const title = titleProp?.type === 'title'
? titleProp.title.map((t) => t.plain_text).join('')
: '(untitled)';
console.log(`Verified: "${title}"`);
console.log(`Created: ${page.created_time}`);
console.log(`Last edited: ${page.last_edited_time}`);
console.log(`URL: ${page.url}`);
}
return page;
}
```
**What this does:** `pages.retrieve` fetches the full page object including all properties. This confirms the page was created correctly and lets you inspect its metadata. The response includes `created_time`, `last_edited_time`, `url`, and the full `properties` object matching the parent database schema.
## Output
- Search results listing pages your integration can access
- Newly created page in the target database with title and block content
- Verification output confirming the page exists with correct metadata
## Error Handling
| Error | HTTP Code | Cause | Solution |
|-------|-----------|-------|----------|
| `unauthorized` | 401 | Invalid or expired token | Verify `NOTION_TOKEN` value at notion.so/my-integrations |
| `object_not_found` | 404 | Page/database not shared with integration | Add your integration via the page's Connections menu (... > Connect to) |
| `validation_error` | 400 | Property name/type mismatch | Retrieve the database schema with `databases.retrieve` first |
| `rate_limited` | 429 | Exceeded 3 requests/second | Wait for `Retry-After` header value, then retry |
| `conflict_error` | 409 | Transaction conflict | Retry the request after a brief delay |
## Examples
### Complete TypeScript Script
```typescript
import { Client } from '@notionhq/client';
const notion = new Client({ auth: process.env.NOTION_TOKEN });
async function main() {
// 1. List users to verify connectivity
const { results: users } = await notion.users.list({});
console.log(`Connected! ${users.length} user(s) in workspace.\n`);
// 2. Search for a database to use as the target
const { results } = await notion.search({
query: 'test',
filter: { property: 'object', value: 'page' },
});
console.log(`Found ${results.length} page(s) matching "test".\n`);
// 3. Find a database for page creation
const dbSearch = await notion.search({
filter: { property: 'object', value: 'database' },
});
const db = dbSearch.results[0];
if (!db) {
console.log('No databases found. Share a database with your integration first.');
return;
}
console.log(`Using database: ${db.id}\n`);
// 4. Create a test page
const page = await notion.pages.create({
parent: { database_id: db.id },
properties: {
Name: { title: [{ text: { content: 'Hello World!' } }] },
},
});
console.log(`Created page: ${page.id}`);
console.log(`URL: ${page.url}\n`);
// 5. Verify it exists
const verified = await notion.pages.retrieve({ page_id: page.id });
console.log(`Verified: created at ${verified.created_time}`);
}
main().catch(console.error);
```
### Python Example
```python
import os
from notion_client import Client
notion = Client(auth=os.environ["NOTION_TOKEN"])
# 1. Search for pages
results = notion.search(
query="test",
filter={"property": "object", "value": "page"},
)
print(f"Found {len(results['results'])} page(s)")
# 2. Find a database
db_results = notion.search(
filter={"property": "object", "value": "database"},
)
db_id = db_results["results"][0]["id"]
print(f"Using database: {db_id}")
# 3. Create a test page
page = notion.pages.create(
parent={"database_id": db_id},
properties={
"Name": {"title": [{"text": {"content": "Hello from Python!"}}]},
},
)
print(f"Created page: {page['id']}")
print(f"URL: {page['url']}")
# 4. Verify
verified = notion.pages.retrieve(page_id=page["id"])
print(f"Verified: created at {verified['created_time']}")
```
## Resources
- [Notion API Getting Started](https://developers.notion.com/docs/create-a-notion-integration)
- [Search Endpoint Reference](https://developers.notion.com/reference/post-search)
- [Create a Page Reference](https://developers.notion.com/reference/post-page)
- [Retrieve a Page Reference](https://developers.notion.com/reference/retrieve-a-page)
- [Working with Page Content](https://developers.notion.com/docs/working-with-page-content)
## Next Steps
Proceed to `notion-local-dev-loop` for development workflow setup.Related Skills
workhuman-hello-world
Workhuman hello world for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman hello world".
wispr-hello-world
Wispr Flow hello world for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr hello world".
windsurf-hello-world
Create your first Windsurf Cascade interaction and Supercomplete experience. Use when starting with Windsurf, testing your setup, or learning basic Cascade and Supercomplete workflows. Trigger with phrases like "windsurf hello world", "windsurf example", "windsurf quick start", "first windsurf project", "try windsurf".
webflow-hello-world
Create a minimal working Webflow Data API v2 example. Use when starting a new Webflow integration, testing your setup, or learning basic Webflow API patterns — list sites, read CMS collections, create items. Trigger with phrases like "webflow hello world", "webflow example", "webflow quick start", "simple webflow code", "first webflow API call".
vercel-hello-world
Create a minimal working Vercel deployment with a serverless API route. Use when starting a new Vercel project, testing your setup, or learning basic Vercel deployment and API route patterns. Trigger with phrases like "vercel hello world", "vercel example", "vercel quick start", "simple vercel project", "first vercel deploy".
veeva-hello-world
Veeva Vault hello world with REST API and VQL. Use when integrating with Veeva Vault for life sciences document management. Trigger: "veeva hello world".
vastai-hello-world
Rent your first GPU instance on Vast.ai and run a workload. Use when starting a new Vast.ai integration, testing your setup, or learning basic Vast.ai GPU rental patterns. Trigger with phrases like "vastai hello world", "vastai example", "vastai quick start", "rent first gpu", "vastai first instance".
twinmind-hello-world
Create your first TwinMind meeting transcription and AI summary. Use when starting with TwinMind, testing your setup, or learning basic transcription and summary patterns. Trigger with phrases like "twinmind hello world", "first twinmind meeting", "twinmind quick start", "test twinmind transcription".
together-hello-world
Run inference with Together AI -- chat completions, streaming, and model selection. Use when testing open-source models, comparing model performance, or learning the Together AI API. Trigger: "together hello world, together AI example, run llama".
techsmith-hello-world
Capture a screenshot with Snagit COM API and produce a Camtasia video. Use when automating screen captures, batch-processing recordings, or building documentation pipelines with TechSmith tools. Trigger: "techsmith hello world, snagit capture, camtasia render".
supabase-hello-world
Run your first Supabase query — insert a row and read it back. Use when starting a new Supabase project, verifying your connection works, or learning the basic insert-then-select pattern with @supabase/supabase-js. Trigger with phrases like "supabase hello world", "first supabase query", "supabase quick start", "test supabase connection", "supabase insert and select".
stackblitz-hello-world
Boot a WebContainer, mount files, install npm packages, and run a dev server in the browser. Use when learning WebContainers, building browser-based IDEs, or running Node.js without a backend server. Trigger: "stackblitz hello world", "webcontainer example", "run node in browser".