LLM and Search Engine Discoverability
Swagger Portal makes the content of your public products easy for search engines, crawlers, and large language models (LLMs) to find and read. Portal generates the required files and metadata automatically for every published public product. You don’t need to configure anything.
Only public products are discoverable. Search engines and LLMs can’t access private products. See Product Types.
What Portal Generates
| Resource | Location | Purpose |
|---|---|---|
| Sitemap | /sitemap.xml |
Lists all public pages of your portal for search engine crawlers. |
| llms.txt file | /llms.txt |
Lists all public pages and APIs in a format that LLMs can read. |
| Markdown page versions | <page URL>.md |
Returns the content of a page as clean Markdown. |
| API definition links | On each API page | Link to the raw API definition in JSON and YAML format. |
| Meta descriptions | Page header | Describe each page to search engines. |
| Canonical URLs | Page header | Give each page a single address. |
| Structured data | Page header | Describe the page type and its position in the portal. |
All resources are available on the default portal domain and on your custom domain, if you configured one.
Sitemap
Portal generates a sitemap at the root of your portal, for example:
https://<portal name>.portal.swaggerhub.com/sitemap.xml
The sitemap lists all public pages of your portal. The robots.txt file of your portal references the sitemap, so search engine crawlers find it automatically.
llms.txt File
The llms.txt file is a proposed standard that helps LLMs read the content of a website. It works like a sitemap, but in a format that LLMs can process more easily.
Portal generates the file at the root of your portal, for example:
https://<portal name>.portal.swaggerhub.com/llms.txt
The file lists every published page in your public products. Each entry links to the Markdown version of the page. Each API entry also links to the raw API definition in JSON and YAML format.
Markdown Page Versions
Every published page is available as clean Markdown. To get the Markdown version of a page, add .md to the end of the page URL, for example:
https://<portal name>.portal.swaggerhub.com/<product>/docs/<page>.md
Portal processes each page type as follows:
-
HTML pages. Portal converts the content to Markdown.
-
Markdown pages. Portal returns the content unchanged.
-
API pages. Portal links to the raw API definition.
The header of each page includes an alternate link to its Markdown version, so LLMs can find it without the llms.txt file.
To view the Markdown version of a page, do the following:
- Open the page in the consumer view.
- In the browser address bar, add
.mdto the end of the URL. - Press Enter.
API Definition Links
Portal renders API documentation in the browser after the page loads, so crawlers and LLMs can’t read it from the page itself. To solve this, each API page includes links to the raw API definition in JSON and YAML format. The llms.txt file lists the same links.
Page Metadata
Portal adds the following metadata to the header of every page:
-
Meta description. A description of the page content that search engines show in search results.
-
Canonical URL. The single preferred address of the page. The canonical URL doesn’t include query strings or fragments, so tracking parameters, such as
utm_source,gclid, orfbclid, don’t create duplicate addresses for the same page. -
Structured data. JavaScript Object Notation for Linked Data (JSON-LD) that describes the page. Portal uses the
WebSite,TechArticle,APIReference, andBreadcrumbListtypes.
How LLMs Read Your Portal
An LLM typically reads your portal in the following order:
- The LLM reads the page HTML directly. Portal renders pages on the server, so the content is available without running scripts.
- If the LLM can’t read the page, it uses the sitemap or the
llms.txtfile to find all pages. - The LLM requests the Markdown version of each page.
Limitations
-
Only public products are discoverable. Private products aren’t available to search engines or LLMs.
-
You can’t edit the
robots.txtorllms.txtfile. Portal generates both files. -
You can’t edit the title or meta description of individual pages. Portal generates them from the page content.
-
You can’t opt in to or opt out of LLM training and data scraping. Portal uses the default behavior of browsers and crawlers.
-
You can’t add organization contact details to the structured data.
-
The sitemap doesn’t include last modified dates.