Global searches in Flare is exposed through the /search

endpoint.

This guide details a typical search use case and provides an example for how to impement it.

Use Case

  • Export all chat messages collected by Flare in the last 6 hours that match the fraud keyword.
  • Save our last page cursor so that we can resume fetching results in a future execution.

Parameters

To achieve the desired results, the following parameters will be used:

ParameterValueJustification
queryfraudThe keyword we are looking for.
litetrueQuickly browse results, but don’t ask for the full content.
types[]chat_messageRetrieve only the chat_message events.
orderascRetrieve results in ascending order so that we can resume fetching in the future.
times<from_date>@Replace <from_date> with a timestamp that corresponds to 6 hours ago and don’t set anything after the @ so that we can fetch all results until the current time.
sort_bysearchableSort results in the order that they have been added to Flare’s database.

Paging

The search endpoint uses parameters that match the Flare standard paging pattern

.

Fetching new results in future executions

It is possible to save the next in a database and use it to resume fetching new results in the future. However, it is important that future requests use the same parameters for everything else but next. Even the time filter.

End-to-End Examples

These are end-to-end examples in various programming languages.