https://github.com/derlin/investing-historical-data
Fetch historical data from investing.com
https://github.com/derlin/investing-historical-data
Last synced: about 1 year ago
JSON representation
Fetch historical data from investing.com
- Host: GitHub
- URL: https://github.com/derlin/investing-historical-data
- Owner: derlin
- Created: 2016-08-19T12:32:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-01T06:45:43.000Z (almost 8 years ago)
- Last Synced: 2025-04-03T02:03:50.627Z (about 1 year ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 40
- Watchers: 8
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
(see other branches for development versions)
# Investing
A little command-line app to download historical data from [investing.com](http://www.investing.com/) in CSV format.
# Setup
```
git clone git@github.com:derlin/investing-historical-data.git
cd investing-historical-data
npm install
```
# Usage
To run the script, use one of the following:
```
npm start --
node investing.js
```
# Available commands
Commands:
get [name|id] get historical data
list list all available commodities
help [cmd] display help for [cmd]
Options:
-h, --help output usage information
-V, --version output the version number
## list
Get the list of available commodities.
Options:
-h, --help output usage information
-V, --version output the version number
-c --country [UK|US] list only commodities from the given country
-r --regex [search] find commodities with names matching regex. Example: ca, d, "[cad]a"
## get
Download historical data from [investing.com](http://www.investing.com/). By default, the result is printed to the console. Use `-f` if you want the csv te be saved directly into a file.
Options:
-h, --help output usage information
-V, --version output the version number
-i --id [id] id of the commodity to fetch
-s --startdate [date] start date in MM/dd/yyyy format.
-e --enddate [date] end date in MM/dd/yyyy format.
-f --file [file] result file. If none, the result will be printed to the console.
-v --verbose enable verbose mode.
# Commodities
The program supports commodities from US and UK. If you need a commodity which is not listed by `list`, you can try to find its id in the _investing.com_ page.
For example, to find the id corresponding to gold:
1. go to http://www.investing.com/commodities/gold;
2. open the developer console of your navigator;
3. in the html source file, search the string `pair_id`, for example: `
...`.
Here you go ! 8830 is the gold commodity id. You can not run `investing.js get -i 8830`.
Usually, commodities ids are between 8800-8999 or 950000-961999.