Access real-time press releases from major wire services via REST API or WebSocket. Get the news before everyone else.
https://api.rtpr.ioInclude your API key in the request header:
X-API-Key: YOUR_API_KEY60 requests per minute
limitoptionalNumber of articles to return (default: 20, max: 100)
{
"count": 20,
"articles": [
{
"ticker": "AAPL",
"title": "Apple Announces Q4 Results",
"author": "Business Wire",
"created": "Mon, 28 Jul 2025 16:30:00 -0400",
"article_body": "Apple Inc. announced financial results for its fiscal fourth quarter ended September 30, 2025. The company posted quarterly revenue of $89.5 billion, up 6% year over year..."
}
]
}const response = await fetch('https://api.rtpr.io/articles?limit=10', {
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
});
const data = await response.json();
console.log('Found ' + data.count + ' articles');
data.articles.forEach(article => {
console.log(article.ticker + ': ' + article.title);
});💡 JavaScript Notes:
tickerrequiredStock ticker symbol (e.g., AAPL, TSLA, MSFT)
{
"ticker": "AAPL",
"date": "Mon, 28 Jul 2025",
"count": 3,
"articles": [
{
"ticker": "AAPL",
"title": "Apple Announces Q4 Results",
"author": "Business Wire",
"created": "Mon, 28 Jul 2025 16:30:00 -0400",
"article_body": "Apple Inc. announced financial results for its fiscal fourth quarter ended September 30, 2025. The company posted quarterly revenue of $89.5 billion, up 6% year over year..."
}
]
}const ticker = 'AAPL';
const response = await fetch('https://api.rtpr.io/article?ticker=' + ticker, {
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
});
const data = await response.json();
if (data.count > 0) {
console.log('Found ' + data.count + ' articles for ' + data.ticker + ' today');
data.articles.forEach(article => {
console.log('📰 ' + article.title);
console.log('🕒 ' + article.created);
console.log('✍️ ' + article.author);
console.log('---');
});
} else {
console.log('No articles found for ' + ticker + ' today');
}💡 JavaScript Notes:
Get press releases pushed to you instantly via WebSocket. Sub-500ms latency from wire release to your application.
wss://ws.rtpr.ioPass your API key as a query parameter when connecting:
wss://ws.rtpr.io?apiKey=YOUR_API_KEY1 concurrent WebSocket connection per API key
How it works: After connecting, send a subscribe message with your desired tickers. You'll only receive articles that match your subscription. You can update your subscription anytime without reconnecting.
Send this message to specify which tickers you want to receive
// Subscribe to specific tickers
{
"action": "subscribe",
"tickers": ["AAPL", "TSLA", "NVDA", "MSFT"]
}
// Subscribe to ALL tickers (firehose mode)
{
"action": "subscribe",
"tickers": ["*"]
}Server confirms your subscription
{
"type": "subscribed",
"tickers": ["AAPL", "TSLA", "NVDA", "MSFT"],
"message": "Subscribed to 4 tickers",
"timestamp": "2025-07-28T16:30:00.000Z"
}Remove specific tickers from your subscription
// Unsubscribe from specific tickers
{
"action": "unsubscribe",
"tickers": ["TSLA"]
}
// Unsubscribe from all (pause feed)
{
"action": "unsubscribe",
"tickers": ["*"]
}Watch a Watchlist
{"action": "subscribe", "tickers": ["AAPL", "GOOGL", "MSFT", "AMZN"]}All News (Firehose)
{"action": "subscribe", "tickers": ["*"]}Add a Ticker
{"action": "subscribe", "tickers": ["NVDA"]} // adds to existingPause Feed
{"action": "unsubscribe", "tickers": ["*"]}Sent immediately after successful authentication. Send your subscription after receiving this.
{
"type": "connected",
"message": "Connected to RTPR real-time feed",
"timestamp": "2025-07-28T16:30:00.000Z"
}Confirms your ticker subscription was successful
{
"type": "subscribed",
"tickers": ["AAPL", "TSLA", "NVDA"],
"message": "Subscribed to 3 tickers",
"timestamp": "2025-07-28T16:30:00.000Z"
}Pushed instantly when a new press release is published
{
"type": "article",
"data": {
"id": "abc123",
"ticker": "AAPL",
"tickers": ["AAPL", "MSFT"],
"title": "Apple Announces Strategic Partnership",
"author": "Business Wire",
"created": "2025-07-28T16:30:00.000Z",
"article_body": "Apple Inc. today announced a strategic partnership..."
},
"timestamp": "2025-07-28T16:30:00.123Z"
}Sent every 30 seconds to keep the connection alive. Respond with a pong message.
{
"type": "ping",
"timestamp": "2025-07-28T16:30:30.000Z"
}Sent when an error occurs (authentication failure, rate limit, etc.)
{
"type": "error",
"code": "AUTH_FAILED",
"message": "Invalid API key",
"timestamp": "2025-07-28T16:30:00.000Z"
}// Browser JavaScript WebSocket Example
const API_KEY = 'YOUR_API_KEY';
const WATCHLIST = ['AAPL', 'TSLA', 'NVDA', 'MSFT'];
const ws = new WebSocket(`wss://ws.rtpr.io?apiKey=${API_KEY}`);
ws.onopen = () => {
console.log('✅ Connected to RTPR real-time feed');
};
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
switch (message.type) {
case 'connected':
console.log('🟢 ' + message.message);
// Subscribe to your watchlist after connecting
ws.send(JSON.stringify({
action: 'subscribe',
tickers: WATCHLIST
}));
break;
case 'subscribed':
console.log('📋 Subscribed to:', message.tickers.join(', '));
break;
case 'article':
const article = message.data;
console.log('📰 NEW ARTICLE:', article.ticker);
console.log(' Title:', article.title);
console.log(' Source:', article.author);
console.log(' Time:', article.created);
// Process the article (e.g., trigger trading logic)
processArticle(article);
break;
case 'ping':
// Respond to keep connection alive
ws.send(JSON.stringify({ type: 'pong' }));
break;
case 'error':
console.error('❌ Error:', message.message);
break;
}
};
ws.onerror = (error) => {
console.error('WebSocket error:', error);
};
ws.onclose = (event) => {
console.log('🔌 Connection closed. Reconnecting in 5s...');
setTimeout(() => reconnect(), 5000);
};
function processArticle(article) {
// Your trading logic here
console.log('🍎 Processing:', article.ticker, '-', article.title);
}
// Add a new ticker to your subscription at any time
function addTicker(ticker) {
ws.send(JSON.stringify({
action: 'subscribe',
tickers: [ticker]
}));
}| Feature | WebSocket | REST API |
|---|---|---|
| Latency | ~50-500ms (real-time push) | Depends on poll frequency |
| Best For | Trading bots, real-time alerts | Dashboards, historical queries |
| Connection | Persistent (always connected) | On-demand (request/response) |
| Complexity | Requires reconnection handling | Simple HTTP requests |
| Rate Limits | Unlimited incoming messages | 60 requests/minute |
💡 Recommendation: Use WebSocket for real-time trading applications where every millisecond counts. Use REST API for dashboards, research tools, or when you need to query historical data.
Missing required parameters (e.g., ticker parameter for /article)
Invalid or missing API key
Rate limit exceeded (60 requests per minute)
Server error - please try again or contact support