Search API

A complete results page from one API call

Hits, filter counts, typo corrections and popular items for an empty search come back from one request, ranked with your merchandising. A typed TypeScript SDK and an OpenAPI spec come with it, and search runs in the EU.

curl -sL "https://search.typemo.com/v1/collections/products/search" \
  -H "X-API-Key: sq_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "q": "snekers", "perPage": 5 }'

Works with your stack

  • TypeScript
  • Node.js
  • JavaScript
  • React
  • Vue
  • Svelte
  • OpenAPI
  • TypeScript
  • Node.js
  • JavaScript
  • React
  • Vue
  • Svelte
  • OpenAPI

How it works

From key to results in three steps

The same index serves your widget, your code and your AI agents.

  1. Create a key A read-only key for browsers and apps, and a write key that stays on your server.
  2. Send your documents Push JSON from your server, or connect a store, a feed, a database or a crawl.
  3. Search Call the search endpoint from any language, or use the TypeScript SDK.

Capabilities

Built for the search UI you design

Typo tolerance, synonyms and your ranking apply to every request, exactly as in the widget.

The response

Everything a results page needs, in one response

Hits, facet counts, slider ranges, the corrected query, popular items for a search that finds nothing and a redirect come back together. One call draws the whole page.

Response
Response
{
  "found": 3,
  "hits": [
    { "title": "Court Sneakers", "price": 79.99, "_score": 5.34 },
    { "title": "Trail Sneakers", "price": 64.99, "_score": 4.91 }
  ],
  "facets": { "brand": [["Stride", 2], ["Acme", 1]] },
  "facetStats": { "price": { "min": 49.99, "max": 79.99 } },
  "correctedQuery": "sneakers",
  "fallback": null,
  "redirect": null
}

Query features

Filters, variants, similar items and autocomplete

Combine filters with AND, OR and NOT, show one result per product with its variants counted, build a similar-items row from one id and add completions as visitors type. A filter on a misspelled field answers 400, so a bug never ships as unfiltered results.

Parameters
"filter": {
  "AND": [
    { "field": "brand", "op": "in", "value": ["Acme"] },
    { "field": "price", "op": "lte", "value": 100 },
    { "NOT": { "field": "color", "op": "eq", "value": "pink" } }
  ]
}

TypeScript SDK

Typed from the same spec as the API

One client for search, documents, synonyms, custom results and analytics, on Node 18 and later and in browsers. Your document type types the hits, and a failed call throws an error with the status and the parameter at fault.

TypeScript SDK
TypeScript SDK
interface Product { title: string; price: number; brand: string }

const results = await typemo.search<Product>('products', {
  q: 'sneakers',
  sort: 'price:asc'
});

results.hits[0]?.title;   // typed: string
results.fallback?.hits;   // popular items on a miss

await typemo.documents.upsert('products', { documents });

Merchandising

Dashboard rules apply to every API search

Pins, boosts and redirects your team sets in the dashboard shape API results exactly as they shape the widget’s, with no deploy.

Merchandising
Custom results: Summer edit with four pins, Gift guide pinning by a rule, Returns page sending its query to a page

Analytics

Your own UI, the same analytics

Send searches, clicks, add-to-carts and purchases from your UI, and they fill the dashboard and the popularity that orders your results, as the widget’s events do.

Analytics events
Top five queries with their searches, clicks, CTR, average position and growth

Ready for production

Sub-50 ms in region

Searches answer in under 50 ms at p95 in your region, and every response reports its own search time.

Built-in caching

Repeated searches come from a short cache, and search keeps answering from a saved copy during a brief outage.

Keys for each place

Read-only keys answer only on the domains you allow. Write keys stay on your server, and either can be limited to one collection.

OpenAPI spec

Generate a client for any language from the same document the SDK and the API reference come from.

Large documents

Documents of up to 100 KB with up to 256 fields, and up to 1,000 documents per request.

Plans by volume

A plan is sized by searches a month and documents held. A search past the plan is never billed.

FAQ

Frequently asked questions

Contact our team

One index for your widget, your API calls and your agents.