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.
Turn a description into a news search. Auto Filter reads what you want in plain language and returns the filters for it: the query, categories, entity and string guarantees, countries, sentiment and the time window. You can inspect them, adjust them and pass them to any endpoint that takes filter_params.
Every parameter and the full response schema are in the API reference.
Use it when you want a plain-language description turned into search filters you can reuse. If you can write the filters yourself, you do not need it. If an agent should choose its searches as it goes, use DeepNews.
| Endpoint | GET /v1/chat/autofilter |
| Python SDK | ask.chat.get_autofilter() |
| Scope | chat |
| Cost | 3 credits per request (pricing) |
The response has two parts:
{
"filter_params": {
"query": "European car makers electric vehicle sales decline",
"categories": ["Business"],
"entity_guarantee": ["Organization:Volkswagen", "Organization:Renault"],
"countries": ["DE", "FR"],
"sentiment": "negative",
"hours_back": 336
},
"metadata": { "title": "European EV sales, negative coverage" }
}filter_params holds news search parameters. Over HTTP it also carries the defaults for the parameters the description did not set, such as n_articles. metadata.title is a short name for the feed. The values above are illustrative: the filters depend on the description.
| Filter | From a description such as |
|---|---|
query | The topic, rewritten as search keywords |
categories, reporting_voice | "business news", "investigative reporting" |
entity_guarantee, entity_guarantee_op | "about Volkswagen or Renault" |
string_guarantee, reverse_string_guarantee | "that mention tariffs", "but not motorsport" |
countries, countries_blacklist, continents | "German and French outlets", "outside the US" |
sentiment | "negative coverage" |
hours_back, or start_timestamp and end_timestamp | "last two weeks", "in March 2025" |
Time windows are normalized:
start_timestamp and end_timestamp with time_filter="pub_date", so the window applies to publication dates.hours_back=24.Pass filter_params to news search as keyword arguments, and set your own page size after them:
filters = response.filter_params.model_dump(exclude_none=True)
articles = ask.news.search_news(
**filters,
n_articles=10,
return_type="string",
)
print(articles.as_string)The same filters narrow DeepNews and graphs to that slice of the news, through their filter_params parameter:
research = ask.chat.get_deep_news(
messages=[{"role": "user", "content": "What is driving the decline, and which brands are hit hardest?"}],
filter_params=filters,
sources=["asknews"],
)Call Auto Filter once, store the filters, and reuse them. Running it again for the same description costs another 3 credits, and the result can differ.
| Symptom | Cause | Fix |
|---|---|---|
TypeError when passing the response to search | The whole response was passed, metadata included | Pass response.filter_params |
| Too few results | The filters are stricter than you meant | Drop a guarantee or a country, then search again |
| A shorter window than you asked for | Date ranges are capped at 120 days | Set start_timestamp and end_timestamp yourself |
| Different filters for the same description | The filters are generated by a model | Store the filters you want and reuse them |