Coder Social home page Coder Social logo

davideviolante / investing-com-api Goto Github PK

View Code? Open in Web Editor NEW
78.0 7.0 26.0 1.46 MB

Unofficial APIs for Investing.com website.

License: MIT License

JavaScript 100.00%
investing investing-api finance finance-api markets markets-api indices stocks etfs bonds

investing-com-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

investing-com-api's Issues

Fix tests on v4

Since v4 uses Puppeteer, mocha tests fails. Fix them somehow.

APIs changes

APIs used from investing.com website changed. This lib needs an update.

Example:
https://www.investing.com/currencies/gbp-usd

2 is id
P3M is period
P1D is interval
120 is candle count

curl 'https://api.investing.com/api/financialdata/2/historical/chart/?period=P3M&interval=P1D&pointscount=120' \
  -H 'authority: api.investing.com' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'domain-id: www' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Linux"' \
  -H 'origin: https://www.investing.com' \
  -H 'sec-fetch-site: same-site' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: https://www.investing.com/' \
  --compressed

Add 2 more parameters about the volumes

item[5] and item[6] probably (help wanted) represents the volume, add them into the APIs.

Eg for dow jones:

        [
            1645660800000,
            32830.33,
            33269.34,
            32272.64,
            33223.83,
            593186432, // volume?
            0 // volume?
        ],

Max memory and restart windows server

Hello I am currently having some major problems using it

After starting the system for about 1 hour - 2 hours, RAM usage suddenly increases to 90% and restarts the server
Currently, I have used PM2 and rebooted every hour but the RAM is still at 90%.

My device configuration:
Windows server 2016
RAM: 16GB
CPU: 8 cores
400GB SSD

my source:

async investing(body = {
        type: 'klines/realtime',
        name: '', //https://github.com/DavideViolante/investing-com-api/blob/master/mapping.js
        period: 'P1D, P1W, P1M, P3M, P6M, P1Y, P5Y, MAX',
        interval: 'PT1M, PT5M, PT15M, PT30M, PT1H, PT5H, P1D, P1W, P1M',
        pointcount: '60, 70, 120',
        pptrLaunchOptions: undefined,
    }) {
        let response = await investing(body.name, body.period, body.interval, Number(body.pointcount), body.pptrLaunchOptions);
        return ....
    },

Looking forward to receiving comments.

Please make an API guide doc

Hi Davide, thanks for your code. Actually I think the investing.com API package is a creative solution. But seems that the API guide doc is not ready yet. Or can I find it somewhere? I hope you could give me a hint. Thanks!

I am unable to get results

Hallo, I appreciate your work and I really would like to be able to use for retieving data, but unfortunately in my case I can't.
What I did so far:
npm i investing-com-api
(warn on finishing about puppeteer version deprecated...)
Created a myfile.js file with content as for your example.
Launched myfile.js with:
node myfile.js
The script runs with no errors, but nothing appears as result on the terminal.
Am I missing something?
Thank you.

Add some missing indices

Need a solution to bypass args for launch pupperteer

Current;y, I need run my system as root user, so I need made hardcode add "--no-sandbox" in index.js for puppeteer, Could we have solution let user easy add the parameters when launch time.

Example code:
const browser = await puppeteer.launch({args: ["--no-sandbox"]});

Request failed with status code 403

OS: Windows 10 Pro 21H1
Node.js: node-v14.20.0-win-x64

==================================================================
Welcome to Node.js v14.20.0.
Type ".help" for more information.

.load ../test.js

const { investing } = require('investing-com-api');

async function main() {
try {
const response1 = await investing('currencies/eur-usd');
const response2 = await investing('currencies/eur-usd', 'P1M', 'P1D'); // With optional params
} catch (err) {
console.error(err);
}
}

main();

Promise {
,
[Symbol(async_id_symbol)]: 95,
[Symbol(trigger_async_id_symbol)]: 5,
[Symbol(destroyed)]: { destroyed: false }
}
> Request failed with status code 403
Request failed with status code 403

The response is undefined

Hi, I write a demo from the README file

const { investing } = require("investing-com-api");

async function main() {
  console.log("begin");
  const response = await investing("currencies/eur-usd");
  console.log(`response is ${response}`);
  // response = [ { date: Timestamp, value: Number }, {...}, ... ]
}

main();

and I get the result from the terminal. I don't know what's wrong. Thank you!

node ./main.js 
begin
No response.data.candles found
response is undefined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.