Skip to main content
POST
/
search
/
{collection}
Search via Typesense
curl --request POST \
  --url http://localhost:5001/search/{collection} \
  --header 'X-blnk-key: <api-key>'
Use client.Search.SearchDocument to search records in a collection.
1

Call the method

client.Search.SearchDocument
searchResult, resp, err := client.Search.SearchDocument(
	blnkgo.SearchParams{
		Q: "payment",
		QueryBy: "description",
		PerPage: 20,
	},
	blnkgo.Transactions,
)
FieldTypeDescription
QstringSearch query text. Use * to return all records.
QueryBystringComma-separated list of fields to search in.
FilterBystringFilter conditions to refine results.
SortBystringSort order, for example created_at:desc.
PageintPage number, starting at 1.
PerPageintResults per page. Max 250, defaults to 10.
resourceblnkgo.ResourceTypeCollection to search: Transactions, Balances, Ledgers, or Identities.
2

Use the search results

Read searchResult.Hits for matching documents. Each hit includes a Document with fields such as TransactionID, Amount, and Status.
3

Response

201 Created
{
  "found": 2,
  "out_of": 232,
  "page": 1,
  "request_params": {
    "collection_name": "transactions",
    "per_page": 10,
    "q": "payment"
  },
  "search_time_ms": 2,
  "facet_counts": [],
  "search_cutoff": false,
  "hits": [
    {
      "document": {
        "id": "txn_cd728825-a6e1-4fae-9277-c3235a045ea5",
        "transaction_id": "txn_cd728825-a6e1-4fae-9277-c3235a045ea5",
        "amount": 532,
        "currency": "USD",
        "description": "Test transaction",
        "source": "bln_93fb50c2-969e-49c2-bb61-ef5ed245516e",
        "destination": "bln_20666087-1355-4736-ba04-3ba92a7542b9",
        "status": "APPLIED",
        "created_at": 1758116489
      },
      "highlights": [],
      "text_match": 578730123365711993
    }
  ]
}
FieldTypeDescription
foundnumberNumber of records matching the query.
out_ofnumberTotal records in the collection.
pagenumberCurrent page number.
search_time_msnumberTime taken to run the search, in milliseconds.
hitsobject[]Array of results, each with a document and optional highlights and text_match.

How search works

Query syntax, indexing, and use cases.

Search via Typesense

HTTP request and response schema.

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.