Skip to content

n8n Integration

n8n is an open-source workflow automation platform. With APITube News API, you can build automated workflows for news monitoring, alerts, and AI-powered digests — all without writing code.

Prerequisites

Setting Up APITube Credentials

Before using APITube API in n8n workflows, configure authentication credentials:

  1. In n8n, navigate to CredentialsAdd credential
  2. Select Header Auth from the credential types
  3. Name it APITube API
  4. Set Name to X-API-Key
  5. Set Value to your API key from apitube.io
  6. Click Save

TIP

When configuring HTTP Request nodes in the workflows below, set Authentication to Generic Credential Type, then select Header Auth and choose your APITube API credential.

API Endpoints Reference

EndpointMethodDescription
/v1/news/everythingGETSearch all articles with 50+ filters
/v1/news/top-headlinesGETTop news from authoritative sources
/v1/news/articleGETGet articles by ID
/v1/news/story/:articleIdGETGet related articles for a story
/v1/news/trendsGETTrending topics and aggregations
/v1/news/time-seriesGETArticle counts over time

Base URL: https://api.apitube.io

Full list of endpoints and parameters: Endpoints | Parameters

Workflow 1: News Monitoring

Monitor news by keywords, categories, or sources on a schedule.

How it works:

  • Schedule Trigger runs every 15 minutes
  • HTTP Request searches APITube for new articles
  • IF node filters results by condition (e.g., sentiment score)
  • Results are saved to Google Sheets (or any destination)

n8n workflow JSON:

