DEV Community

Cristiano Andrade
Cristiano Andrade

Posted on AI-assisted

How to get Investing.com data (quotes, history, economic calendar) in Python in 2026

Investing.com is one of the best free sources of market data: stocks, ETFs, forex, crypto, commodities, bonds, plus the economic calendar most traders keep open all day. The problem is that Investing.com has no public API, and DIY scrapers tend to break whenever the site changes.

I maintain an unofficial Investing.com Ultimate API on RapidAPI that returns this data as clean JSON. This post shows how to use it from Python and Node.js.

What you can get

  • Quotes & overview for stocks, ETFs, funds, indices, forex pairs, crypto, commodities, bonds and certificates
  • Historical prices (daily, weekly, monthly OHLC) with custom date ranges
  • Economic calendar filtered by country and importance, plus earnings, dividends, IPO, splits and market-holiday calendars
  • Company data: profile, financial statements, ratios, earnings, analyst forecasts
  • Technical analysis, market movers, news, and symbol search by ticker, ISIN or name
  • 32 languages and price conversion to any currency

Setup

  1. Get an API key on the RapidAPI listing.
  2. Send two headers with every request:
X-RapidAPI-Key:  YOUR_KEY
X-RapidAPI-Host: investing-com-ultimate-api.p.rapidapi.com
Enter fullscreen mode Exit fullscreen mode

Python

import requests

HOST = "investing-com-ultimate-api.p.rapidapi.com"
HEADERS = {"X-RapidAPI-Key": "YOUR_KEY", "X-RapidAPI-Host": HOST}

def get(path, **params):
    r = requests.get(f"https://{HOST}{path}", headers=HEADERS, params=params, timeout=30)
    r.raise_for_status()
    return r.json()

# 1. Apple quote
print(get("/v2/stocks", symbol="AAPL", country="US"))

# 2. Apple daily prices since January 2025
print(get("/v2/stocks/historical", symbol="AAPL", country="US", **{"from": "2025-01-01"}))

# 3. This week's high-impact US economic events
print(get("/v2/calendars/economic", countries="US", importance="high"))
Enter fullscreen mode Exit fullscreen mode

The v2 pattern is the same for every asset class: pick the asset (stocks, etfs, indices, currencies, crypto, commodities, bonds...), pass a symbol, and add country for stocks and ETFs. Append /historical, /technical or /news for more.

Node.js

const HOST = "investing-com-ultimate-api.p.rapidapi.com";

async function get(path, params = {}) {
  const url = `https://${HOST}${path}?${new URLSearchParams(params)}`;
  const res = await fetch(url, {
    headers: { "X-RapidAPI-Key": process.env.RAPIDAPI_KEY, "X-RapidAPI-Host": HOST },
  });
  if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
  return res.json();
}

console.log(await get("/v2/currencies", { symbol: "EUR/USD" }));
console.log(await get("/v2/crypto/technical", { symbol: "BTC" }));
console.log(await get("/v2/markets/movers", { country: "US", type: "gainers" }));
Enter fullscreen mode Exit fullscreen mode

Ideas for what to build

  • A trading bot or backtester fed with historical OHLC data
  • A Telegram/Discord bot that posts high-impact economic events before they hit
  • A portfolio tracker or stock screener
  • A macro dashboard combining the economic calendar with index and bond yields

Links

Not affiliated with or endorsed by Investing.com.

Top comments (0)