code-anything.com
Sign inStart free
Developer

Insight Docs

A Quickstart page for a search API in the register of Stripe Docs and Mintlify: search-first top bar with Ask AI and product tabs, grouped sidebar, a "what you'll build" preview beside an integration-effort card, numbered steps with real code (your test key filled in), annotated code with a legend, the ranked response, a reference-style parameter list, an error table, next-step cards and an On-this-page rail.

Developer documentation & API references

dev-docs.code-anything.app
MenuGet started / Quickstart

Quickstart

Index three documents and run your first ranked search in about five minutes.

Insight is hosted search for help centres, product catalogues and internal docs. You send it documents, it builds a ranked index, and every query returns hits with a relevance score you can read and tune.

How can we help?
refund a card
  • Refund a card payment0.92
  • Partial refunds and card fees0.81
  • Why a payment shows as pending0.64

search by Insight · 14 ms

Integration effort

Complexity
Low
Time
About 5 minutes
Languages
TypeScript, Python, Go, Ruby
Runs on
Your server
Free tier
10,000 documents

Call Insight from your backend with a typed client. Recommended for most apps; this guide follows it.

Call the HTTPS endpoints directly from any language. Every sample below has a curl tab.

Drop a prebuilt search box into your site with one script tag. No backend code, less control over ranking.

Before you begin #

  • An Insight account. The free tier covers 10,000 documents and 50,000 searches a month.
  • Node.js 20 or Python 3.10 on the machine that will call the API.
  • A test key. You're signed in, so your test key is already filled into the samples below.

Build the integration #

  1. Install the SDK

    The client is a single dependency with no native modules.

    $ npm install @insight/sdk
    $ pnpm add @insight/sdk
    $ pip install insight-search
  2. Set your API key

    Keep the secret key in your server environment. The SDK reads it on start-up.

    .env.local
    INSIGHT_API_KEY=ins_test_7vKe2Rq9Lm3Q8

    Test key Filled in for maya@northwind.example · test mode

    Never ship a secret key to the browser. For search-as-you-type, mint a short-lived public token on your server with insight.tokens.create() and send that instead.

  3. Index documents

    Upsert three help-centre articles. Indexing is idempotent on id, so you can run this twice.

    scripts/seed.ts
    await insight.documents.upsert('help-center', [  { id: 'refund-card', title: 'Refund a card payment', body },  { id: 'partial-refunds', title: 'Partial refunds and card fees', body },  { id: 'pending', title: 'Why a payment shows as pending', body },])// → { indexed: 3, took_ms: 212 }
  4. Query the index. The numbered markers explain the three lines that matter.

    import { Insight } from '@insight/sdk' const insight = new Insight(process.env.INSIGHT_API_KEY)1 const res = await insight.search({  index: 'help-center',2  query: 'refund a card payment',  limit: 3,})res.hits[0].score // 0.923
    from insight import Insight insight = Insight(os.environ["INSIGHT_API_KEY"])1 res = insight.search(    index="help-center",2    query="refund a card payment",    limit=3,)res.hits[0].score # 0.923
    curl https://api.insight.example/v1/search \  -H "Authorization: Bearer $INSIGHT_API_KEY" \1  -d index=help-center \2  -d query="refund a card payment" \  -d limit=3 # → { "hits": [{ "score": 0.92, … }] }3
    1. 1The key never leaves the server. The client reads it from the environment and sends it as Authorization: Bearer.
    2. 2The index must belong to the key's project. Another project's index returns 403, not an empty result.
    3. 3Hits are ranked. Each carries a score from 0 to 1; see Ranking and filters.
    200 OK · query "refund a card payment"3 of 128 hits · 14 ms
    1. Refund a card paymenthelp-center/payments/refund-card-payment0.92
    2. Partial refunds and card feeshelp-center/billing/partial-refunds0.81
    3. Why a payment shows as pendinghelp-center/payments/pending0.64

Search parameters #

The full list lives in the Search reference. These are the ones most integrations set.

indexstringRequired

The index to search. It must belong to the same project as the key.

querystringRequired

Natural-language or keyword query, up to 512 characters.

limitinteger · default 10

Number of hits to return, from 1 to 100.

filterobject

Restrict hits by metadata before they are ranked.

Show child parameters
  • filter.collectionstring

    Only documents from this collection, for example payments.

  • filter.updated_aftertimestamp

    Only documents changed after this Unix time.

  • filter.localestring

    An IETF tag such as en-GB. Hits in other locales are dropped.

rerankboolean · default true

Re-score the top 50 candidates with the cross-encoder. Adds about 20 ms.

