Accessing documentation as Markdown
Most pages on the Fastly documentation site are available in Markdown format. This makes it easy for AI assistants, large language models (LLMs), agent frameworks, and developer tools to retrieve and use Fastly technical content without parsing HTML.
Why Markdown?
HTML pages are optimized for humans using web browsers. They contain navigation, scripts, styles, and other structural markup that is noise for automated tools. Markdown gives you the same content in a format that is:
- Compact: stripped of navigation, scripts, and layout markup
- Structured: headings, code blocks, and tables are preserved with standard Markdown syntax
- Machine-readable: easy to tokenize, chunk, and embed for LLM pipelines
- Copy-pasteable: useful as context in prompts or as source material for tools
Appending .md to any URL
The simplest way to access a page as Markdown is to append .md to any documentation URL:
| HTML page | Markdown equivalent |
|---|---|
https://www.fastly.com/documentation/guides/getting-started/domains/about-domains/ | https://www.fastly.com/documentation/guides/getting-started/domains/about-domains.md |
https://www.fastly.com/documentation/reference/vcl/functions/strings/regsuball/ | https://www.fastly.com/documentation/reference/vcl/functions/strings/regsuball.md |
Sending an Accept header
You can also request Markdown by sending an Accept: text/markdown header with any GET request. The response will include a Content-Type: text/markdown; charset=utf-8 header.
curl -H "Accept: text/markdown" https://www.fastly.com/documentation/guides/getting-started/domains/about-domains/Markdown for AI clients
Our site serves Markdown automatically to known AI user agents, including Claude, ChatGPT, Perplexity, and similar tools. These clients don't need to send an Accept: text/markdown header. The documentation site detects them and responds with Markdown by default.
If you are building an AI agent or tool that fetches Fastly documentation, you can rely on .md URLs or the Accept header for consistent Markdown responses regardless of the user agent.
Markdown button
Most documentation pages display a Markdown button in the top-right area of the content, next to the page title. The button opens a menu with three options:
- View page: opens the Markdown version of the current page in a new tab
- Copy content: copies the full Markdown text to your clipboard
- Copy link: copies the
.mdURL to your clipboard
The button is available on content pages that have a Markdown equivalent and is the fastest way to grab Markdown for a specific page when browsing the documentation manually or pointing an AI assistant at a URL.
Searching for pages
To find a page to fetch as Markdown when you don't know its URL, use the documentation search endpoint. It's the fastest way for AI assistants and LLMs to locate pages ranked by relevance.
curl -s "https://api.fastly.com/public-search/docs?query=image%20optimizer&limit=25"No authentication is required. The query parameter is the search term (URL-encode spaces as %20). The limit parameter caps the number of results (default is 100). The JSON response is shaped as { "record_count": N, "records": [...] }, where each record describes a matching page.
{ "group": "Guides", "term": "About Fastly Image Optimizer", "url": "https://fastly.com/documentation/guides/full-site-delivery/image-optimization/about-fastly-image-optimizer/", "description": "An overview of Fastly Image Optimizer.", "headings": ["How it works", "Enabling Image Optimizer"], "highlight": { "term": "About Fastly <em>Image</em> <em>Optimizer</em>" }}The most useful fields are term (the page title), url (the page's HTML URL), group (the documentation section), and highlight (the matched text wrapped in <em> tags).
Search results return HTML page URLs, not Markdown. To fetch the Markdown for a result:
- Normalize the host. Some results are returned on the apex
fastly.comhost, which only redirects to the canonicalwww.fastly.com. Rewritefastly.comtowww.fastly.comto fetch the Markdown directly and avoid the redirect. Leavedocs.fastly.comURLs as-is. - Strip any trailing slash and
#fragment. - Append
.md.
| Search result URL | Markdown URL |
|---|---|
https://fastly.com/documentation/guides/.../about-fastly-image-optimizer/ | https://www.fastly.com/documentation/guides/.../about-fastly-image-optimizer.md |
Search can surface pages that the Markdown index does not, such as product descriptions on docs.fastly.com.
Markdown index
Our site publishes a machine-readable index of all available Markdown pages at:
https://www.fastly.com/documentation/markdown-index.jsonThe index is a JSON file organized by content category (guides, reference, solutions, developers) with a flat allPages array for convenience. Each entry includes the page title, a short description, and the Markdown URL.
This index is useful for:
- Discovering what content is available without crawling the site
- Building search indexes or embeddings over the full documentation set
- Populating retrieval stores for LLM pipelines
llms.txt
Our site publishes an llms.txt file. This is a curated plain-text index of the most important documentation pages, grouped by topic area:
https://www.fastly.com/documentation/llms.txtThe llms.txt file follows the llmstxt specification and provides a quick starting point for AI systems that need an overview of available content without processing the full index.