I am trying to integrate Searxng, which provides an API with a JSON output for search.
I want to iterate through the JSON output without having to manually define each one, like a for loop in python.
Is there a node that can do this? I can’t seem to get the code note (python) to work (that’s probably a me thing as I don’t quite understand that integration yet)
Attached is the hard code way how to split out those fields, I need to loop over and change the - results[0].url programmatically if possible.
Thanks, for your help.
Here is some sample JSON output:
{
"query": "what are the benefits of taurine",
"number_of_results": 0,
"results": [
{
"url": "https://health.clevelandclinic.org/taurine",
"title": "Taurine Benefits and Side Effects",
"content": "August 23, 2024 - She explains what taurine is, its risks and benefits and whether supplementation is a good idea. Taurine is an amino acid — that is, an organic compound used to make proteins. There are hundreds of amino acids that exist in nature, but only nine are essential for human life.",
"thumbnail": "",
"engine": "google",
"parsed_url": [
"https",
"health.clevelandclinic.org",
"/taurine",
"",
"",
""
],
"template": "default.html",
"engines": [
"google",
"qwant",
"brave",
"duckduckgo"
],
"positions": [3, 3, 1, 1],
"publishedDate": "2024-08-23T00:00:00",
"score": 10.6666666666667,
"category": "general"
},
{
"url": "https://www.healthline.com/nutrition/what-is-taurine",
"title": "What Is Taurine? Benefits, Side Effects, and More",
"content": "February 28, 2023 - The anti-inflammatory effects of taurine may reduce inflammation within the brain and combat neurodegenerative conditions such as Alzheimer’s disease. May support liver health. Taurine may have protective effects against chronic and acute liver injury. Although promising, these potential ...",
"thumbnail": "",
"engine": "google",
"parsed_url": [
"https",
"www.healthline.com",
"/nutrition/what-is-taurine",
"",
"",
""
],
"template": "default.html",
"engines": [
"google",
"qwant",
"brave",
"duckduckgo"
],
"positions": [1, 4, 2, 2],
"publishedDate": "2023-02-28T00:00:00",
"score": 9,
"category": "general"
},
- n8n version: Version 1.64.3
- Database (default: SQLite): Default
- n8n EXECUTIONS_PROCESS setting (default: own, main): Default
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker local
- Operating system: MacOS Sonoma