DEV Community

gia ly bui
gia ly bui

Posted on

How to Get Real-Time Stock Prices in 5 Minutes (Free API)

Real-time stock quotes don't have to mean signing up for an expensive
market-data feed. Here's a dead-simple API that returns a full quote —
price, daily change, open/high/low, volume, exchange — in one call.

Step 1: Get a key (optional free tier)

The API has a free tier (100 requests/month) at:
https://api.market/store/viv-data/stock

Grab an x-api-key, no credit card needed for the free tier.

Step 2: Make a request

curl "https://prod.api.market/api/v1/viv-data/stock/quote?symbol=AAPL" \
  -H "x-api-key: YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

Step 3: Read the response

{
  "symbol": "AAPL",
  "name": "Apple Inc.",
  "price": 333.79,
  "change": 3.47,
  "change_percent": 1.05,
  "open": 333.20,
  "high": 334.54,
  "low": 330.61,
  "volume": 54430322,
  "previous_close": 330.32,
  "exchange": "NASDAQ",
  "currency": "USD"
}
Enter fullscreen mode Exit fullscreen mode

Step 4: Use it in your project

async function getQuote(symbol) {
  const res = await fetch(
    `https://prod.api.market/api/v1/viv-data/stock/quote?symbol=${symbol}`,
    { headers: { "x-api-key": process.env.API_MARKET_KEY } }
  );
  return res.json();
}
Enter fullscreen mode Exit fullscreen mode

That's it. One endpoint, one parameter. Works for US and
international symbols (0700.HK, TSLA, 7203.T).

Pricing: free tier for testing, then $9.99/mo for 10k calls.
Results are cached 5 minutes.

[Link: https://api.market/store/viv-data/stock]

Top comments (0)