Filter Queries
The actual values of a Data Stream can be queried and filtered using the query parameter. This allows for the selection of a subset of the data based on the records values.
Filter the data stream
GET
https://api.fusionbase.com/api/v2/stream/data/{STREAM_ID]?query_parameters={"filters": [{"property": "construction_year_end", "operator": "GREATER_THAN", "value": 2013}]}&format=json
The actual values of a Data Stream can be queried and filtered using the filters
parameter in query_parameters
. This allows for the selection of a subset of the data based on the records values.
Path Parameters
Name | Type | Description |
---|---|---|
STREAM_ID* | String | The ID of the Data Stream |
Query Parameters
Name | Type | Description |
---|---|---|
query_parameters | Object | URI encoded JSON string |
format | String | json or msgpack |
This is a sample response for a specific stream:
The Fusionbase API offers a powerful filtering capability to refine and narrow down the data retrieved from a data stream. This is achieved using the filters
parameter within the query_parameters
in your request.
Using Filters in Data Streams
Request Structure
To apply filters to your data retrieval, include the filters
parameter within the query_parameters
in your GET request to /api/v2/stream/data/{STREAM_ID}
. The filters
parameter should be formatted as a JSON object.
Filter Properties
The filters
JSON object comprises an array of filter objects, each containing the following properties:
property
: The column name in the data stream that you want to filter on.operator
: The operation to be used for filtering. Common operators includeEQUALS
,GREATER_THAN
,LESS_THAN
, etc.value
: The value to compare against the column data.
Multiple Filters
You can apply multiple filters within the same request. Each filter in the array applies to the specified property independently.
Example
Suppose you want to filter a data stream to include records where the construction_year_end
is later than 2013. The request would be structured as follows:
Notes
Ensure that the property names used in filters correspond to valid column names in the data stream.
The filter's
value
should be appropriate for the property's data type (e.g., numeric, string, date).Filters are case-sensitive and should match the exact casing of column names and operators.
Error Handling
Errors may occur if the filter criteria are not properly structured, if invalid column names are used, or if there is a data type mismatch. In such cases, the API might return an error response.
Make sure to properly URL encode the query parameters!
Last updated