n8n
News in your n8n workflows, and as a tool for the AI Agent node.
With the HTTP Request node
1. Save your key as a credential
In Credentials → Create credential, choose Header Auth:
| Field | Value |
|---|---|
| Name | Authorization |
| Value | Bearer ts_live_… (your key) |
2. Add the request
Add an HTTP Request node. The quickest way to fill it is Import cURL — paste this and press Import:
curl https://api.typesearch.ai/v1/search \
-H "Content-Type: application/json" \
-d '{ "query": "lithium royalties in Chile", "days": 1, "mode": "fast", "max_results": 10 }'Then set Authentication to Generic Credential Type → Header Auth and choose the credential from step 1. Or fill it by hand:
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.typesearch.ai/v1/search |
| Authentication | Generic Credential Type → Header Auth |
| Send Body | On, JSON |
To search for what an earlier node produced, use an expression in the body:
{ "query": "{{ $json.topic }}", "days": 1, "mode": "fast", "max_results": 10 }The articles come back in results. Add a Split Out node on results to get one item per article,
with title, url, source, published_at, score and snippet.
3. As a tool for the AI Agent node
Connect an HTTP Request Tool to the agent’s Tool input, with the same URL, method and credential,
and let the model write the query with $fromAI:
{
"query": "{{ $fromAI('query', 'What to search for in the news, in any language', 'string') }}",
"days": 7,
"mode": "fast",
"max_results": 8
}Describe the tool so the agent knows when to call it: Searches recent news articles and returns title, URL, source, publication time and a relevance score for each.
Ideas
- A morning briefing: a Schedule Trigger, one search per topic with
"days": 1, and an email or Slack message with the titles and links. - Alerts: keep only results with
scoreabove0.8, and remember the URLs you’ve sent so each article goes out once.
Each search costs $1.40 per 1,000 in fast mode, as in these examples; without mode, the API uses
normal ($2.20), which reads the top results before ranking them.