Test mode is free and isolated. Indexes you build with a ins_test_ key never mix with live data and are not billed. Switch to a live key when you deploy.

Handle errors #

StatusCodeWhat to do
200okRanked hits are in data.hits. Cache by query for up to 60 s.
400invalid_parameterThe message names the field. Fix it and retry.
401invalid_api_keyCheck the header and that the key is active.
403index_forbiddenUse the key of the project that owns the index.
429rate_limitedBack off until the Retry-After header has passed.

Next steps #

Was this page helpful?
Ask a question about Insight…⌘I

About Insight Docs. The category leader's docs: calm white paper, a search-first top bar, code you can paste, and every answer one scroll away.

Insight Docs is documentation the way the category leaders (Stripe Docs, Mintlify, Vercel / Next.js docs) write it, for an engineer with a terminal open in the other window. A sticky top bar puts search first (⌘K, with a ranked preview on focus), then Ask AI, Sign in and a Dashboard button, with product tabs, a live status dot and the API version beneath. The three-pane shell holds a grouped sidebar with mono HTTP verbs, a 46em article and an On-this-page rail with nested steps, an "Optional" tag and a test-key card. The article is a Quickstart: breadcrumbs, title and subtitle, page actions (Copy page, View as Markdown, Ask about this page), a browser-frame preview of the search box you will build beside an integration-effort card, a segmented path chooser (Server SDK / REST API / Search widget), prerequisites, four numbered steps on a rail with always-dark code blocks (npm / pnpm / pip tabs, a .env with the signed-in test key highlighted, a seed script, and the signature annotated search call in TypeScript / Python / curl whose numbered markers map to a legend), the 200 OK response with three ranked hits and score bars, a reference-style parameter list with expandable child parameters, an error table, three photographic next-step cards, a pager, feedback and a docked "Ask a question" bar. White paper, cool ink and one deep teal; warm amber only for warnings and error codes.

Colours and type. The palette, fonts and corners every page of Insight Docs is drawn from.

bg#FFFFFF
surface#F6F7F8
text#111418
muted#5A626D
accent#0B6E69
accent2#A8500C
border#E3E6EA
Headings

Inter Tight

Body

Inter

Radius

10px

The system, applied to any site. Every rule below travels with the template — describe your tweaks and the agent keeps the system intact.

