Configure the Mediastack Node
The Mediastack Node has several inputs for filtering news based on your requirements. For this example, we’ll filter for news from Malaysia.
API Key:
Paste your Mediastack API key into the api_key
field of the node.
Country Filter:
Double-tap an empty space in the editor and type str
.
Select Basic/String from the options and drag it to your workspace.
Enter the value my
(country code for Malaysia) into the String node.
Connect this String node to the countries
input of the Mediastack Node.
Other Inputs:
If needed, you can use additional String nodes to specify filters like sources
, categories
, keywords
, or languages
.
For now, we’ll only filter by country.
Why Do We Need a JSON Stringify Node?
The Mediastack Node returns raw JSON data, which may not be easily readable or usable for downstream nodes like ChatGPT.
JSON Stringify converts this raw JSON data into a formatted string, making it compatible with nodes like ChatGPT for natural language processing.
It also ensures that any additional information can be passed in a structured and clean format.
To add the JSON Stringify Node:
Drag it from the library under Basic/Format or use the double-click shortcut (explained below).
Connect the result
output of the Mediastack Node to the value
input of the JSON Stringify Node.