Easily Embed News Feeds on Your Website with Our Free News API for Developers
Keeping your audience informed with fresh and relevant content on your website is not a simple task. From mapping and tracking all the new content that keeps scaling to actually sourcing that tailored content and adding it to your site. With the News Widget, powered by the Webz.io News API Lite, you can embed a fully customizable news feed into any website—all for free. This widget offers a user-friendly way to display real-time news articles about specific topics, enhancing your site’s appeal and keeping visitors engaged.
Why use the news widget?
This widget is perfect for bloggers, businesses, and developers looking to enrich their websites with up-to-date news. Whether you want to showcase industry updates, trending topics, or niche-specific articles, Webz.io’s News Widget makes it effortless. Here’s what sets it apart:
- Customizable appearance: Tailor the widget to match your website’s design by modifying link colors, text colors, fonts, widget size, background color, and border color.
- Flexible display: Choose whether to show article images, text snippets, or both.
- Topic-specific content: Fetch news articles by specifying queries
- for highly relevant content.
- Category:sport
- Topic:layoffs
- Dynamic layout: The widget automatically formats articles for a polished and professional look, displaying images on the left and text on the right.
How does it work?
The News Widget dynamically fetches articles from the Webz.io News API Lite based on your chosen parameters. Each article includes:
- Title
- Link to the original source
- Publication date
- Optional image and text snippet
The result? A visually appealing and informative news feed that updates in real-time.
Getting started
Embedding the widget is straightforward. Here’s a quick guide:
- Clone the repository:
git clone https://github.com/free-news-api/news-widget.git
- Include the JavaScript file: Add the script to your website’s HTML file.
- Customize the widget: Configure options like your API token, query, and styles.
Here’s a sample implementation:
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”utf-8″ />
<title>News Widget Example</title>
</head>
<body>
<div id=”myNewsWidget”></div>
<script src=”path-to-widget.js”></script>
<script>
createNewsWidget({
token: “YOUR_WEBZ_IO_TOKEN”,
query: ‘topic:”mergers and acquisitions”‘,
container: “#myNewsWidget”,
showImage: true,
showText: true,
styles: {
backgroundColor: “#f2f2f2”,
linkColor: “blue”,
textColor: “#333333”,
dateColor: “#999999”,
}
});
</script>
</body>
</html>
Customization options
The widget is highly flexible and supports numerous customization features:
- Display options:
- showImage: Display article images.
- showText: Display text snippets.
- Styling options:
- backgroundColor: Widget background color.
- borderColor: Widget border color.
- linkColor: Color of article title links.
- textColor: Color of text snippets.
- dateColor: Color of publication dates.
Sample use cases
Sports news
Take for example the News API’s “Sports” category. It’s a wide category serving many different audiences. A sports blog embedding the Webz News Widget on their website can gives their audience a quick access to news from across the world. Basketballl fan club sites can keep their users informed on the latest stats with the news widget by using the “basketball” topic. Olympics enthusiasts can use the topic “sports medal and trophy” to keep tabs on top performing athletes outside of Olympic season.
Business news
A business blog can showcase industry trends by using the “layoffs” topic. Investment sites can update readers about the latest mergers and acquisitions with the “M&A” topic. Industry-specific sites can include the widget to keep members updated on market conditions and policies.
Tech news
Tech-focused media outlets and blogs can elevate user engagement by integrating a tech news widget that highlights breaking stories and trending topics in real-time. Blogs and retailers that focus on consumer electronics can enhance user experience by including a tech news widget that showcases new product launches, reviews, and industry trends.Startups can use a news widget to highlight industry updates and contextualize their offerings within broader trends.
What’s next for the News Widget?
Eager to add it? The News Widget is open-source and already available on GitHub. When it comes to distributing news content, timeliness is key. Install Webz.io’s News Widget now and your website or blog will be the first place your audience sees relevant news stories.
We welcome contributions to improve features or fix bugs. Feel free to fork the repository and submit your pull requests.
Visit our GitHub repository to download the widget and start embedding engaging news feeds today.
CTA Button: Check Out The News Widget On Our GitHub Repository