API Documentation
BETAComplete guide to integrating the RockHewn AI Sentiment API
Getting Started
The RockHewn AI Sentiment API provides real-time access to sentiment-analyzed financial data from press releases, news articles, and SEC 8-K reports.
https://www.rockhewn.com/api/v1/api/v1/sentimentQuick Start
Authentication
All API requests require authentication using an API key. Include your key in the Authorization header:
Authorization: Bearer rh_your_api_key_here🔒 Keep your API key secure
Never expose your API key in client-side code or public repositories.
Endpoints
/api/v1/sentimentRetrieve sentiment-analyzed financial data with flexible filtering options.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results (default: 100, max: plan-dependent) |
source | string | Data source: pr, news, sec, or all |
ticker | string | Stock ticker symbol (e.g., AAPL, TSLA) |
score_min | float | Minimum sentiment score (0-10) |
score_max | float | Maximum sentiment score (0-10) |
date_from | string | Start date (ISO 8601 format) |
date_to | string | End date (ISO 8601 format) |
Response Format
{
"data": [
{
"article_id": "abc123",
"ticker": "AAPL",
"sentiment": "Positive",
"sentiment_score": 7.5,
"scored_at": "2026-06-15T09:00:00Z",
"json_data": { ... },
"source": "pr"
}
],
"meta": {
"count": 10,
"has_more": true,
"response_time_ms": 350,
"plan": "free",
"rate_limit_remaining": "45"
}
}Rate Limits
Rate limits are applied per API key and vary by plan:
Free
- 50 requests/hour
- 500 requests/day
- Max 50 results per request
Enterprise
- Unlimited requests
- Unlimited results
- Custom SLA
Rate limit information is included in every API response under meta.rate_limit_remaining.
Error Handling
The API uses standard HTTP status codes and returns errors in JSON format:
401 UnauthorizedInvalid or missing API key
429 Too Many RequestsRate limit exceeded
400 Bad RequestInvalid parameters
500 Internal Server ErrorServer error
{
"error": "Rate limit exceeded",
"message": "You have exceeded your API rate limit..."
}Code Examples
cURL
# Get latest 10 items
curl "https://www.rockhewn.com/api/v1/sentiment?limit=10" \
-H "Authorization: Bearer rh_your_api_key"
# Filter by ticker
curl "https://www.rockhewn.com/api/v1/sentiment?ticker=AAPL&limit=5" \
-H "Authorization: Bearer rh_your_api_key"
# High sentiment scores only
curl "https://www.rockhewn.com/api/v1/sentiment?score_min=7&limit=10" \
-H "Authorization: Bearer rh_your_api_key"Python
import requests
API_KEY = "rh_your_api_key"
BASE_URL = "https://www.rockhewn.com/api/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.get(
f"{BASE_URL}/sentiment",
headers=headers,
params={"ticker": "AAPL", "limit": 10, "score_min": 7}
)
data = response.json()
for item in data['data']:
print(f"{item['ticker']}: {item['sentiment']}")JavaScript (Node.js)
const API_KEY = "rh_your_api_key";
const BASE_URL = "https://rockhewn.com/api/v1";
async function getSentiment(ticker, limit = 10) {
const response = await fetch(
`${BASE_URL}/sentiment?ticker=${ticker}&limit=${limit}`,
{ headers: { "Authorization": `Bearer ${API_KEY}` } }
);
return await response.json();
}
getSentiment("AAPL", 5).then(data => {
console.log(`Found ${data.meta.count} results`);
});Real-Time Data Access
The API provides real-time access to sentiment data. For continuous updates, implement polling in your application.
Recommended Polling Interval
// Recommended: Poll every 2 minutes (Free tier)
setInterval(async () => {
const response = await fetch(
'https://www.rockhewn.com/api/v1/sentiment?limit=10',
{ headers: { 'Authorization': 'Bearer rh_xxxxx' } }
);
const data = await response.json();
// Update your UI with new data
}, 120000); // 2 minutes = 120,000ms