Search & metadata

Search via Typesense

Search a collection with filtering, sorting, and pagination.

POST/search/{collection}

Authorization

If set, the API uses an API key for authentication. Include the following header in your requests: X-blnk-key: <api-key>.

Replace <api-key> with your secret API key. Ensure the key is kept secure and not exposed in public repositories or client-side code.

See also: Core API key.

The Search API enables you to retrieve one or more records from your ledger with advanced filtering, sorting, and full-text search capabilities. Unlike standard GET endpoints, the Search API gives you more control over your results.

Path

collectionstringrequiredpath

The collection to search. Supported values:

  • transactions - Search through all transaction records
  • balances - Find balance records across all ledgers
  • ledgers - Locate specific ledgers by name or metadata
  • identities - Search customer identity records

Body

qstringrequiredbody

The search query text. Use * to return all records. Supports full-text search when combined with query_by. Learn more: Querying

query_bystringbody

Comma-separated list of fields to search in. When provided, performs field-specific searches. Learn more: Querying

Examples:

  • "source,destination" - Search in source and destination fields
  • "first_name,last_name,email" - Search in identity name and email fields
filter_bystringbody

Filter conditions to refine results. Supports operators like :=, :>, :<, :>=, :<=, :!=, and ranges. Learn more: Filtering

Examples:

  • "status:=APPLIED" - Filter by exact status
  • "amount:>1000" - Filter by amount greater than 1000
  • "status:=APPLIED && currency:=USD" - Multiple conditions
  • "created_at:[1704067200..1706745599]" - Date range filter
sort_bystringbody

Sorting conditions for ordering results. Format: field:direction where direction is asc or desc. Multiple fields: field1:desc,field2:asc. Learn more: Sorting

Examples:

  • "created_at:desc" - Sort by creation date descending
  • "amount:desc,created_at:asc" - Sort by amount then date
pageintegerbody

Page number for pagination. Starts at 1. Default: 1. Learn more: Pagination

per_pageintegerbody

Number of results per page. Maximum 250, default 10. Learn more: Pagination

Response

foundinteger

Total number of matching records.

hitsarray

Array of search results. Each hit contains a document object with the record data and optional highlights for matched terms.

out_ofinteger

Total number of records in the collection (regardless of filters).

pageinteger

Current page number.

per_pageinteger

Number of results per page.

search_time_msinteger

Time taken to execute the search in milliseconds.

highlightsarray

Search term highlighting information for matched fields. Only present when full-text search matches are found.