LiveInk Widget Documentation
Embed real-time financial data into any website with a single script tag. No backend required.
Getting Started
The LiveInk Widget is a lightweight, self-contained JavaScript snippet that automatically updates financial data displayed on your website. It works with any HTML page — no framework, no build step, no dependencies.
How it works:
- You include the widget script on your page with your API key.
- You mark HTML elements with
data-liveinkattributes specifying the data type. - The widget automatically fetches real-time data and updates those elements at the interval you configure.
- Tooltips show the original value, source, and last update time.
Quick Start
Add the widget to your page in two steps:
Step 1 — Include the script
<script src="https://api.liveink.app/widget.js" data-key="LIK-xxxx-xxxx-xxxx" data-refresh="300"></script>
Step 2 — Add data attributes to your elements
<!-- Bitcoin price in USD --> <span data-liveink="bitcoin_usd" data-liveink-prefix="$" data-liveink-decimals="0">Loading...</span> <!-- EUR/USD exchange rate --> <span data-liveink="eur_usd" data-liveink-decimals="4">Loading...</span> <!-- Oil price with suffix --> <span data-liveink="oil_wti" data-liveink-prefix="$" data-liveink-suffix=" /barrel" data-liveink-decimals="2">Loading...</span>
That’s it. The widget will automatically validate your key, fetch fresh data, and keep values updated.
Authentication
Every request to the LiveInk API requires a valid API key, passed via the data-key attribute on the script tag. The widget handles authentication automatically.
Key format
API keys follow the pattern LIK-xxxx-xxxx-xxxx where each segment is an alphanumeric string.
Domain restriction
Each key is bound to one or more allowed domains. Requests from unauthorized domains will be rejected with a DOMAIN_NOT_ALLOWED error. Wildcards (*) are supported for development.
Validation flow
1. Widget loads 2. POST /api/widget/validate Headers: X-LiveInk-Key: LIK-xxxx-xxxx-xxxx 3. Server checks: - Key exists and is active - Key has not expired - Request origin matches allowed domains - Daily request limit not exceeded 4. If valid -> fetch data | If invalid -> console warning
HTML Attributes
Use these attributes on any HTML element to control widget behavior:
Script tag attributes
| Attribute | Required | Default | Description |
|---|---|---|---|
data-key | Yes | — | Your LiveInk API key (LIK-xxxx-xxxx-xxxx) |
data-refresh | No | 300 | Auto-refresh interval in seconds (0 = disabled) |
data-tooltip | No | true | Set to "false" to disable hover tooltips |
data-badge | No | true | Set to "false" to hide the “LiveInk” badge |
data-color | No | #2563EB | Accent color for underlines and tooltips |
Element attributes
| Attribute | Required | Default | Description |
|---|---|---|---|
data-liveink | Yes | — | The data type to display (see Available Data Types) |
data-liveink-prefix | No | "" | Text prepended to the value (e.g., "$", "€") |
data-liveink-suffix | No | "" | Text appended to the value (e.g., " USD", " /barrel") |
data-liveink-decimals | No | auto | Number of decimal places (auto: 0 for ≥100, 2 for ≥1, 4 for <1) |
data-liveink-format | No | number | Set to "raw" to display the raw API value without formatting |
data-liveink-locale | No | "en-US" | Number formatting locale (e.g., "it-IT" for 1.234,56) |
data-liveink-fallback | No | "" | Text shown if the value cannot be fetched |
Available Data Types
Each data-liveink value maps to a specific data feed. Data is fetched in batches and cached with category-specific TTLs (see the Refresh column below).
Cryptocurrency
Real-time prices from CoinGecko API (free tier, no key required).
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
bitcoin_usd | Bitcoin price in US Dollars | 60s | Basic Pro Enterprise |
bitcoin_eur | Bitcoin price in Euros | 60s | Basic Pro Enterprise |
ethereum_usd | Ethereum price in US Dollars | 60s | Basic Pro Enterprise |
ethereum_eur | Ethereum price in Euros | 60s | Basic Pro Enterprise |
solana_usd | Solana price in US Dollars | 60s | Basic Pro Enterprise |
Forex
Exchange rates from ECB via ExchangeRate-API (free, updated daily).
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
eur_usd | Euro to US Dollar exchange rate | 300s | Basic Pro Enterprise |
Energy / Commodities
Commodity prices from Yahoo Finance (real-time market data).
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
oil_wti | WTI Crude Oil price (USD/barrel) | 900s | Pro Enterprise |
oil_brent | Brent Crude Oil price (USD/barrel) | 900s | Pro Enterprise |
Precious Metals
Spot prices from Metals API and market aggregators.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
gold_usd | Gold (USD/troy ounce) | 900s | Pro Enterprise |
silver_usd | Silver (USD/troy ounce) | 900s | Pro Enterprise |
platinum_usd | Platinum (USD/troy ounce) | 900s | Pro Enterprise |
palladium_usd | Palladium (USD/troy ounce) | 900s | Pro Enterprise |
Agriculture
Agricultural commodity prices from Commodities API.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
wheat_usd | Wheat (USD/bushel) | 3600s | Pro Enterprise |
coffee_usd | Coffee (USD/lb) | 3600s | Pro Enterprise |
cocoa_usd | Cocoa (USD/ton) | 3600s | Pro Enterprise |
sugar_usd | Sugar (USD/lb) | 3600s | Pro Enterprise |
Stock Indices
Major global stock indices from Yahoo Finance.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
sp500 | S&P 500 | 300s | Pro Enterprise |
nasdaq | NASDAQ Composite | 300s | Pro Enterprise |
ftse_mib | FTSE MIB (Italy) | 300s | Pro Enterprise |
dax | DAX (Germany) | 300s | Pro Enterprise |
cac40 | CAC 40 (France) | 300s | Pro Enterprise |
nikkei | Nikkei 225 (Japan) | 300s | Pro Enterprise |
dow_jones | Dow Jones Industrial Average | 300s | Pro Enterprise |
Interest Rates
Central bank reference rates, updated after each policy meeting.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
ecb_rate | ECB Main Refinancing Rate | 3600s | Pro Enterprise |
fed_rate | US Federal Funds Rate | 3600s | Pro Enterprise |
boe_rate | Bank of England Base Rate | 3600s | Pro Enterprise |
Macro Economics
Key macroeconomic indicators, sourced from national statistics offices and international organizations.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
inflation_us | US Inflation Rate (%) | 86400s | Pro Enterprise |
inflation_eu | Eurozone Inflation Rate (%) | 86400s | Pro Enterprise |
inflation_it | Italy Inflation Rate (%) | 86400s | Pro Enterprise |
gdp_us | US GDP Growth Rate (%) | 86400s | Pro Enterprise |
gdp_eu | Eurozone GDP Growth Rate (%) | 86400s | Pro Enterprise |
unemployment_us | US Unemployment Rate (%) | 86400s | Pro Enterprise |
unemployment_it | Italy Unemployment Rate (%) | 86400s | Pro Enterprise |
Weather
Current temperature data from OpenWeatherMap and Open-Meteo.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
weather_rome | Temperature in Rome (°C) | 1800s | Enterprise |
weather_milan | Temperature in Milan (°C) | 1800s | Enterprise |
weather_london | Temperature in London (°C) | 1800s | Enterprise |
weather_new_york | Temperature in New York (°C) | 1800s | Enterprise |
weather_tokyo | Temperature in Tokyo (°C) | 1800s | Enterprise |
Air Quality
Air Quality Index from WAQI / aqicn.org.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
aqi_rome | Air Quality Index — Rome | 3600s | Enterprise |
aqi_milan | Air Quality Index — Milan | 3600s | Enterprise |
aqi_london | Air Quality Index — London | 3600s | Enterprise |
Earthquake
Latest significant seismic events from USGS Earthquake API.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
earthquake_latest | Latest significant earthquake (magnitude + location) | 300s | Enterprise |
Demographics
Population data from World Bank and national statistics offices.
| Data Type | Description | Refresh | Plans |
|---|---|---|---|
population_italy | Italy population | 86400s | Enterprise |
population_us | US population | 86400s | Enterprise |
population_world | World population | 86400s | Enterprise |
Code Examples
Basic article with live data
<article> <h1>Market Update</h1> <p> Bitcoin is currently trading at <span data-liveink="bitcoin_usd" data-liveink-prefix="$" data-liveink-decimals="0">...</span>, while Ethereum sits at <span data-liveink="ethereum_usd" data-liveink-prefix="$" data-liveink-decimals="2">...</span>. </p> <p> The EUR/USD exchange rate is at <span data-liveink="eur_usd" data-liveink-decimals="4">...</span>, and WTI Oil is at <span data-liveink="oil_wti" data-liveink-prefix="$" data-liveink-suffix=" per barrel" data-liveink-decimals="2">...</span>. </p> </article> <!-- Widget script (place before </body>) --> <script src="https://api.liveink.app/widget.js" data-key="LIK-xxxx-xxxx-xxxx"></script>
Dashboard-style data cards
<div class="dashboard"> <div class="card"> <h3>BTC</h3> <span data-liveink="bitcoin_usd" data-liveink-prefix="$" data-liveink-decimals="0">—</span> </div> <div class="card"> <h3>ETH</h3> <span data-liveink="ethereum_usd" data-liveink-prefix="$" data-liveink-decimals="2">—</span> </div> <div class="card"> <h3>EUR/USD</h3> <span data-liveink="eur_usd" data-liveink-decimals="4">—</span> </div> </div>
Custom styling and no badge
<!-- Red accent, no badge, 1-minute refresh --> <script src="https://api.liveink.app/widget.js" data-key="LIK-xxxx-xxxx-xxxx" data-refresh="60" data-badge="false" data-color="#ef4444"></script>
Italian locale formatting
<p>Il Bitcoin vale attualmente <span data-liveink="bitcoin_eur" data-liveink-prefix="€" data-liveink-decimals="0" data-liveink-locale="it-IT">…</span>. L'oro è a <span data-liveink="gold_usd" data-liveink-prefix="$" data-liveink-decimals="2" data-liveink-locale="it-IT" data-liveink-suffix=" l'oncia">…</span>. </p>
Fallback for unavailable data
<p>Terremoto più recente: <span data-liveink="earthquake_latest" data-liveink-fallback="Nessun evento recente">Caricamento…</span> </p> <p>Qualità aria Roma: AQI <span data-liveink="aqi_rome" data-liveink-fallback="non disponibile">…</span> </p>
Widget Behavior
Initialization
- The script loads and reads configuration from
data-*attributes. - CSS is injected for underlines, tooltips, flash animation, and the badge.
- The API key is validated via
POST /api/widget/validate. - If valid, the first data fetch is triggered immediately.
- Subsequent fetches run at the
data-refreshinterval (default: 300s).
Update cycle
- The widget scans the DOM for all elements with
data-liveink. - It saves the original text content as
data-liveink-original. - A single batch request is sent to
POST /api/widget/update. - Returned values are formatted and injected into each element.
- Changed values trigger a brief blue flash animation (
.li-flash).
Tooltips
On hover, a tooltip shows the current value, the original value, the data source, and the last update timestamp. Tooltips follow the cursor position and appear above the element.
data-tooltip="false" on the script tag if your page already has its own tooltip system to avoid conflicts.
Styling
The widget injects minimal CSS. You can override any style with standard CSS specificity.
Default styles applied
| Selector | Description | Customizable |
|---|---|---|
[data-liveink] | Blue underline (border-bottom: 2px solid), help cursor | Yes — override with CSS |
[data-liveink]:hover | Light blue background on hover | Yes |
.li-flash | Flash animation on value change (0.6s ease-out) | Yes — redefine @keyframes liFlash |
.li-tp | Tooltip container (dark background, white text) | Yes — override .li-tp |
.li-badge | “LiveInk” badge (fixed bottom-right) | Yes — or set data-badge="false" |
Status attributes
The widget sets a data-liveink-status attribute on each element, which you can use to style different states:
| Status | Description |
|---|---|
loading | Initial state — waiting for API response |
live | Value successfully fetched and displayed |
error | Value could not be fetched |
[data-liveink-status="live"] { color: #16a34a; } [data-liveink-status="error"] { color: #dc2626; opacity: 0.6; } [data-liveink-status="loading"] { color: #94a3b8; }
Override example
/* Remove the underline */ [data-liveink] { border-bottom: none; font-weight: 700; color: #2563EB; } /* Custom flash animation */ @keyframes liFlash { 0% { background: rgba(34,197,94,.3); } 100% { background: transparent; } }
Rate Limits
Rate limits are applied per API key on a daily basis. Counters reset at midnight UTC.
| Plan | Requests / Day | Domains |
|---|---|---|
| Basic | 1,000 | 1 |
| Pro | 10,000 | 5 |
| Enterprise | 100,000 | 50 |
429 RATE_LIMIT_EXCEEDED. The widget will silently stop updating until the next day. Plan upgrades take effect immediately.
Error Handling
The widget handles errors gracefully. All errors are logged to console.warn and never displayed to end users.
| Error Code | HTTP | Cause | Resolution |
|---|---|---|---|
MISSING_KEY | 401 | No data-key attribute on script tag | Add your API key |
INVALID_KEY | 401 | Key not found in the database | Check the key is correct |
KEY_DISABLED | 403 | Key has been deactivated | Contact support |
KEY_EXPIRED | 403 | Key past expiration date | Renew your subscription |
DOMAIN_NOT_ALLOWED | 403 | Origin domain not in the allow list | Add the domain in your dashboard |
RATE_LIMIT_EXCEEDED | 429 | Daily request quota exhausted | Upgrade plan or wait until midnight UTC |
NO_ELEMENTS | 400 | Empty elements array in request body | Ensure data-liveink elements exist in DOM |
Subscription Plans
| Feature | Basic | Pro | Enterprise |
|---|---|---|---|
| Monthly price | €9.99 | €29.99 | €99.99 |
| Yearly price | €99.99 | €299.99 | €999.99 |
| Requests / day | 1,000 | 10,000 | 100,000 |
| Domains | 1 | 5 | 50 |
| Crypto (BTC, ETH, SOL) | ✓ | ✓ | ✓ |
| Forex (EUR/USD) | ✓ | ✓ | ✓ |
| Commodities (Oil WTI, Brent) | — | ✓ | ✓ |
| Macro data | — | ✓ | ✓ |
| News data | — | ✓ | ✓ |
| Custom entities | — | — | ✓ |
| Priority support | — | — | ✓ |
Support
If you need help integrating the widget or have questions about your account:
- Email: support@liveink.app
- Documentation: You are here!
- Test page: /test-widget — See the widget in action with a live demo
- Status page: /api/health — Check API availability
Enterprise customers have access to priority support with guaranteed 4-hour response time during business hours (CET).
© 2026 LiveInk. All rights reserved. — Back to Home