We use cookies to ensure you get the best experience on our website. Some of these cookies are provided by third parties. You are free to decide which categories you would like to permit and can withdraw this consent at any time (via cookie preferences link on the footer).
By accepting the necessary cookies, you agree to our privacy policy and terms of service, both located in the footer of the website.
Learn more on our terms of service and privacy policy.
The AskNews Alerts API allows you to create and manage alerts for specific topics, news or events. For example, you can create an alert with a query like "Alert me when a protest breaks out in Paris" and get an email when this happens. Or you can generate a daily newsletter about a topic you are interested in.
You define the actions to be taken when the alert is triggered, such as generating a report, sending an email or a webhook, and which sources to track, such as AskNews, X (Twitter), Telegram, Bluesky, or specific domains of interest.
Checkout API reference for more specific API details.
RileyRisk is currently using Alerts to monitor Telegram Channels to send instant Air Defense Alerts to personnel throughout Ukraine. Additionally, they are using Alerts to generate a daily Air Defense Report for their team.
Depending on what you're after, there are different ways of setting up your alert. The common settings for all alerts are the cron schedule (the frequency of when to check sources and trigger actions), and the actions to be taken when the alert is triggered.
You can use the alert_type field to configure alert behavior. There are three main alert types:
AlwaysAlertWhen: Monitor sources at your specified schedule and trigger actions any time your alert query is satisfied. This is the same as specifying a query with a condition and a set of sources and setting repeat=True and always_trigger=False.
AlertOnceIf: Monitor sources at your specified schedule and trigger actions when your alert query is satisfied and then disable the alert. This is the same as specifying a query with a condition and a set of sources and setting repeat=False and always_trigger=False.
ReportAbout: Write a report and trigger actions at your specified schedule. This is the same as specifying a report object and setting repeat=True and always_trigger=True but uses a default DeepNews report with your query as the prompt.
If alert_type is specified, it overrides the repeat and always_trigger fields.
You can add a report to and AlwaysAlertWhen or AlertOnceIf alert to trigger the report conditionally, and you can add sources to a ReportAbout alert. It is, however, not possible to trigger a report conditionally with a ReportAbout alert as it has always_trigger=True (no check of alert conditions).
You can of course omit the alert_type in favor of specifying your own combination of repeat, always_trigger, and report.
If you have defined an alert type (AlwaysAlertWhen, AlertOnceIf, or ReportAbout), you must define a query.
For AlwaysAlertWhen and AlertOnceIf, the query should define the conditions for when/if to trigger the alert but can be as short or as long as you want. In some cases, the query may be an entire prompt with instructions on how to handle complex alerting criteria, and how to format output messages.
For ReportAbout, the query should define the report instructions but not include any conditions as this report type does not check alert conditions.
For alert types AlwaysAlertWhen and AlertOnceIf, you must define a set of sources that your alert monitors for your alert condition. Currently available sources are: DeepNews, AskNews' Premium News Feed, web search, Telegram channels, and Bluesky. You can include all of them, or even multiple of each (except DeepNews, which is limited to one per alert). This can be powerful if you plan to track multiple complementary feeds.
Using the DeepNews agent as an alert source enables in-depth research into your alert query criteria. Since the agent reasons on its retrieved information, impactful events related to your alert conditions will get picked up even if you did not have the foresight to include them in your query. Rather than you defining each individual source you want to scan, you give the DeepNews agent access to those sources and let it make decisions about all or a subset of the different source parameters:
{
"identifier": "deepnews",
"params": {
"model": "gemini-3-flash",
"sources": ["asknews", "google", "wiki", "x"],
"filter_params": { # <-- Filter parameters for the "asknews" source, available in [/news](/news)
"n_articles": 10,
"hours_back": 24,
}
"search_depth": 1,
"max_depth": 4,
"engine": "v1"
}
}
If you choose the AskNews Premium News Feed, you can include the optional params to target your context based on all the same filter parameters available in /news.
If you define an "asknews" or "bluesky" source without specifying the params, we use the /autofilter endpoint to generate the filter parameters based on your query.
You can combine fine-grained control of some sources and the research abilities of the DeepNews agent by specifying any combination of sources.
If you want to generate a report when the alert is triggered, you specify the report object in the alert. You can add a report to AlwaysAlertWhen and AlertOnceIf type alerts, and you can specify your own report for ReportAbout type alerts.
Reports use a discriminated union based on the identifier field:
identifier: "deepnews" (default): Uses DeepNews deep research capabilities. Requires a prompt field. Optionally accepts a params object to configure the DeepNews model, search depth, and other parameters.identifier: "legacy" (deprecated): Uses a default prompt in combination with your alert query.If report is not specified or set to null, no report is generated (unless your alert is a ReportAbout and a default report object is created for you).
You can also pass report as a list of DeepNews report requests, in which case the individual reports are concatenated in the order they are defined. All reports in a list must use identifier: "deepnews" and each must have a prompt.
You can use the DeepNews agent to carry out research and generate your report. A DeepNews report requires its own prompt, which is separate from the alert query. Since the DeepNews agent has access to its own set of tools (which you can restrict by passing a list of sources in the params), you do not need to define any alert sources - unless you want to trigger your report conditionally.
{
"report": {
"identifier": "deepnews",
"prompt": "Write a detailed report on recent market movements and their causes.",
"params": {
"model": "claude-sonnet-4-6",
"search_depth": 2,
"max_depth": 4,
"journalist_mode": true
}
}
}
Available models for DeepNews reports include claude-sonnet-4-6, claude-opus-4-6, claude-sonnet-4-5-20250929, claude-opus-4-5-20251101, claude-sonnet-4-20250514, gpt-4o, gpt-4.1-2025-04-14, and others.
If you do not want the enhanced capabilities of the DeepNews agent, you can use the legacy method for generating your report. This requires you to define sources for your alert as this type of report has no research capabilities. For legacy reports, all instructions must be contained in the alert query.
{
"report": {
"identifier": "legacy",
"model": "claude-sonnet-4-6"
}
}
Available models for legacy reports:
gpt-5,
gpt-4o,
gpt-4.1-2025-04-14,
gpt-4.1-mini-2025-04-14,
gpt-4o-mini,
o3-mini,
claude-3-5-sonnet-latest,
claude-sonnet-4-20250514,
claude-sonnet-4-5-20250929,
claude-opus-4-5-20251101,
claude-opus-4-6,
claude-sonnet-4-6,
meta-llama/Meta-Llama-3.1-405B-Instruct,
meta-llama/Meta-Llama-3.3-70B-Instruct
For complex reports, you may want to define report sections as separate report objects. You do this by passing a list of DeepNews reports, each with its own specific prompt, which will be concatenated in your specified order:
{
"report": [
{
"identifier": "deepnews",
"prompt": "Summarize macro-economic news from today.",
"params": { "model": "claude-sonnet-4-6" }
},
{
"identifier": "deepnews",
"prompt": "Summarize tech sector news from today.",
"params": { "model": "claude-sonnet-4-6" }
}
]
}
Your alert runs on a schedule which you specify as a cron in the format minute hour day_of_the_month month day_of_the_week. For example, 0 * * * * will check your sources or write your report every hour, whereas 0 0 * * * will run every day at midnight. Check Cron Expression for more details.
Setting your triggers will define what actions get triggered when your alert query criteria is met or your report is written. This can be sending out emails, pre-populate a draft in Google Docs (great for scheduled auto-report drafting), send a broadcast via Resend, or any webhook you want, including Slack, Discord, and many others.
Currently, the following triggers are supported:
Email trigger sends an email when the alert is triggered. You can specify the to and subject fields in the params object.
If you don't specify the subject, a default will be used or, if your alert has a report, the subject line will be auto-generated based on the content of that report.
If a report was generated, the email will include the report as the content. Otherwise it will just show the alert was triggered.
Example:
{
"action": "email",
"params": {
"to": "user@example.com",
"subject": "Alert: President of the US said something about the economy",
"asknews_watermark": true
}
}
Webhook trigger sends a webhook when the alert is triggered. You can specify the url, headers and payload fields in the params object.
Only url is required, the rest are optional. The request will be sent as a POST request with the payload object as the body.
The payload object can include {message}, {query}, {reasoning}, {report}, {share_link} and {report_url} placeholders
which will be replaced with the actual values when the webhook is sent.
{message}: The message that was generated for the alert{report}: The report generated for the alert if report was defined{report_url}: The URL to the PDF report generated for the alert if report was defined{share_link}: The share link for the alert if a share_link was defined{reasoning}: The reasoning behind the triggering of the alert{query}: The query that triggered the alertExample:
{
"action": "webhook",
"params": {
"url": "https://example.com/webhook",
"headers": {
"x-api-key": "your-api-key"
},
"payload": {
"query": "{query}",
"reasoning": "{reasoning}",
"report_url": "{report_url}"
}
}
}
Google Docs trigger creates a Google Docs document when the alert is triggered. You can specify the client_json parameter in the params object.
This should be the JSON key file contents of the service account that has access to create Google Docs. The document will be created in the same account.
Then using emails parameter you can specify the emails of the users who should have access to the document. The document will be shared with these users.
Example:
{
"action": "google_docs",
"params": {
"client_json": {
"type": "service_account",
"project_id": "project-id",
"private_key_id": "private-key_id",
"private_key": "private-key",
"client_email": "client-email",
"client_id": "client-id",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/testuser%40top-glass-445716-r2.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
},
"emails": ["user1@example.com", "user2@example.com"],
"asknews_watermark": true
}
}
Resend Broadcast trigger sends an email broadcast to an audience via Resend. You must provide your own Resend API key and audience ID.
Example:
{
"action": "resend_broadcast",
"params": {
"sender": "Your Name <sender@yourdomain.com>",
"reply_to": "reply@yourdomain.com",
"subject": "Daily Market Report",
"audience_id": "<YOUR_RESEND_AUDIENCE_ID>",
"resend_api_key": "<YOUR_RESEND_API_KEY>",
"asknews_watermark": true
}
}
If you don't specify the subject, a default will be used or, if your alert has a report, the subject line will be auto-generated based on the content of that report.
Your payload can take a set of predefined variables that will be replaced with the actual values when the trigger is sent, including:
{message}: The message that was generated for the alert{report}: The report generated for the alert if report was defined{report_url}: The URL to the PDF report generated for the alert if report was defined{share_link}: The share link for the alert if a share_link was defined{reasoning}: The reasoning behind the triggering of the alert{query}: The query that triggered the alertCreate an alert with the following code:
Example response:
{
"id": "173047ef-0c30-4937-9cdc-e06a7d7a07b0",
"created_at": "2025-01-15T17:19:36.735136Z",
"updated_at": "2025-01-15T17:19:43.846455Z",
"expires_at": null,
"user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"query": "I want to be alerted if the president of the US says something about the economy",
"cron": "0 * * * *",
"model": "gpt-4o",
"share_link": null,
"report": {
"identifier": "deepnews",
"prompt": "Write a concise report on what the president said about the economy.",
"params": {
"model": "claude-sonnet-4-6"
}
},
"sources": [
{
"identifier": "asknews",
"params": {
"query": "US economy, economic growth, unemployment, inflation, Federal Reserve, GDP, economic indicators, fiscal policy",
"categories": ["Business", "Finance"],
"hours_back": 1
}
},
{
"identifier": "telegram",
"params": {
"channel_name": "financenews"
}
}
],
"triggers": [
{
"action": "email",
"params": {
"to": "user@example.com",
"subject": "Alert: President of the US said something about the economy"
}
},
{
"action": "webhook",
"params": {
"url": "https://example.com/webhook",
"payload": {
"content": "{query}\n\n{reasoning}\n\n{report_url}"
}
}
}
],
"always_trigger": false,
"repeat": true,
"active": true
}
You can get a list all of your created alerts with the following code:
(all parameter is optional, you can also paginate the response with page parameter)
Example response:
{
"items": [
{
"id": "173047ef-0c30-4937-9cdc-e06a7d7a07b0",
"created_at": "2025-01-15T17:19:36.735136Z",
"updated_at": "2025-01-15T17:19:43.846455Z",
"expires_at": null,
"user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"query": "I want to be alerted if the president of the US says something about the economy",
"cron": "0 * * * *",
"model": "gpt-4o",
"share_link": null,
"report": {
"identifier": "deepnews",
"prompt": "Write a concise report on what the president said about the economy.",
"params": {
"model": "claude-sonnet-4-6"
}
},
"sources": [
{
"identifier": "asknews",
"params": {
"query": "US economy, economic growth, unemployment, inflation, Federal Reserve, GDP, economic indicators, fiscal policy",
"categories": ["Business", "Finance"],
"hours_back": 1
}
},
{
"identifier": "telegram",
"params": {
"channel_name": "financenews"
}
}
],
"triggers": [
{
"action": "email",
"params": {
"to": "user@example.com",
"subject": "Alert: President of the US said something about the economy"
}
},
{
"action": "webhook",
"params": {
"url": "https://example.com/webhook",
"headers": {
"x-api-key": "your-api-key"
},
"payload": {
"query": "{query}",
"reasoning": "{reasoning}",
"report": "{report}"
}
}
}
],
"always_trigger": false,
"repeat": true,
"active": true
}
],
"count": 1,
"next_page": null,
"previous_page": null
}
You can use the id of an alert to retrieve its details:
You can use the id of an alert to retrieve its logs, which will show the times the alert was triggered or not triggered and the reasoning behind it:
Example response:
{
"items": [
{
"id": "29269ec5-3dd1-4fe8-9b83-2c739dc26fcc",
"created_at": "2025-01-12T20:29:18.711311Z",
"alert_id": "53c0eb6d-87b5-436d-9748-f4bdc2e4b343",
"user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"alert": true,
"reasoning": "The summaries include multiple references to President Biden discussing the economy, particularly in relation to strong jobs reports and economic policies, which directly relates to the user's query.",
"report": "## Introduction\nYour query was to identify any statements made by the President of the United States regarding the economy based on the provided summaries. This report highlights relevant remarks made by the current president concerning economic conditions and policies.\n\n## Analysis\n\nFrom the summaries, the current President of the United States, Joe Biden, has made several statements regarding the state of the economy:\n\n1. **Strong Labor Market and Economic Performance**:\n - President Biden highlighted the strength of the US labor market, citing the addition of 256,000 jobs in December and a decrease in the unemployment rate to 4.1%. He emphasized that the US has \"the strongest growth and labor market of all advanced economies\" and noted the creation of over 16.6 million jobs during his term. This performance is seen as a significant achievement, with the unemployment rate reaching its lowest in over 50 years.\n\n2. **Economic Policies and Achievements**:\n - Biden urged the incoming President-elect Donald Trump to maintain his economic policies, which he claims have transformed the economy and strengthened the middle class. He pointed out the abandonment of \"trickle-down economics\" as a key factor in the economic turnaround. Despite these achievements, Biden acknowledged the challenges posed by inflation, which reached 9% in 2022, impacting voters' perceptions.\n\n3. **Inflation Concerns**:\n - While Biden celebrated the robust job market, he also acknowledged the ongoing issue of inflation. The Federal Reserve's efforts to manage inflation, including a cycle of interest rate cuts, are noted. However, Biden's administration faces the challenge of balancing economic growth with inflation control.\n\n## Conclusion\n\nPresident Joe Biden has actively communicated his administration's economic successes, particularly in job creation and labor market strength. He has urged continuity in economic policies amidst political transition and recognized the persistent challenge of inflation. As the economy remains resilient, Biden's statements reflect a focus on sustaining growth while addressing inflationary pressures. Monitoring future communications from the President will provide further insights into economic strategies and priorities.",
"report_url": "https://example.com/report",
"article_ids": [
"1b95343c-6817-5e25-9a04-e7bd85238ec5",
"f1f27e38-7af6-51aa-a6f2-8f3fcc6ac1f3",
"04729fc6-8f18-5447-a52a-62ba2d4ed468",
"e6f28fa4-4abd-58d1-bd17-f010c52af4c4",
"46daf53c-fe42-5d5b-b5ba-a3a50a04f854",
"be9ac248-3900-5c13-a7c2-c7e4e43abdcd",
"d64b8472-74dd-51d1-b352-179306c892d8",
"eae4895d-88f9-5b59-81bc-f7e88dccdc15",
"1a36b54c-b5f3-5373-94a2-0033a57dacd8",
"ef06fec7-6a3f-5aa4-b59a-9b0f33405e1d"
],
"webhook": {}
}
],
"count": 1,
"next_page": null,
"previous_page": null
}
You can update alert details using the id of the alert.
It is possible to disable an alert by setting the active field to false. If you want to enable the alert, you can set the active field to true.
Disabling an alert will prevent it from being triggered.
Removing all sources or a report is done by setting either field to None.
You can delete an alert using the id of the alert: