RockGroup
← Back to API AccessAlready have an account? Sign in

API Documentation

BETA

Complete 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.

BASE URL
https://www.rockhewn.com/api/v1
Full endpoint: /api/v1/sentiment

Quick Start

  1. Sign up for a free account
  2. Create an API key in your dashboard
  3. Make your first API call (see examples below)

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

GET/api/v1/sentiment

Retrieve sentiment-analyzed financial data with flexible filtering options.

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (default: 100, max: plan-dependent)
sourcestringData source: pr, news, sec, or all
tickerstringStock ticker symbol (e.g., AAPL, TSLA)
score_minfloatMinimum sentiment score (0-10)
score_maxfloatMaximum sentiment score (0-10)
date_fromstringStart date (ISO 8601 format)
date_tostringEnd 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 Unauthorized

Invalid or missing API key

429 Too Many Requests

Rate limit exceeded

400 Bad Request

Invalid parameters

500 Internal Server Error

Server 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

✅ Free Tier: Every 2-3 minutes
20-30 requests/hour - Stays well within your 50 req/hour limit
💎 Enterprise: Every 5-30 seconds
No rate limits - Poll as frequently as needed
// 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

Need Help?

Have questions or need support? We're here to help!

Email us at: info@rockhewn.com