What it decides for you

  • Write and lay it out the way the category leaders do (Stripe Docs, Mintlify, Vercel / Next.js docs): search first, a three-pane shell, a title with a one-line subtitle and page actions, steps with real code, the response next to the request, reference tables. No marketing hero, no illustrations, nothing playful.
  • White paper (#FFFFFF), wells a step greyer (#F6F7F8), cool ink (#111418), hairline borders. One deep teal (#0B6E69) means "you are here": the active tab, sidebar item and TOC entry, links, step numbers, score bars, the Dashboard button. Warm amber (accent2, anchored to a fixed #b4530a) appears only in warnings, "Required" tags, DEL verbs and error status codes.
  • Inter Tight 600–700 for headings with light tracking, Inter for prose at a 46em measure, JetBrains Mono for code, HTTP verbs, parameter names, status codes and meta; tabular figures in tables.
  • Code blocks are always dark (near-black on light presets, a step darker than the page on dark ones) with a bar holding CSS-only language or package-manager tabs and a Copy button. The signature: numbered markers at the end of the lines that matter, mapped to a numbered legend under the block. On phones lines wrap with a hanging indent so every marker stays visible.
  • Show the product and the reader's own context, as Stripe does: a "what you'll build" browser-frame preview, an integration-effort card, the signed-in test key highlighted inside the .env sample and repeated in the rail, and the 200 OK response with ranked hits and score bars under the request.
  • Reference content follows the reference register: a ruled parameter list (mono name, type, Required tag, one-line description) with "Show child parameters" disclosures, and a bordered status table that stacks on phones.
  • Three-pane shell: a 16em grouped sidebar (details groups, mono verbs), the article, and a 15em On-this-page rail; the rail hides under 1220px of container width, the sidebar becomes a details menu under 880px, and every breakpoint is a @container query.
  • Imagery is limited to the next-step cards: quiet high-key studio photographs of glass and cable objects on a pale ground, generated, never stock and never another brand's product. Colours come only from the --ca-* tokens and color-mix().

Ships with

  1. Sticky top bar: logo with DOCS tag, ⌘K search with a ranked-result preview on hover/focus, Ask AI, Sign in, Dashboard; product tabs (Get started / Guides / API reference / SDKs / Changelog) with a status dot and API version on the right
  2. Left sidebar: Get started, Guides, API reference (mono POST / GET / PATCH / DEL verbs) and Resources groups, GitHub and community links; a details menu on narrow screens
  3. Article header: breadcrumbs, "Quickstart", a subtitle, page actions (Copy page, View as Markdown, Ask about this page) and the updated date
  4. Two cards: a browser-frame preview of the help-centre search box you will build (blinking caret, three ranked results) and an Integration effort card (complexity bars, time, languages, runs on, free tier)
  5. Segmented path chooser (Server SDK / REST API / Search widget) and a "Before you begin" checklist
  6. Build the integration: four numbered steps on a rail — install (npm / pnpm / pip tabs), set your API key (.env with the test key highlighted, amber warning), index documents (seed script), run a search (annotated TypeScript / Python / curl with a numbered legend and the 200 OK ranked-hits response)
  7. Search parameters as a ruled reference list with a "Show child parameters" disclosure, a neutral test-mode note and a "Handle errors" status table
  8. Next steps: three image cards; a previous / next pager, "Was this page helpful?" and a docked "Ask a question" bar
  9. On-this-page rail with nested steps, an Optional tag, the test-key card and a help card; a four-column footer with live API status

Keep looking. More from the library, developer first.

Browse all
DeveloperForgeA Stripe-grade landing for a payments API: real product UI floating over a skewed gradient ribbon, a customer wordmark wall with scale figures, a four-product suite where every card carries its own working UI, a navy developer band with tabbed code and a changelog, an idempotency request log, published uptime beside infrastructure photography, customer stories with their numbers, per-charge pricing and an error-reference FAQ.DeveloperBeaconA crisp, light landing page for the Beacon deploy CLI in the register of Bun and Warp: a heavy condensed headline beside a tabbed benchmark chart with its method printed, a black install box with platform tabs, a customer wordmark row, four command cards, a step list that drives a real terminal session, release notes with numbers, engineers running it in production, and a checksum table beside exit codes.DeveloperUptimeA calm public status page in the register of Atlassian Statuspage and incident.io: the active incident first, a component board with 90 day bars per component, scheduled maintenance, CSS-tabbed system metrics, probe regions, a day-by-day incident log, postmortems and subscribe channels.DeveloperTrailA near-black product changelog in the register of Linear, Vercel and Raycast: a plain "Changelog" title with area tabs, a timeline with a sticky date / version / author column on a hairline rail, large launch renders and CSS-drawn product UI per release, collapsible Improvements / Fixes / API lists, a dense earlier-releases list and a subscribe card.DeveloperNimbusThe project site of a 3.1 kB reactive-state library, in the register of Tailwind CSS and Astro: a white blueprint-grid page with a huge headline, install command and black Get started pill, a dark editor beside the cart UI it renders, project figures, a reproducible benchmark chart, a feature bento, CSS-only framework tabs, a one-screen API, release notes, the community and conference, and a sponsor grid with the monthly money.DeveloperStrandlineA near-black product page for a serverless Postgres with vector search, in the register of Neon, PlanetScale and Supabase: a light-strand hero with an install command and four figures, numbered chapters (01 Query with a real SQL console, 02 Branch with a branch graph and CLI session, 03 Replicate with the replication helix and an 18-region lag ledger), a benchmark with its method, photographed NVMe hardware beside a spec sheet, a customer quote, a plan table with usage rates and compliance, an FAQ and a closing terminal.MarketingAuroraA near-black, product-first SaaS landing in the register of Linear and Vercel: a big Inter headline over the real app built in HTML, numbered chapters (1.0 Previews, 2.0 Releases, 3.0 Analytics) each opening on a working UI fragment, isometric FIG figures, photographed customer proof and a plain pricing table.MarketingWarm ArtisanA quiet, editorial site for a sourdough bakery in the register of Poilâne and Tartine: a full-bleed oven-mouth hero with a live oven panel, product cards shot on linen, a ruled daily board with sell-out times, the shopfront at dawn, a 46-hour loaf timeline and a pre-order form.BookingSharp FadeAn editorial barbershop site in the register of Fellow Barber and Murdock London: bone ground, a literary serif and tracked small caps, documentary photography, a price list with minutes, barbers with their next free slot and a real CSS-only booking panel.DashboardCockpitA product-analytics board in the register of Mixpanel, Amplitude and PostHog: a Linear-style sidebar, filter chips, a written weekly summary, KPI cells, an annotated trend, a breakdown, a funnel, retention curves, a cohort heatmap, an accounts list and an annotation feed.The libraryAll 104 templates.Every category — stores, booking, portfolios, dashboards — in real code.

Make it yours in minutes.

Start from this template and describe your tweaks — content, sections, colours. The backend and deploy are handled.