json
{
  "name": "APITube — News Monitoring",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 15
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0],
      "id": "schedule-trigger",
      "name": "Every 15 minutes"
    },
    {
      "parameters": {
        "url": "https://api.apitube.io/v1/news/everything",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            { "name": "title", "value": "artificial intelligence" },
            { "name": "language.code", "value": "en" },
            { "name": "published_at.start", "value": "={{ $now.minus(15, 'minutes').toISO() }}" },
            { "name": "per_page", "value": "50" },
            { "name": "sort.by", "value": "published_at" },
            { "name": "sort.order", "value": "desc" }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0],
      "id": "http-request",
      "name": "Search APITube",
      "credentials": {
        "httpHeaderAuth": {
          "id": "YOUR_CREDENTIAL_ID",
          "name": "APITube API"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "articles",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [440, 0],
      "id": "split-articles",
      "name": "Split Articles"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "condition-sentiment",
              "leftValue": "={{ $json.sentiment.overall.score }}",
              "rightValue": 0,
              "operator": {
                "type": "number",
                "operation": "gte"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [660, 0],
      "id": "filter-positive",
      "name": "Positive Sentiment?"
    }
  ],
  "connections": {
    "Every 15 minutes": {
      "main": [[{ "node": "Search APITube", "type": "main", "index": 0 }]]
    },
    "Search APITube": {
      "main": [[{ "node": "Split Articles", "type": "main", "index": 0 }]]
    },
    "Split Articles": {
      "main": [[{ "node": "Positive Sentiment?", "type": "main", "index": 0 }]]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0
}

To import: Copy the JSON above, open n8n, click Import from JSON, paste, and update the credential ID.

Customization tips:

  • Change title parameter to monitor different keywords
  • Add category.id to filter by category (see list of categories)
  • Add source.country.code to filter by country (e.g., us, gb)
  • Use entity.id or person.name to track specific entities

Workflow 2: News to Slack / Telegram

Send news alerts to your team's Slack channel or Telegram group.

How it works:

  • Schedule Trigger runs every 30 minutes
  • HTTP Request fetches latest articles from APITube
  • Split In Batches processes articles one by one
  • Slack/Telegram node sends a formatted message with title, source, and link

n8n workflow JSON (Slack):

json
{
  "name": "APITube — News to Slack",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "minutes",
              "minutesInterval": 30
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0],
      "id": "schedule-trigger",
      "name": "Every 30 minutes"
    },
    {
      "parameters": {
        "url": "https://api.apitube.io/v1/news/everything",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            { "name": "title", "value": "startup funding" },
            { "name": "language.code", "value": "en" },
            { "name": "published_at.start", "value": "={{ $now.minus(30, 'minutes').toISO() }}" },
            { "name": "per_page", "value": "10" },
            { "name": "sort.by", "value": "published_at" },
            { "name": "sort.order", "value": "desc" }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0],
      "id": "http-request",
      "name": "Search APITube",
      "credentials": {
        "httpHeaderAuth": {
          "id": "YOUR_CREDENTIAL_ID",
          "name": "APITube API"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "articles",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [440, 0],
      "id": "split-articles",
      "name": "Split Articles"
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "value": "YOUR_CHANNEL_ID",
          "mode": "id"
        },
        "messageType": "block",
        "blocksUi": {
          "blocksValues": [
            {
              "type": "section",
              "fields": {
                "values": [
                  {
                    "textType": "mrkdwn",
                    "text": "=*<{{ $json.url }}|{{ $json.title }}>*\n_{{ $json.source.name }}_ • {{ $json.published_at }}\n{{ $json.description }}"
                  }
                ]
              }
            }
          ]
        }
      },
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.2,
      "position": [660, 0],
      "id": "slack-message",
      "name": "Send to Slack",
      "credentials": {
        "slackApi": {
          "id": "YOUR_SLACK_CREDENTIAL_ID",
          "name": "Slack"
        }
      }
    }
  ],
  "connections": {
    "Every 30 minutes": {
      "main": [[{ "node": "Search APITube", "type": "main", "index": 0 }]]
    },
    "Search APITube": {
      "main": [[{ "node": "Split Articles", "type": "main", "index": 0 }]]
    },
    "Split Articles": {
      "main": [[{ "node": "Send to Slack", "type": "main", "index": 0 }]]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0
}

For Telegram: Replace the Slack node with a Telegram node:

  • Use Telegram node → Send Message
  • Set Chat ID to your group/channel ID
  • Set Text to: ={{ $json.title }}\n{{ $json.source.name }} • {{ $json.published_at }}\n{{ $json.url }}

Workflow 3: AI News Digest

Build a daily AI-powered news digest delivered to your inbox.

How it works:

  • Schedule Trigger runs once a day (e.g., 8:00 AM)
  • HTTP Request fetches top headlines from APITube
  • Code node formats articles into a readable list
  • OpenAI node summarizes the news into a concise digest
  • Gmail node sends the digest to your email

n8n workflow JSON:

json
{
  "name": "APITube — AI News Digest",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [0, 0],
      "id": "schedule-trigger",
      "name": "Daily at 8 AM"
    },
    {
      "parameters": {
        "url": "https://api.apitube.io/v1/news/top-headlines",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            { "name": "language.code", "value": "en" },
            { "name": "published_at.start", "value": "={{ $now.minus(1, 'days').toISO() }}" },
            { "name": "per_page", "value": "20" },
            { "name": "sort.by", "value": "published_at" },
            { "name": "sort.order", "value": "desc" }
          ]
        },
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0],
      "id": "http-request",
      "name": "Get Top Headlines",
      "credentials": {
        "httpHeaderAuth": {
          "id": "YOUR_CREDENTIAL_ID",
          "name": "APITube API"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const articles = $input.first().json.articles || [];\nconst formatted = articles.map((a, i) => \n  `${i + 1}. ${a.title} (${a.source.name})\\n   ${a.url}\\n   ${a.description || ''}`\n).join('\\n\\n');\n\nreturn [{ json: { articlesList: formatted, count: articles.length } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [440, 0],
      "id": "format-articles",
      "name": "Format Articles"
    },
    {
      "parameters": {
        "resource": "chat",
        "operation": "message",
        "model": {
          "__rl": true,
          "value": "gpt-4o-mini",
          "mode": "list"
        },
        "messages": {
          "values": [
            {
              "content": "=You are a professional news editor. Summarize the following {{ $json.count }} news articles into a concise daily digest. Group by topic, highlight the most important stories, and keep it under 500 words.\n\n{{ $json.articlesList }}"
            }
          ]
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.8,
      "position": [660, 0],
      "id": "openai-summarize",
      "name": "AI Summarize",
      "credentials": {
        "openAiApi": {
          "id": "YOUR_OPENAI_CREDENTIAL_ID",
          "name": "OpenAI"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "[email protected]",
        "subject": "=Daily News Digest — {{ $now.format('yyyy-MM-dd') }}",
        "emailType": "text",
        "message": "={{ $json.message.content }}"
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [880, 0],
      "id": "send-email",
      "name": "Send Email",
      "credentials": {
        "gmailOAuth2": {
          "id": "YOUR_GMAIL_CREDENTIAL_ID",
          "name": "Gmail"
        }
      }
    }
  ],
  "connections": {
    "Daily at 8 AM": {
      "main": [[{ "node": "Get Top Headlines", "type": "main", "index": 0 }]]
    },
    "Get Top Headlines": {
      "main": [[{ "node": "Format Articles", "type": "main", "index": 0 }]]
    },
    "Format Articles": {
      "main": [[{ "node": "AI Summarize", "type": "main", "index": 0 }]]
    },
    "AI Summarize": {
      "main": [[{ "node": "Send Email", "type": "main", "index": 0 }]]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "tags": [],
  "triggerCount": 0
}

Tips & Tricks

  • Avoid duplicate articles: Use published_at.start with the n8n expression ={{ $now.minus(15, 'minutes').toISO() }} to only fetch articles since the last poll
  • Rate limits: APITube allows 50 requests per minute. Space your Schedule Triggers accordingly
  • Pagination: Use page parameter to fetch more results. Max per_page is 250
  • Export formats: Add export=csv or export=xlsx to get data in different formats
  • Deduplication: Use n8n's built-in Remove Duplicates node with url as the key field to avoid processing the same article twice

Next Steps