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.
1
query findAlerts {
2
alerts(
3
where: {
4
company: {
5
id: { in: [334, 1842] }
6
},
7
publishedAt: {
8
gte: "2021-01-01",
9
lte: "2021-02-01"
10
}
11
}
12
) {
13
id
14
text
15
title
16
company {
17
displayName
18
}
19
}
20
}
Copied!

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.
1
query findAlerts($after: ID!, $where: AlertBoolExpression!) {
2
alerts(
3
first: 100,
4
after: $after,
5
where: $where,
6
) {
7
text
8
title
9
class {
10
label
11
}
12
}
13
}
Copied!
where argument could have the following shape:
1
{
2
"publishedAt": { "gt": "2021-01-01" }
3
}
Copied!

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.
1
query findAlerts {
2
alerts {
3
id
4
dataset
5
class {
6
code
7
label
8
}
9
title
10
text
11
source
12
value
13
variable
14
company {
15
id
16
displayName
17
homepage
18
}
19
period
20
publishedAt
21
occuredAt
22
}
23
}
Copied!
Last modified 7mo ago
Copy link