Aerostack
Aerostack
memory

int-notion-page-content Function — Ai on aerostack

AI
Updated Mar 19, 2026
GitHub

Edge function int-notion-page-content Reads the full content (blocks) of a Notion page — paragraphs, headings, lists, code blocks — and returns both structured blocks and plain text.. Written in aerostack and deployed on Cloudflare Workers — zero cold starts, globally distributed. Mount it via your Aerostack workspace to call it from any AI agent.

terminal — aerostack cli
$npx aerostack add navin/int-notion-page-content
smart_toy

Use with AI Assistants

MCP

Connect Claude, Cursor, or any MCP-compatible client — then call this function by slug

① Add MCP Server

Add this once — access all Aerostack functions from your AI tool.

claude_desktop_config.json
{
  "mcpServers": {
    "aerostack": {
      "url": "https://mcp.aerostack.dev",
      "type": "http"
    }
  }
}

② Call this function

Ask your AI to use the call_function tool with this slug:

call_function
call_function({
  slug: "int-notion-page-content",
  args: {}
})

int-notion-page-content — Read the body content of a Notion page

Retrieves all content blocks (paragraphs, headings, lists, code, etc.) from a Notion page and returns both structured blocks and a plain text version.


Setup

Environment Variables

VariableRequiredDescription
NOTION_API_KEYYesNotion integration token — get yours at https://www.notion.so/my-integrations

How to set up:

  1. Go to notion.so/my-integrations and create an integration
  2. Copy the Internal Integration Secret (starts with ntn_ or secret_)
  3. In Notion, share your page/database with the integration (click ... → Connections → your integration)
  4. In your Aerostack dashboard, go to Project → Secrets → Add secret
  5. Key: NOTION_API_KEY — Value: your integration token

API

POST /api/int-notion-page-content

Request body

FieldTypeRequiredDefaultDescription
pageIdstringYesThe Notion page ID to read content from
pageSizenumberNo100Number of blocks to return (1-100)
startCursorstringNoPagination cursor from a previous response

Success response (200)

{
  "success": true,
  "data": {
    "blocks": [
      { "id": "block-id-1", "type": "heading_1", "text": "Introduction", "hasChildren": false },
      { "id": "block-id-2", "type": "paragraph", "text": "This is the first paragraph...", "hasChildren": false }
    ],
    "plainText": "Introduction\nThis is the first paragraph...",
    "hasMore": false,
    "nextCursor": null,
    "count": 2
  }
}

Usage

cURL

curl -X POST "$FUNCTION_URL" \
  -H "Content-Type: application/json" \
  -d '{ "pageId": "your-page-id" }'

Use Cases

  • Content publishing: Read a blog post draft from Notion to publish to your blog or social media.
  • AI processing: Feed page content as plain text to an LLM for summarization, translation, or reformatting.
  • Cross-platform sync: Read Notion content and sync it to other platforms.

Notes

  • plainText concatenates all block text with newlines — ideal for feeding to an LLM.
  • Nested blocks (e.g., toggle children) are indicated by hasChildren: true. Use the child block's id as pageId to read nested content.
  • Maximum 100 blocks per request. Use startCursor for pagination on long pages.

Metadata

upgradeVersion1.0.4
gavelLicenseMIT
languageLanguagetypescript
cloudProvideraerostack

Tags

No tags added yet.

Publisher

navin

@navin

Required Secrets

Add these in your Aerostack dashboard under Project → Secrets.

  • keyNOTION_API_KEY

    Notion integration token — authenticates API requests to your Notion workspace.

deployed_code

Build and publish your own functions

Write a TypeScript function, deploy it to the edge, and share it with thousands of developers — in minutes.

More ai Functions

Browse ai Functions →

Frequently asked questions

What does the int-notion-page-content function do?+

int-notion-page-content is a typescript edge function in the Ai category. It runs on aerostack with native access to database, cache, queue, AI, and storage bindings — call it from any AI workspace or directly as a REST endpoint.

How do I deploy int-notion-page-content to my Aerostack workspace?+

Install from the Aerostack marketplace in one click, or via CLI: aerostack install function navin/int-notion-page-content Once installed it appears in your workspace tools and any connected AI agent can call it.

What runtime does int-notion-page-content use?+

int-notion-page-content runs on aerostack via the Aerostack edge runtime. Aerostack injects native bindings (DB, KV cache, AI, vector search, storage, queue) so the function has zero-latency access to backend primitives without making HTTP round-trips.

Can I fork and customize int-notion-page-content?+

Yes. Fork int-notion-page-content from your Aerostack dashboard, modify the source (typescript), and redeploy. All changes are version-controlled and the original remains available to revert to.