ChatGPT APIlearn.chatgpt.com ↗
Search the full ChatGPT and OpenAI documentation. Returns ranked hits with title, URL, section, hierarchy, and content snippets via one endpoint.
What is the ChatGPT API?
The learn.chatgpt.com API exposes 1 endpoint — search_docs — that runs full-text search across ChatGPT and OpenAI documentation, including guides, API references, and cookbooks. Each response returns an array of ranked documentation fragments, with up to 7 fields per hit: title, url, section, hierarchy, content snippet, query, and total_hits, giving precise coverage of the official documentation index.
curl -X POST 'https://api.parse.bot/scraper/7196313b-3f63-447b-9648-04684885f288/search_docs' \
-H 'X-API-Key: $PARSE_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "lvl1",
"query": "prompting",
"section": "chatgpt_docs",
"hits_per_page": "10",
"hierarchy_lvl0": "Documentation",
"pathname_prefix": "/docs"
}'Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace learn-chatgpt-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: ChatGPT Docs SDK — bounded, re-runnable; every call capped."""
from parse_apis.ChatGPT_Docs_API import ChatGPTDocs, ParseError
client = ChatGPTDocs()
# Search documentation for a topic — limit caps total items.
for doc in client.search_results.search(query="prompting", limit=3):
print(doc.title, doc.url, doc.section)
# Filter to a specific section and pathname prefix.
hit = client.search_results.search(query="models", section="chatgpt_docs", pathname_prefix="/docs", limit=1).first()
if hit:
print(hit.title, hit.hierarchy.lvl0, hit.hierarchy.lvl1)
# Typed error handling around a search call.
try:
for item in client.search_results.search(query="realtime", type="lvl1", hierarchy_lvl0="Documentation", limit=2):
print(item.title, item.pathname)
except ParseError as e:
print(f"error: {e}")
print("exercised: search_results.search")
Full-text search across ChatGPT and OpenAI documentation. Returns ranked results with title, URL, section, hierarchy, and content snippets. Results are auto-iterated; each hit is one indexed documentation fragment (a heading or content block). Optional client-side filters narrow results by section, fragment type, hierarchy level, or pathname prefix.
| Param | Type | Description |
|---|---|---|
| type | string | Filter results by fragment type level (e.g. "lvl1", "lvl2", "lvl3"). |
| queryrequired | string | Search query text to match against documentation titles and content. |
| section | string | Filter results to a specific documentation section (e.g. "chatgpt_docs", "api", "cookbook"). |
| hits_per_page | integer | Maximum number of results to return per request. |
| hierarchy_lvl0 | string | Filter results by the top-level hierarchy category (e.g. "Documentation"). |
| pathname_prefix | string | Filter results to entries whose pathname starts with the given prefix (e.g. "/docs/prompting"). |
{
"type": "object",
"fields": {
"query": "the search query that was executed",
"results": "array of documentation search hits with title, url, section, hierarchy, and content snippet",
"total_hits": "total number of matching results in the index"
},
"sample": {
"query": "prompting",
"results": [
{
"url": "https://learn.chatgpt.com/docs/prompting",
"type": "lvl1",
"title": "Prompting",
"anchor": "",
"section": "chatgpt_docs",
"pathname": "/docs/prompting",
"hierarchy": {
"lvl0": "Documentation",
"lvl1": "Prompting",
"lvl2": null,
"lvl3": null
},
"source_kind": "docs",
"content_snippet": ""
}
],
"total_hits": 90
}
}About the ChatGPT API
What the API covers
The search_docs endpoint indexes the full contents of learn.chatgpt.com, which mirrors official ChatGPT and OpenAI documentation: model guides, API reference pages, prompt engineering cookbooks, fine-tuning walkthroughs, safety documentation, and integration guides. Each indexed unit is a documentation fragment — a heading or content block — rather than a whole page, so results are granular and scoped to the relevant section.
Endpoint inputs and response shape
The search_docs POST endpoint accepts two parameters: query (required string) and hits_per_page (optional integer to cap result volume). The response always includes query (the executed search string), total_hits (total matching fragments in the index), and results — an array of hits. Each hit carries title, url, section, hierarchy, and a content snippet. The hierarchy field reflects where the fragment sits within the documentation tree, which is useful for grouping or filtering results by doc type or guide category.
Practical notes
Results are auto-iterated, meaning each element in the results array is one independent documentation fragment. A single guide page can appear as multiple hits if several of its sections match the query. The url field in each hit points directly to the source page, including any anchor for the specific section. There is no built-in filter parameter for doc category or content type beyond adjusting hits_per_page; query specificity is the primary control over result relevance.
The ChatGPT API is a managed, monitored endpoint for learn.chatgpt.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when learn.chatgpt.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official learn.chatgpt.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a documentation chatbot that retrieves context-accurate snippets from official OpenAI guides using
contentandhierarchyfields. - Monitor documentation coverage gaps by querying specific API features and checking
total_hitsfor zero-result queries. - Power an IDE extension that surfaces relevant ChatGPT API reference sections while a developer writes code.
- Aggregate related documentation fragments across sections using the
hierarchyfield to build structured topic summaries. - Create a changelog tracker by periodically querying known features and comparing returned
urlandcontentvalues over time. - Build a search layer for an internal developer portal that resurfaces official OpenAI documentation alongside proprietary guides.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does OpenAI provide an official developer API for searching its documentation?+
What does the `hierarchy` field in each result contain?+
hierarchy field reflects the structural position of a documentation fragment within the docs tree — for example, which top-level guide or API reference section it belongs to. This lets you group or filter results by documentation category without parsing the url.Does the API return full page content or just snippets?+
content snippet for the matched fragment, not the full text of the documentation page. A single page may appear as multiple hits if several sections match, but the full rendered content of any page is not returned. You can fork this API on Parse and revise it to add a page-fetch endpoint if you need complete page content.Can I filter results by documentation type — for example, only cookbook entries or only API reference pages?+
search_docs endpoint does not currently expose a filter parameter for documentation type or category. You can narrow results through query phrasing and use the hierarchy and url fields in the response to classify hits client-side. You can fork this API on Parse and revise it to add a category filter parameter if you need server-side filtering.