APIYard
Back to APIs
SearchAPI KeyFree tier

Typesense

Typesense is a fast, privacy-friendly, open source search engine that is easy to self-host or use via Typesense Cloud.

Base URL

https://YOUR_CLUSTER.a1.typesense.net
open sourceself-hostvector searchtypo tolerancefast

Endpoints

GET/collections/{collection}/documents/search

Search a Typesense collection.

const response = await fetch("https://YOUR_CLUSTER.a1.typesense.net/collections/books/documents/search?q=harry+potter&query_by=title", {
  method: "GET",
  headers: {
  "Content-Type": "application/json",
  "X-TYPESENSE-API-KEY": "YOUR_API_KEY"
  }
});

const data = await response.json();
console.log(data);

Response Preview

{
  "found": 7,
  "hits": [{
    "document": {
      "id": "1",
      "title": "Harry Potter and the Sorcerer's Stone",
      "author": "J.K. Rowling",
      "year": 1997
    },
    "highlight": { "title": { "snippet": "<mark>Harry Potter</mark> and the Sorcerer's Stone" } }
  }]
}