News Operations
Base path: /v1/news
Auth required: Yes (JWT Bearer Token)
What this service does
- Browse, search, and paginate space news articles
- Filter by time ranges, sources, and countries
- Support multiple search modes (AND, OR, EXACT)
- Advanced search with multiple filters
How it works
- Stores items in
space_news_prod(PostgreSQL with TimescaleDB) - Full‑text search over title and short description
- Time-based filtering and pagination
- Multiple news sources integration
Latest News
GET /v1/news/latest?limit=10&source=LaunchLibrary2- Query Parameters:
limit(optional): Number of articles (1-100, default: 10)source(optional): Filter by news source
- 200 Response:
NewsResponse[] - Errors: 500 (internal server error)
By Time Range
GET /v1/news/timerange?start_date=2025-02-01T00:00:00Z&end_date=2025-02-05T00:00:00Z&page=1&size=10&source=LaunchLibrary2- Query Parameters:
start_date(required): Start date in ISO formatend_date(required): End date in ISO formatpage(optional): Page number (default: 1)size(optional): Page size (1-100, default: 10)source(optional): Filter by news source
- 200 Response:
{
"news": [{"id":"...","title":"...","date":"2025-02-04T10:00:00Z","source":"LaunchLibrary2","url":"..."}],
"total": 123,
"page": 1,
"size": 10,
"has_next": true,
"has_prev": false
}
- Errors: 400 (start_date >= end_date), 500
Search
GET /v1/news/search?q=starlink&search_mode=OR&page=1&size=10&source=LaunchLibrary2- Query Parameters:
q(required): Search term(s), comma-separated for multiple termssearch_mode(optional): Search mode - 'AND', 'OR', 'EXACT' (default: 'OR')page(optional): Page number (default: 1)size(optional): Page size (1-100, default: 10)source(optional): Filter by news source
- 200 Response:
NewsListResponse - Search Modes:
- AND: All search terms must be present
- OR: Any search term can be present
- EXACT: Treats query as exact phrase
Advanced Search
POST /v1/news/search/advanced- Query Parameters:
search_terms(required): List of search termssearch_mode(optional): Search mode - 'AND', 'OR', 'EXACT' (default: 'OR')page(optional): Page number (default: 1)size(optional): Page size (1-100, default: 10)source(optional): Filter by news sourcecountry_code(optional): Filter by country codemission_name(optional): Filter by mission namestart_date(optional): Filter by start dateend_date(optional): Filter by end date
- 200 Response:
NewsListResponse
Available News Sources
- LaunchLibrary2: Upcoming rocket launches with mission details
- RocketLaunch.Live: Next rocket launches with detailed information
- SpaceflightNewsAPI: General spaceflight news articles
Data Schema
The service uses the space_news_prod table:
CREATE TABLE space_news_prod (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
title VARCHAR(500) NOT NULL,
short_description TEXT,
source VARCHAR(100) NOT NULL,
mission_name VARCHAR(200),
date TIMESTAMP WITH TIME ZONE,
url TEXT,
slug VARCHAR(200),
last_updated TIMESTAMP WITH TIME ZONE,
country_code VARCHAR(10),
mission_description TEXT,
off_url TEXT,
insertion_time TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
UNIQUE(title, source, date)
);