Skip to content
NewsDataHub NewsDataHub API Docs

Quick Start

Get started with NewsDataHub API in minutes. This guide will walk you through making your first API request and exploring what you can build.

Sign up for a free account to get your API key. Free accounts include 100 requests per day with access to the /news endpoint.

Choose your preferred language below and copy the example code. Replace your_api_key_here with your actual API key.

Dive into the API Reference for complete documentation on all endpoints, parameters, and response formats.

Copy and paste these examples to start fetching news data. Each example shows how to get the latest news and search for specific topics.

Install required package:

Terminal window
pip install requests
import requests
API_KEY = 'your_api_key_here'
BASE_URL = 'https://api.newsdatahub.com/v1/news'
headers = {
'X-Api-Key': API_KEY,
'User-Agent': 'docs-quick-start/1.0-py'
}
# Get latest news
response = requests.get(BASE_URL, headers=headers)
data = response.json()
print(data)
# Search for specific news
params = {'q': 'artificial intelligence', 'per_page': 10}
response = requests.get(BASE_URL, headers=headers, params=params)
data = response.json()
print(data)

Want to see a complete implementation? Check out our open-source news aggregator built with the NewsDataHub API.

A modern, full-featured news aggregator application showcasing best practices for integrating the NewsDataHub API. Includes search functionality, filtering, pagination, error handling, and a clean user interface.

Technologies: React • TypeScript • Express • Docker • Demo Mode • Dark Mode

View on GitHub →

Ready to dive deeper? Here are some suggested next steps: