Investing.com Historical Market Data Access Skill
This skill provides access to historical market price data from investing.com, one of the world's leading financial information websites.
Overview
Investing.com hosts standardized financial data tables including:
- Historical OHLCV (Open, High, Low, Close, Volume) data for indices, stocks, forex, commodities, and cryptocurrencies
- Technical indicators and analysis
- Real-time quotes and charts
This skill specializes in extracting historical price data which is typically difficult for generic scrapers to access due to:
- Cloudflare bot protection
- JavaScript-rendered content
- Dynamic data loading
- Anti-scraping measures
Features
1. get_historical_data
Fetch historical price data for a specific financial instrument.
Parameters:
instrument (required): Instrument identifier - can be a slug (e.g., 'hang-sen-40'), name (e.g., 'hsi'), or numeric ID
start_date (optional): Start date in YYYY-MM-DD or MM/DD/YYYY format
end_date (optional): End date in YYYY-MM-DD or MM/DD/YYYY format
Returns:
success: Boolean indicating success
data: Array of historical price records with fields:
date: Date of the data point
close: Closing price
open: Opening price
high: High price
low: Low price
vol: Volume (if available)
change_pct: Percentage change (if available)
instrument_id: Resolved instrument ID
instrument_name: Human-readable instrument name
source: Data source ('next_data' or 'table_extraction')
Example:
{
"function": "get_historical_data",
"instrument": "hang-sen-40",
"start_date": "2024-01-01",
"end_date": "2024-01-31"
}
2. search_instrument
Search for supported instruments by name or symbol.
Parameters:
query (required): Search query string
Returns:
- List of matching instruments with their slugs and IDs
Example:
{
"function": "search_instrument",
"query": "gold"
}
3. list_supported_instruments
List all supported instruments organized by category.
Returns:
- Grouped list of instruments by category (indices, forex, commodities, crypto, stocks)
- Total count of supported instruments
Example:
{
"function": "list_supported_instruments"
}
Supported Instruments
Indices
- Hang Seng 40 (HSI):
hang-sen-40, hsi, ID: 944422
- S&P 500:
spx-500, sp500, s&p-500, ID: 20
- Dow Jones:
us-30, djia, dow-jones, ID: 169
- NASDAQ 100:
nasdaq-100, nasdaq, us-tech-100, ID: 1497
- Nikkei 225:
nikkei-225, nikkei, ID: 178
- FTSE 100:
ftse-100, ftse, ID: 27
- DAX:
dax, ID: 172
- CAC 40:
cac-40, cac, ID: 167
- Euro Stoxx 50:
euro-stoxx-50, ID: 177
- Shanghai Composite:
shanghai-composite, shanghai, ID: 39218
Forex
- EUR/USD:
eur-usd, ID: 1
- GBP/USD:
gbp-usd, ID: 3
- USD/JPY:
usd-jpy, ID: 4
- USD/CHF:
usd-chf, ID: 5
- AUD/USD:
aud-usd, ID: 6
- USD/CAD:
usd-cad, ID: 7
- NZD/USD:
nzd-usd, ID: 8
- EUR/GBP:
eur-gbp, ID: 9
- EUR/JPY:
eur-jpy, ID: 10
Commodities
- Gold:
gold, ID: 8830
- Silver:
silver, ID: 8836
- Crude Oil WTI:
crude-oil-wti, wti, ID: 8849
- Brent Oil:
brent-oil, brent, ID: 8833
- Natural Gas:
natural-gas, ID: 8862
Cryptocurrencies
- Bitcoin:
bitcoin, btc, ID: 945629
- Ethereum:
ethereum, eth, ID: 940810
Stocks (Examples)
- Apple:
aapl, ID: 6408
- Microsoft:
msft, ID: 2456
- Google/Alphabet:
googl, ID: 6562
- Amazon:
amzn, ID: 237
- Tesla:
tsla, ID: 6347
Technical Details
Data Extraction Methods
The skill uses two extraction methods:
Next.js Data Extraction: Attempts to extract data from __NEXT_DATA__ script tag, which contains the server-rendered props including historical data.
Table Scraping: Falls back to parsing HTML tables when Next.js data is not available.
Cloudflare Handling
Investing.com is protected by Cloudflare's anti-bot system. The skill:
- Uses Playwright browser automation with Chromium
- Implements anti-detection measures (webdriver flag removal, etc.)
- Waits for JavaScript challenges to complete
- Uses realistic browser fingerprinting
Limitations
- Rate Limiting: Cloudflare may still block requests during high traffic or if rate limits are exceeded
- Cookies Required: Some sessions may require cookies from initial page visits
- Dynamic Content: Data is loaded dynamically and may require waiting
- Instrument Coverage: Not all instruments are pre-mapped; use numeric IDs for others
Error Handling
The skill returns structured error responses:
{
"success": false,
"error": "Cloudflare challenge not passed",
"url": "https://www.investing.com/indices/hang-sen-40-historical-data"
}
Requirements
- Python 3.8+
- Playwright with Chromium browser (
pip install playwright && playwright install chromium)
- aiohttp
Dependencies
pip install playwright aiohttp
playwright install chromium
Use Cases
- Market Analysis: Fetch historical price data for technical analysis
- Backtesting: Get historical data for trading strategy backtesting
- Data Aggregation: Collect price data for multiple instruments
- Price Monitoring: Track historical price movements over time
Notes
- The skill may take 10-20 seconds to complete due to Cloudflare challenge handling
- Data quality depends on investing.com's data availability
- Some less liquid instruments may have limited historical data
- Weekend and holiday data may be missing depending on market hours
1---2name: www-investing-com3description: Investing.com Historical Market Data Access Skill4---5# Investing.com Historical Market Data Access Skill67This skill provides access to historical market price data from investing.com, one of the world's leading financial information websites.89## Overview1011Investing.com hosts standardized financial data tables including:12- Historical OHLCV (Open, High, Low, Close, Volume) data for indices, stocks, forex, commodities, and cryptocurrencies13- Technical indicators and analysis14- Real-time quotes and charts1516This skill specializes in extracting **historical price data** which is typically difficult for generic scrapers to access due to:17- Cloudflare bot protection18- JavaScript-rendered content19- Dynamic data loading20- Anti-scraping measures2122## Features2324### 1. get_historical_data2526Fetch historical price data for a specific financial instrument.2728**Parameters:**29- `instrument` (required): Instrument identifier - can be a slug (e.g., 'hang-sen-40'), name (e.g., 'hsi'), or numeric ID30- `start_date` (optional): Start date in YYYY-MM-DD or MM/DD/YYYY format31- `end_date` (optional): End date in YYYY-MM-DD or MM/DD/YYYY format3233**Returns:**34- `success`: Boolean indicating success35- `data`: Array of historical price records with fields:36 - `date`: Date of the data point37 - `close`: Closing price38 - `open`: Opening price39 - `high`: High price40 - `low`: Low price41 - `vol`: Volume (if available)42 - `change_pct`: Percentage change (if available)43- `instrument_id`: Resolved instrument ID44- `instrument_name`: Human-readable instrument name45- `source`: Data source ('next_data' or 'table_extraction')4647**Example:**48```json49{50 "function": "get_historical_data",51 "instrument": "hang-sen-40",52 "start_date": "2024-01-01",53 "end_date": "2024-01-31"54}55```5657### 2. search_instrument5859Search for supported instruments by name or symbol.6061**Parameters:**62- `query` (required): Search query string6364**Returns:**65- List of matching instruments with their slugs and IDs6667**Example:**68```json69{70 "function": "search_instrument",71 "query": "gold"72}73```7475### 3. list_supported_instruments7677List all supported instruments organized by category.7879**Returns:**80- Grouped list of instruments by category (indices, forex, commodities, crypto, stocks)81- Total count of supported instruments8283**Example:**84```json85{86 "function": "list_supported_instruments"87}88```8990## Supported Instruments9192### Indices93- Hang Seng 40 (HSI): `hang-sen-40`, `hsi`, ID: 94442294- S&P 500: `spx-500`, `sp500`, `s&p-500`, ID: 2095- Dow Jones: `us-30`, `djia`, `dow-jones`, ID: 16996- NASDAQ 100: `nasdaq-100`, `nasdaq`, `us-tech-100`, ID: 149797- Nikkei 225: `nikkei-225`, `nikkei`, ID: 17898- FTSE 100: `ftse-100`, `ftse`, ID: 2799- DAX: `dax`, ID: 172100- CAC 40: `cac-40`, `cac`, ID: 167101- Euro Stoxx 50: `euro-stoxx-50`, ID: 177102- Shanghai Composite: `shanghai-composite`, `shanghai`, ID: 39218103104### Forex105- EUR/USD: `eur-usd`, ID: 1106- GBP/USD: `gbp-usd`, ID: 3107- USD/JPY: `usd-jpy`, ID: 4108- USD/CHF: `usd-chf`, ID: 5109- AUD/USD: `aud-usd`, ID: 6110- USD/CAD: `usd-cad`, ID: 7111- NZD/USD: `nzd-usd`, ID: 8112- EUR/GBP: `eur-gbp`, ID: 9113- EUR/JPY: `eur-jpy`, ID: 10114115### Commodities116- Gold: `gold`, ID: 8830117- Silver: `silver`, ID: 8836118- Crude Oil WTI: `crude-oil-wti`, `wti`, ID: 8849119- Brent Oil: `brent-oil`, `brent`, ID: 8833120- Natural Gas: `natural-gas`, ID: 8862121122### Cryptocurrencies123- Bitcoin: `bitcoin`, `btc`, ID: 945629124- Ethereum: `ethereum`, `eth`, ID: 940810125126### Stocks (Examples)127- Apple: `aapl`, ID: 6408128- Microsoft: `msft`, ID: 2456129- Google/Alphabet: `googl`, ID: 6562130- Amazon: `amzn`, ID: 237131- Tesla: `tsla`, ID: 6347132133## Technical Details134135### Data Extraction Methods136137The skill uses two extraction methods:1381391. **Next.js Data Extraction**: Attempts to extract data from `__NEXT_DATA__` script tag, which contains the server-rendered props including historical data.1401412. **Table Scraping**: Falls back to parsing HTML tables when Next.js data is not available.142143### Cloudflare Handling144145Investing.com is protected by Cloudflare's anti-bot system. The skill:1461471. Uses Playwright browser automation with Chromium1482. Implements anti-detection measures (webdriver flag removal, etc.)1493. Waits for JavaScript challenges to complete1504. Uses realistic browser fingerprinting151152### Limitations153154- **Rate Limiting**: Cloudflare may still block requests during high traffic or if rate limits are exceeded155- **Cookies Required**: Some sessions may require cookies from initial page visits156- **Dynamic Content**: Data is loaded dynamically and may require waiting157- **Instrument Coverage**: Not all instruments are pre-mapped; use numeric IDs for others158159## Error Handling160161The skill returns structured error responses:162163```json164{165 "success": false,166 "error": "Cloudflare challenge not passed",167 "url": "https://www.investing.com/indices/hang-sen-40-historical-data"168}169```170171## Requirements172173- Python 3.8+174- Playwright with Chromium browser (`pip install playwright && playwright install chromium`)175- aiohttp176177## Dependencies178179```bash180pip install playwright aiohttp181playwright install chromium182```183184## Use Cases1851861. **Market Analysis**: Fetch historical price data for technical analysis1872. **Backtesting**: Get historical data for trading strategy backtesting1883. **Data Aggregation**: Collect price data for multiple instruments1894. **Price Monitoring**: Track historical price movements over time190191## Notes192193- The skill may take 10-20 seconds to complete due to Cloudflare challenge handling194- Data quality depends on investing.com's data availability195- Some less liquid instruments may have limited historical data196- Weekend and holiday data may be missing depending on market hours