Instructions
Step 1: Install or Open the Plugin
Go to the Bubble Editor.
Navigate to the Plugins tab.
If not already added, click Add plugins and install your Finnhub Plugin.
Step 2: Set Up the API Key
In the plugin settings, under Shared Headers for all calls, add:
Key: X-Finnhub-Token
Value: Your personal API key from Finnhub.io
Mark it as Secret to hide it in public apps.
Step 3: Using API Calls
Each API call is pre-configured. Here's how to use them:
🔍 1. Symbol Lookup
Endpoint: /search?q={company}
Purpose: Find a company’s stock symbol by its name (e.g., "Apple").
Use in Bubble:
Action: Use in a workflow to fetch a symbol.
Input: Search term as Company.
📈 2. Stock Symbols
Endpoint: /stock/symbol?exchange=US
Purpose: Get a list of all stock symbols for a given exchange.
Use in Bubble:
Action: Data Source for repeating groups.
Input: None or specify exchange (e.g., US, TSX).
🧾 3. Company Profile (Premium)
Endpoint: /stock/profile2?symbol={symbol}
Purpose: Get detailed info about a company (sector, CEO, logo, etc.).
Use in Bubble:
Action: Run when a user selects a company from a search.
Input: Symbol like AAPL.
💼 4. Market News
Endpoint: /news?category=general
Purpose: Fetch latest financial news.
Use in Bubble:
Action: Repeating group or display list of news articles.
Input: None.
🗞️ 5. Company News
Endpoint: /company-news?symbol={symbol}&from={from}&to={to}
Purpose: Get company-specific news within a date range.
Use in Bubble:
Input fields for symbol and optional date range.
📊 6. Financials & Metrics
Basic Financials: /stock/metric?symbol={symbol}
EPS Estimates: /stock/eps-estimate?symbol={symbol}
Revenue Breakdown: /stock/revenue-breakdown?symbol={symbol}
All require a symbol input (e.g., AAPL).
🔔 7. Earnings Calendar
Endpoint: /calendar/earnings?from={from}&to={to}
Input date range (YYYY-MM-DD format).
Can be used to show upcoming earnings calls.
📉 8. Price Candles
Endpoint: /stock/candle?symbol={symbol}&resolution={resolution}&from={from}&to={to}
Get OHLC (open-high-low-close) data for charting.
Input required:
symbol (e.g., AAPL)
resolution (1, 5, 15, D, W, M)
UNIX timestamps (from, to)
Step 4: Displaying Data in Bubble
Create input elements (e.g., search boxes for company names or symbols).
Use “Get data from external API” for elements like repeating groups.
Use “Display data” or “Set state” to manage the API response for display.
Bind each API call's response to text/image elements for things like:
Company logos
Stock prices
Financial metrics
Step 5: Handling API Limits
Finnhub free plans have usage quotas. If you exceed them:
Use conditional logic to restrict calls.
Display a “Rate limit exceeded” message using the Include errors in response setting.