Features/API Reference

API Reference

Complete reference for FlowSearch JavaScript API and REST endpoints.

Widget Scripts

Most installations should use the hosted scripts and data attributes instead of a JavaScript constructor.

Search Bar Script (all pages)

Place this in the site-wide head/custom-code area. Thedata-results-page value must match the published website page slug. Some sites already use/search, so the recommended default is /search-results.

<script
  src="https://www.flowsearch.io/widget.js"
  data-key="YOUR_SEARCH_KEY"
  data-results-page="/search-results"
  data-live="true">
</script>

Results Page Script (search results page only)

Place this only on the Search Results page in page-specific head/custom-code area.

<script
  src="https://www.flowsearch.io/results.js"
  data-key="YOUR_SEARCH_KEY"
  data-summary="true">
</script>

Browser Helper

After the Search Bar Script loads, window.FlowSearch exposes a small helper for diagnostics and custom integrations.

HelperDescription
FlowSearch.search(query)Navigate to the configured results page with a query
FlowSearch.fetchResults(query)Fetch results without navigating, useful for diagnostics
FlowSearch.configRead the loaded script configuration
window.FlowSearch.search('website design');
window.FlowSearch.fetchResults('pricing').then(console.log);
console.log(window.FlowSearch.config);

REST API

FlowSearch also provides a search endpoint for server-side integrations and diagnostics.

Authentication

Pass your public Search Key as a query parameter or as an X-API-Key header.

X-API-Key: YOUR_SEARCH_KEY

Search Endpoint

GET /api/search

Query parameters:

ParameterTypeDescription
qstringSearch query, up to 200 characters
keystringSearch Key, optional if using the header
pagenumberPage number, defaults to 1
per_pagenumberResults per page, defaults to 10 and is capped by plan

Example request:

curl -X GET "https://www.flowsearch.io/api/search?q=website&per_page=10" \
  -H "X-API-Key: YOUR_SEARCH_KEY"

Example response:

{
  "results": [
    {
      "title": "Getting Started with Website",
      "description": "Learn the basics of your website...",
      "url": "/blog/getting-started-website",
      "highlights": []
    }
  ],
  "meta": {
    "found": 24,
    "page": 1,
    "per_page": 10,
    "performance_tier": "pro",
    "performance_profile": "Performance"
  }
}

Search speed and request limits are plan-based. Free sites use shared free search infrastructure, Basic uses standard paid search, Pro and Business use performance search, and Enterprise can use dedicated search infrastructure. If a plan limit is exceeded, the endpoint returns 429 withSEARCH_RATE_LIMIT_EXCEEDED or MONTHLY_SEARCH_QUOTA_EXCEEDED.

AI Summary Endpoint

POST /api/summarize

The Results Page Script calls this automatically when data-summary="true" and AI summaries are enabled for the website. Initial summaries are available on all plans. Follow-up questions use mode: "followup", require a paid plan, and include a conversationId from the initial summary response.

Summary responses include conversationEnabled. When it is false, clients should hide follow-up chat. Source types can be page, document, or external. The external source labels General AI knowledge when External Knowledge is enabled. Uploaded document sources are returned only for Business and Enterprise plan sites. Document source chips are document-level, even when several internal chunks from the same document informed the answer.

Streaming responses are sent as server-sent events with meta, delta,done, and error event payloads. Older clients can continue reading incrementaltext payloads during the migration. AI questions can be up to 600 characters, AI responses are displayed up to 1,600 characters, and a conversation can include 20 user turns.

{
  "query": "What security certifications do you have?",
  "mode": "initial",
  "stream": true
}

Rate Limits

PlanSearch requests/minuteMax per pageSearch requests/monthAI credits/month
Free30101,00025
Basic602010,000250
Pro1205050,0001,000
Business18050150,0003,000
Enterprise600100CustomCustom

Next Steps