# Index Public API Documentation

Source: https://openflow.run/zh-tw/templates/index-public-api-documentation/
Content language: en
Template revision: d291811835b4d4defcd934c79186ed436e74219f

開發者工具

Find one service’s public REST API documentation and index the relevant passages in Qdrant.

[在 Open Flow 中使用](https://console.openflow.run/flows?importUrl=https%3A%2F%2Fraw.githubusercontent.com%2Foomol-lab%2Fawesome-workflow-templates%2Fd291811835b4d4defcd934c79186ed436e74219f%2Fworkflows%2Findex-public-api-documentation%2Ftemplates%2Findex-public-api-documentation.openflow.json)

*   [Open Flow JSON](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/index-public-api-documentation/templates/index-public-api-documentation.openflow.json)
*   [n8n JSON](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/index-public-api-documentation/templates/index-public-api-documentation.n8n.json)

![Index Public API Documentation 在 Open Flow 中的工作流程截圖](https://openflow.run/template-previews/index-public-api-documentation/light.webp)

Find one service’s public REST API documentation and index the relevant passages in Qdrant.

## Setup

1.  Connect Firecrawl for search and page reads, and connect Gemini in **Classify REST API documentation** and **Embed the approved chunks** with Provider API access. Use sites whose public documentation you are authorized to index. The chosen text is sent to Gemini and stored in your Qdrant collection.
2.  Connect Qdrant Cloud in **Index the approved documents**. Use a collection with an unnamed 768-dimensional cosine vector. Create a new collection or re-embed older documents before mixing vectors from another model. A retrieval workflow must use the same Gemini embedding model, dimensionality and corresponding retrieval query framing. [Gemini embedding guide](https://aistudio.google.com/docs/embeddings)
3.  Run the workflow or call it from a published Open Flow workflow with this input:

```json
{
  "eventType": "research",
  "data": {
    "service": "Example API",
    "url": "https://example.com",
    "collection": "api_documentation"
  }
}
```

## Behavior

Firecrawl searches the hostname supplied in the request. The workflow reads up to ten distinct HTTPS results on that hostname or its subdomains and uses the first 12,000 characters of each readable page. Gemini judges the first 3,500 characters of each page for relevance. Documents that describe REST API operations or schemas are split into chunks of up to 2,000 characters and embedded with Gemini Embedding 2. Each Qdrant point contains its original chunk in `content` and the service and page URL in `metadata`. The workflow reads documentation pages only.

The `response` output is `ok` after Qdrant confirms the batch. Successful searches with no scoped results return `no web results`. If none of the selected pages can be read, the response is `web scraping error`. If none of the readable pages are classified as API documentation, the response is `no api docs in web results`. A failed request, invalid Gemini output or unconfirmed Qdrant write can fail the run.

A repeat upsert uses the same IDs for unchanged chunks. Edited pages may leave older points behind. Inspect the collection after an uncertain write. The caller may pass `data.row_number`, as in the source. A Sheet coordinator can use that row number to record the response.

In n8n

For a manual run, edit **Set manual research request**. A parent workflow can instead call **Research request** with the same JSON input. Keep one research request per sub-workflow execution.

Set the Qdrant cluster HTTPS origin in **Index the approved documents**. Use native Header Auth credentials with `Authorization: Bearer <key>` on both Firecrawl requests, `x-goog-api-key` on both Gemini requests, and `api-key` on the Qdrant request. Keep redirects disabled.

Inspiration & credits

## Changes to the source

*   Use Firecrawl search and Markdown reads for public documentation. Scope results to the supplied website and keep the original service and page URL with each chunk.
*   Use the current Gemini classification and embedding APIs and a confirmed Qdrant batch upsert. Retain the separate callable research status.

Adapted from the Stage 1 research sub-workflow in [API Schema Extractor](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/Other_Integrations_and_Use_Cases/API%20Schema%20Extractor.json) from [enescingoz/awesome-n8n-templates](https://github.com/enescingoz/awesome-n8n-templates).

Source collection notice: © 2024–2026 Enes Cingoz, [CC BY 4.0](https://github.com/enescingoz/awesome-n8n-templates/blob/827110332c21cbe000ab13f6d292d5adb1f1f8db/LICENSE). This adaptation includes the changes above. See [repository licensing](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/README.md#licensing).

## 使用的應用

*   [**Firecrawl**`firecrawl`](https://openflow.run/zh-tw/integrations/firecrawl.md)
*   [**Gemini**`gemini`](https://openflow.run/zh-tw/integrations/gemini.md)
*   [**Qdrant Cloud**`qdrant`](https://openflow.run/zh-tw/integrations/qdrant.md)

## 設定需求

*   Firecrawl and Gemini connections
*   Qdrant connection and a collection with unnamed 768-dimensional cosine vectors

*   api
*   documentation
*   gemini
*   qdrant
*   firecrawl

[在 GitHub 查看](https://github.com/oomol-lab/awesome-workflow-templates/blob/d291811835b4d4defcd934c79186ed436e74219f/workflows/index-public-api-documentation/README.md)
