---
title: "Scrape Stripe Docs with OpenAI Agents SDK — EnConvert API"
description: "Use EnConvert’s Perceive endpoint to scrape Stripe docs into clean Markdown for your OpenAI Agents SDK pipeline without custom parsers or preprocessing"
canonical: "https://www.enconvert.com/solutions/scrape-stripe-docs-with-openai-agents-sdk-enconvert-api"
locale: "en"
---

# How to Scrape Stripe Docs with OpenAI Agents SDK

If you are building an OpenAI Agents SDK agent that needs to read Stripe documentation, you need clean structured content from pages that were built for browsers, not for language models. Stripe’s documentation is JavaScript-rendered, which means a standard requests call returns the page shell with placeholder elements where the API reference content should be, and a generic scraper returns raw HTML cluttered with navigation menus, sidebar elements, and cookie banners that inflate token usage and obscure the content your agent needs. Maintaining custom scraping and cleanup logic adds work whenever Stripe updates its page structure. EnConvert’s Perceive endpoint runs a full browser pass, strips the surrounding noise, and returns the Stripe documentation content as clean Markdown ready to pass into an OpenAI Agents SDK agent as context or store in a retrieval layer.

## Example

```python
import os

import requests
from agents import Agent, Runner

ENCONVERT_API_KEY = os.environ["ENCONVERT_API_KEY"]

# Step 1: Scrape the Stripe docs page with Enconvert Perceive
perceive_response = requests.post(
    "https://api.enconvert.com/v2/perceive",
    headers={
    headers={
        "X-API-Key": ENCONVERT_API_KEY,
        "Content-Type": "application/json",
    },
    json={
        "url": "https://docs.stripe.com/api/charges",
        "outputs": ["markdown"],
    },
    timeout=120,
)
perceive_response.raise_for_status()
perceived = perceive_response.json()

if perceived.get("error") or "markdown" not in perceived.get("outputs", {}):
    raise RuntimeError(f"Perceive failed: {perceived.get('error')}")

# The markdown is a signed artifact URL (valid 15 minutes). Plain GET, no API key.
markdown_response = requests.get(perceived["outputs"]["markdown"]["url"], timeout=60)
markdown_response.raise_for_status()
markdown = markdown_response.text

# Step 2: Pass the Markdown into an OpenAI Agents SDK agent as context
agent = Agent(
    name="Stripe Docs Assistant",
    instructions=f"""You answer questions about the Stripe API.

Stripe documentation:
{markdown}

Use this context to answer questions about endpoints, parameters, and error codes.""",
)

result = Runner.run_sync(agent, "What parameters are required to create a charge?")
print(result.final_output)
```

## Output

Perceive returns the Stripe documentation page as clean Markdown: the API reference or guide content with headings, parameters, code examples, and tables preserved, and navigation menus, cookie banners, sidebar elements, and JavaScript-rendered noise stripped before the response is returned. A standard requests call to the same URL returns the pre-render HTML shell with empty content placeholders where the documentation should be, because Stripe’s docs require JavaScript execution to populate the page body. A generic scraper that runs JavaScript still returns raw HTML with surrounding markup that requires significant preprocessing before any of it is usable as agent context.

## Get started

[Get free API key — 500 ops per month, no card required.](https://www.enconvert.com/auth?mode=signup)

## Related solutions

- [How to Summarise Notion Pages with Claude Code](https://www.enconvert.com/solutions/summarise-notion-pages-in-claude-code-enconvert-api.md)
- [How to Summarise Medium Articles with AutoGen](https://www.enconvert.com/solutions/summarise-medium-articles-with-autogen-enconvert-api.md)
- [How to Summarise Substack Newsletters with LangChain](https://www.enconvert.com/solutions/summarise-substack-newsletters-with-langchain-enconvert.md)
- [How to Summarise Wikipedia Articles with LlamaIndex](https://www.enconvert.com/solutions/summarise-wikipedia-articles-with-llamaindex-enconvert-api.md)
- [Best Firecrawl Alternative for RAG Pipeline Ingestion](https://www.enconvert.com/solutions/best-firecrawl-alternative-enconvert-api.md)
- [How to Scrape Jira with AutoGen](https://www.enconvert.com/solutions/scrape-jira-with-autogen-enconvert-api.md)
