Query examples
This page provides additional examples of various queries for Alerts API
Find Alerts for a set of Companies between certain dates
We're using where
filter with multiple fields to find all of the Alerts from January 2021 for two given companies. You may find more details about filters in Alerts API in the Filtering and sorting guide.
Find all Alerts from a certain date till now
Such a query might potentially return more entities than allowed per page. Please see the Alerts API pagination guide for more details on how to work with paginated queries.
where
argument could have the following shape:
Fetch all available Alert fields
This query demonstrates all of the fields currently available on the Alert node. You may find the full type definitions available in the Alerts API Reference.
Fetch all available Commodity Alerts since the given date
Please, note that particular dataset and class availability depends on your contractual agreement with Craft. Reach out to sales@craft.co for additional details.
This query filters alerts by the dataset
and publishedAt
fields.
where
object could have the following shape:
The query may return more than 100 records for a single request if there were more Alerts published during the given period of time. In order to fetch all of the records, please refer to the Alerts Pagination Guide.
You may also apply additional filters and sorting order if needed.
Filter Alerts by Polarity
This query shows how to find Alerts that have certain intent or sentiment (positive, negative or neutral) associated with them.
polarity
field is an Int
where all the values below 0
represent a negative sentiment and all values above - represent a positive one.
In addition to gt
, lt
and eq
, you may use other IntComparisonExpression operators as needed.
Last updated