Authentication

Every ROIC.ai API request requires an API key. Pass it as the apikey query parameter on any endpoint.

Your API Key

Sign in to see your API key.

Usage

Add your key as the apikey query parameter:

bash
curl "https://api.roic.ai/v2/stock-prices/latest/AAPL?apikey=YOUR_API_KEY"

API Key Security

  • Never expose your API key in client-side code or public repositories
  • Store your key in environment variables or a secrets manager
  • Use server-side requests to proxy API calls from your frontend

Plans & Rate Limits

Every plan, including the free tier, has full API access to all public companies and every endpoint. Plans differ only by rate limit and history depth (see pricing):

PlanRequests / minuteHistory
Free52 years
Individual3005 years
ProfessionalUnlimitedAll available
EnterpriseUnlimitedAll available

Exceeding your per-minute limit returns a 429 Too Many Requests error. The response carries Retry-After (seconds until the window resets) and X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset headers:

{
  "error": "Rate limit exceeded: max 5 requests/minute on the free plan. Retry in 42s or upgrade at https://roic.ai/pricing"
}

Requesting data older than your plan's history depth returns a 403 Forbidden naming the minimum plan that covers the range:

{
  "error": "Requested history needs the Professional plan (you're on Free). Upgrade at https://roic.ai/pricing"
}

Error Responses

  • HTTP status 200OKSuccessful request
  • HTTP status 401UnauthorizedInvalid or missing API key
  • HTTP status 403ForbiddenRequested history is outside your plan's range
  • HTTP status 404Not FoundCompany or resource not found
  • HTTP status 429Too Many RequestsRate limit exceeded for your plan
  • HTTP status 500Internal Server ErrorServer error, contact [email protected]

Next Steps