we-promise/sure · warning · Provider::AlphaVantage::RateLimitError
parsed["Information"]
Error message
parsed["Information"]
What it means
Provider::AlphaVantage#check_api_error! scans the parsed JSON body after every API call. When Alpha Vantage returns a top-level "Information" key, the provider logs it and raises Provider::AlphaVantage::RateLimitError. Alpha Vantage uses the "Information" key for quota and access notices (most famously the free-tier limit of 25 requests per day, or messages telling you to upgrade to a premium key), so the library maps it to a rate-limit condition.
Source
Thrown at app/models/provider/alpha_vantage.rb:332
Rails.cache.write(cache_key, currency, expires_in: 24.hours)
currency
end
# Checks for Alpha Vantage-specific error responses.
# Alpha Vantage returns errors as JSON keys rather than HTTP status codes.
def check_api_error!(parsed)
return unless parsed.is_a?(Hash)
# Rate limit: Alpha Vantage returns a "Note" key when rate-limited
if parsed["Note"].present?
Rails.logger.warn("AlphaVantage rate limit: #{parsed["Note"]}")
raise RateLimitError, parsed["Note"]
end
# General info/limit messages
if parsed["Information"].present?
Rails.logger.warn("AlphaVantage info: #{parsed["Information"]}")
raise RateLimitError, parsed["Information"]
end
# Explicit error messages for invalid parameters
if parsed["Error Message"].present?
raise Error, "API error: #{parsed["Error Message"]}"
end
end
end
View on GitHub (pinned to e69894adb9)
Solutions
- Wait for the daily quota reset (free tier resets at UTC midnight) or upgrade to a premium Alpha Vantage key and set it under Settings > Data Providers so you are not on a shared key.
- If the message mentions a specific endpoint being premium, switch to a function available on your tier or use a different securities provider for that symbol.
- Rescue Provider::AlphaVantage::RateLimitError in the sync job and back off / reschedule instead of failing the whole sync.
- Re-run the same request with curl to confirm whether the message is quota or endpoint related.
Example fix
# before
parsed = fetch_json(path)
result = parse_series(parsed) # blows up later with confusing nil errors
# after
begin
parsed = provider.fetch_series(symbol)
rescue Provider::AlphaVantage::RateLimitError => e
Rails.logger.warn("Alpha Vantage quota hit: #{e.message}")
retry_later(interval: 1.hour) # or mark sync as rate-limited and stop
end Defensive patterns
Strategy: retry
Try / catch
begin
provider.sync(symbol)
rescue Provider::AlphaVantage::RateLimitError => e
Rails.logger.warn("Alpha Vantage quota: #{e.message}")
reschedule_sync(in: quota_reset_interval) # back off; do not hot-retry
end Prevention
- Set your own Alpha Vantage API key in Settings > Data Providers instead of relying on shared keys.
- Cache quotes/exchange rates so repeat syncs don't burn the 25/day free quota.
- Schedule syncs with spacing (or jittered cron) to stay under per-minute/day limits.
When it happens
Trigger: Any Alpha Vantage sync/exchange-rate call whose response body is a Hash containing a present "Information" key: the 26th request in a day on a free API key, calling a premium-only endpoint (e.g. some FOREX/crypto or real-time functions) with a free key, or hitting an upgraded key's per-minute quota. check_api_error! runs after JSON parsing, before any data is returned.
Common situations: Free-tier key exhausted for the day; using the app's shared/default key while many users sync simultaneously; Alpha Vantage rotating between "Note" and "Information" wording for quota messages; environment (prod) using a demo key copied from docs.
Related errors
- API error: #{parsed["Error Message"]}
- Alpha Vantage daily request limit reached (#{max_requests_pe
- parsed["Note"]
- EODHD daily rate limit of #{max_requests_per_day} requests e
- detail
AI-assisted analysis of we-promise/sure@e69894adb9 (2026-08-21).
Data as JSON: /api/errors/a057f3668c74f071.
Report an issue: GitHub.