Overview
This node fetches the latest news articles from a popular news API service. It allows users to perform free-text searches across various parts of news articles such as titles, descriptions, and content. Users can filter results by specific news sources or domains, exclude certain domains, and paginate through results. This node is useful for workflows that require up-to-date news data, such as monitoring current events, sentiment analysis, or content aggregation.
Practical examples:
- Automatically gather recent news headlines about a particular company or topic.
- Filter news articles from trusted sources only.
- Exclude unwanted domains to avoid irrelevant or low-quality news.
- Paginate through large sets of news results for batch processing.
Properties
| Name | Meaning |
|---|---|
| Query | Free-text query string to search for news articles. |
| Search in Title | Boolean flag to include the title field in the search (true/false). |
| Search in Description | Boolean flag to include the description field in the search (true/false). |
| Search in Content | Boolean flag to include the content field in the search (true/false). |
| Sources | Comma-separated list of news sources to restrict the search to (e.g., cnn, bbc-news). |
| Domains | Comma-separated list of domains to restrict the news to (e.g., bbc.co.uk, techcrunch.com). |
| Excluded Domains | Comma-separated list of domains to exclude from the news results. |
| Page Size | Number of results per page (integer between 1 and 100, default 100). |
| Page Number | Page number to retrieve (integer starting at 1, default 1). |
| Destination Key | The key name under which the full API response will be stored in the output JSON (default "news"). |
Output
The node outputs an array of items where each item contains a JSON object with the following structure under the specified destination key (default "news"):
{
"data": { /* Full JSON response from the news API including articles and metadata */ },
"durationMillis": 123, // Time taken for the API request in milliseconds
"page": 1, // Current page number requested
"pageSize": 100, // Number of results per page requested
"status": 200, // HTTP status code returned by the API
"statusText": "OK" // HTTP status text returned by the API
}
- The
datafield contains the complete response from the news API, including the list of news articles and any additional metadata. - No binary data output is produced by this node.
Dependencies
- Requires an API key credential for the news API service.
- The node makes HTTP requests to the news API endpoint
/v2/everything. - Network access to the external news API service must be available.
- No other external dependencies are required.
Troubleshooting
Common issues:
- Invalid or missing API key will cause authentication failures.
- Providing invalid source or domain names may result in empty results or errors.
- Requesting pages beyond available results will return empty data arrays.
- Network connectivity issues can cause HTTP request failures.
Error messages:
"newsapi.org HTTP request failed: <error message>": Indicates a failure during the HTTP request, possibly due to network issues or invalid parameters.- Non-200 HTTP status codes will throw an error with the status text from the API response.
Resolutions:
- Verify that the API key credential is correctly configured and valid.
- Check the correctness of source and domain inputs.
- Ensure network connectivity to the news API endpoint.
- Use pagination parameters within valid ranges.
Links and References
- NewsAPI Documentation - Official documentation for the news API's "everything" endpoint used by this node.