A developer using Claude Code to build an agent that reads public Notion pages needs structured text output, not rendered HTML. Notion's block-based rendering produces deeply nested HTML with inconsistent class names and dynamically generated attributes that break most standard parsers. The official Notion API requires workspace-level OAuth permissions and does not support public page access without an integration. EnConvert's Perceive endpoint accepts any public Notion URL and returns the page content as clean markdown, removing both problems in a single API call. The developer receives headings, body text, lists, tables, and inline formatting preserved exactly as authored, ready for Claude Code to consume directly.
How to Scrape Notion with Claude Code
Use EnConvert's Perceive endpoint to scrape public Notion pages into clean markdown for Claude Code agents without workspace permissions or Notion HTML parsing
Get API keyExample
python
import requests
import anthropic
API_KEY = "sk_your_enconvert_api_key"
NOTION_URL = "[•public Notion page URL]"
# Step 1: Convert the public Notion page to clean markdown
# direct_download returns the markdown bytes as the response body
response = requests.post(
"https://api.enconvert.com/v2/perceive",
headers={
"X-API-Key": API_KEY,
"Content-Type": "application/json",
},
json={
"url": NOTION_URL,
"outputs": ["markdown"],
"direct_download": True,
},
)
response.raise_for_status()
markdown = response.text
print(markdown)
# Step 2: Pass the markdown into a Claude API messages payload
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-model",
max_tokens=4096,
messages=[
{
"role": "user",
"content": f"Read the following Notion documentation and answer questions using only the provided content.\n\n{markdown}"
}
],
)
# content is a list of typed blocks — thinking blocks come first on Opus 5
for block in message.content:
if block.type == "text":
print(block.text)
What you get back
The Perceive endpoint returns headings at correct hierarchy levels, body paragraphs, ordered and unordered lists, table rows with columns, and inline styles like bold and italic as standard markdown, with Notion UI chrome, breadcrumbs, share buttons, sidebar toggles, and block-level UUID metadata removed. Direct Notion HTML scraping yields deeply nested div structures where text content is buried under multiple wrapper layers, and dynamic content rendered via JavaScript after page load never appears in the initial HTTP response.