Aerostack
memory

int-notion-page-content Edge Function — Ai

AI

Reads the full content (blocks) of a Notion page — paragraphs, headings, lists, code blocks — and returns both structured blocks and plain text.

navin @navin verified
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.. 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
Variable Required Description
NOTION_API_KEY Yes Notion 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

Field Type Required Default Description
pageId string Yes The Notion page ID to read content from
pageSize number No 100 Number of blocks to return (1-100)
startCursor string No Pagination 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

upgrade Version 1.0.4
gavel License MIT
language Language typescript
cloud Provider aerostack

Required Secrets

Add these in your Aerostack dashboard under Project → Secrets.

  • key NOTION_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 serverless edge function for ai automation written in aerostack. Deploy it to Cloudflare Workers via your Aerostack workspace.

How do I deploy the int-notion-page-content function? +

Install the Aerostack CLI and run: ```bash aerostack deploy function @navin/int-notion-page-content ``` It will be live on Cloudflare Workers in seconds.

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

int-notion-page-content runs on aerostack on the Cloudflare Workers edge runtime — zero cold starts, globally distributed.

Can I customise the int-notion-page-content function? +

Yes. Fork the function from your Aerostack dashboard, modify the source, and redeploy. All changes are version-controlled.