{"id":23458090,"url":"https://github.com/loaiabdalslam/mkt","last_synced_at":"2025-04-14T02:51:18.781Z","repository":{"id":51774137,"uuid":"196585116","full_name":"loaiabdalslam/MKT","owner":"loaiabdalslam","description":"Exchange Price Service , Stocks , Cryptocurrency,Stock prediction and more ","archived":false,"fork":false,"pushed_at":"2021-05-10T03:40:58.000Z","size":9560,"stargazers_count":31,"open_issues_count":4,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T16:51:04.788Z","etag":null,"topics":["api","bitcoin-price","coinmarketcap","crypto","currency-converter","exchange","marketcap","stock-market"],"latest_commit_sha":null,"homepage":"https://loaiabdalslam.github.io/mkt-website/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loaiabdalslam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-12T13:35:27.000Z","updated_at":"2025-01-16T16:58:25.000Z","dependencies_parsed_at":"2022-08-03T03:00:15.980Z","dependency_job_id":null,"html_url":"https://github.com/loaiabdalslam/MKT","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loaiabdalslam%2FMKT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loaiabdalslam%2FMKT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loaiabdalslam%2FMKT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loaiabdalslam%2FMKT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loaiabdalslam","download_url":"https://codeload.github.com/loaiabdalslam/MKT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248813824,"owners_count":21165631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bitcoin-price","coinmarketcap","crypto","currency-converter","exchange","marketcap","stock-market"],"created_at":"2024-12-24T05:15:47.343Z","updated_at":"2025-04-14T02:51:18.762Z","avatar_url":"https://github.com/loaiabdalslam.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# MKT\n\n![MKT.JS](./media/mkt.jpg)\n\n![mkt](https://img.shields.io/npm/dw/@mkt-eg/mkt.svg)\n![mkt](https://img.shields.io/github/stars/loaiabdalslam/MKT.svg?style=social)\n![mkt](https://img.shields.io/github/forks/loaiabdalslam/MKT.svg?style=social)\n![mkt](https://img.shields.io/github/last-commit/loaiabdalslam/mkt.svg)\n\nMKT.js is an Exchange Price Service , Stocks , Cryptocurrency,Stock prediction and more \\\nThis package contains hundreds of currencies, cryptocurrencies and stocks prices.\\\n6,096 coin , 283,037 TRADING PAIRS , 31 News Provider It also works with the TensorFlow  Read more here [Read more about crypto-compare service](https://min-api.cryptocompare.com/faq)\nfor market forecasting / stock prediction using RNN and also works on the visualizing of stocks data using canvas.js\n\n## Dependencies\n- Neural Networks (brain.js)\n- Tensorflow Framework ( tensorflow.js )\n- Main Api ( min-api.cryptocompare.com )\n\n\n###  Get started :\n#### 1 -  Get Full details response (multiple fsym \u0026 tsym)\n\n```\nconst { MKT } = require('@mkt-eg/mkt')\n\nconst mkt = new MKT(\n  'bbbc22c3a13c74456a6d4bb7ba5745476ebfdc81c867fc240258122b78eb6a6f'\n)\nconst data = mkt\n  .exchange({\n    fsym: 'BTC',\n    tsyms: 'USD',\n    type: 'full'\n  })\n  .then(response =\u003e {\n    console.log(JSON.stringify(response.data))\n  })\n  .catch(error =\u003e {\n    console.log(error)\n  })\n```\nJSON OUTPUT\n\n```\n\n{\n   \"RAW\":{\n      \"BTC\":{\n         \"USD\":{\n            \"TYPE\":\"5\",\n            \"MARKET\":\"CCCAGG\",\n            \"FROMSYMBOL\":\"BTC\",\n            \"TOSYMBOL\":\"USD\",\n            \"FLAGS\":\"2\",\n            \"PRICE\":9885.11,\n            \"LASTUPDATE\":1563398729,\n            \"LASTVOLUME\":0.1,\n            \"LASTVOLUMETO\":986.6100000000001,\n            \"LASTTRADEID\":\"379345663\",\n            \"VOLUMEDAY\":93692.97987050914,\n            \"VOLUMEDAYTO\":893517565.3549776,\n            \"VOLUME24HOUR\":104598.9946433591,\n            \"VOLUME24HOURTO\":997000834.8997525,\n            \"OPENDAY\":9423.44,\n            \"HIGHDAY\":9982.24,\n            \"LOWDAY\":9086.51,\n            \"OPEN24HOUR\":9649.99,\n            \"HIGH24HOUR\":9988.35,\n            \"LOW24HOUR\":9076.48,\n            \"LASTMARKET\":\"Bitfinex\",\n            \"VOLUMEHOUR\":2210.51459713301,\n            \"VOLUMEHOURTO\":21755061.31969251,\n            \"OPENHOUR\":9692.2,\n            \"HIGHHOUR\":9943.53,\n            \"LOWHOUR\":9663.39,\n            \"TOPTIERVOLUME24HOUR\":101424.52271706509,\n            \"TOPTIERVOLUME24HOURTO\":966363837.9391046,\n            \"CHANGE24HOUR\":235.1200000000008,\n            \"CHANGEPCT24HOUR\":2.436479208786753,\n            \"CHANGEDAY\":461.6700000000001,\n            \"CHANGEPCTDAY\":4.899166334162472,\n            \"SUPPLY\":17823212,\n            \"MKTCAP\":176184411173.32,\n            \"TOTALVOLUME24H\":720083.9899007804,\n            \"TOTALVOLUME24HTO\":7081137716.36884,\n            \"TOTALTOPTIERVOLUME24H\":425384.18596477184,\n            \"TOTALTOPTIERVOLUME24HTO\":4168740744.7056427,\n            \"IMAGEURL\":\"/media/19633/btc.png\"\n         }\n      }\n   },\n   \"DISPLAY\":{\n      \"BTC\":{\n         \"USD\":{\n            \"FROMSYMBOL\":\"Ƀ\",\n            \"TOSYMBOL\":\"$\",\n            \"MARKET\":\"CryptoCompare Index\",\n            \"PRICE\":\"$ 9,885.11\",\n            \"LASTUPDATE\":\"Just now\",\n            \"LASTVOLUME\":\"Ƀ 0.1000\",\n            \"LASTVOLUMETO\":\"$ 986.61\",\n            \"LASTTRADEID\":\"379345663\",\n            \"VOLUMEDAY\":\"Ƀ 93,693.0\",\n            \"VOLUMEDAYTO\":\"$ 893,517,565.4\",\n            \"VOLUME24HOUR\":\"Ƀ 104,599.0\",\n            \"VOLUME24HOURTO\":\"$ 997,000,834.9\",\n            \"OPENDAY\":\"$ 9,423.44\",\n            \"HIGHDAY\":\"$ 9,982.24\",\n            \"LOWDAY\":\"$ 9,086.51\",\n            \"OPEN24HOUR\":\"$ 9,649.99\",\n            \"HIGH24HOUR\":\"$ 9,988.35\",\n            \"LOW24HOUR\":\"$ 9,076.48\",\n            \"LASTMARKET\":\"Bitfinex\",\n            \"VOLUMEHOUR\":\"Ƀ 2,210.51\",\n            \"VOLUMEHOURTO\":\"$ 21,755,061.3\",\n            \"OPENHOUR\":\"$ 9,692.20\",\n            \"HIGHHOUR\":\"$ 9,943.53\",\n            \"LOWHOUR\":\"$ 9,663.39\",\n            \"TOPTIERVOLUME24HOUR\":\"Ƀ 101,424.5\",\n            \"TOPTIERVOLUME24HOURTO\":\"$ 966,363,837.9\",\n            \"CHANGE24HOUR\":\"$ 235.12\",\n            \"CHANGEPCT24HOUR\":\"2.44\",\n            \"CHANGEDAY\":\"$ 461.67\",\n            \"CHANGEPCTDAY\":\"4.90\",\n            \"SUPPLY\":\"Ƀ 17,823,212.0\",\n            \"MKTCAP\":\"$ 176.18 B\",\n            \"TOTALVOLUME24H\":\"Ƀ 720.08 K\",\n            \"TOTALVOLUME24HTO\":\"$ 7.08 B\",\n            \"TOTALTOPTIERVOLUME24H\":\"Ƀ 425.38 K\",\n            \"TOTALTOPTIERVOLUME24HTO\":\"$ 4.17 B\",\n            \"IMAGEURL\":\"/media/19633/btc.png\"\n         }\n      }\n   }\n}\n\n\n```\n\n#### 2 -  Get Single price response (Single Ftsym only)\n\n```\nconst { MKT } = require('@mkt-eg/mkt')\n\nconst mkt = new MKT(\n  'bbbc22c3a13c74456a6d4bb7ba5745476ebfdc81c867fc240258122b78eb6a6f'\n)\nconst data = mkt\n  .exchange({\n    fsym: 'BTC', // Single Fysm only\n    tsyms: 'USD,EGP', // Multiaple Tsyms is allowed\n    type: 'single'\n  })\n  .then(response =\u003e {\n    console.log(JSON.stringify(response.data))\n  })\n  .catch(error =\u003e {\n    console.log(error)\n  })\n\n```\nJSON OUTPUT\n\n```\n{\n   \"USD\":9888.01,\n   \"EGP\":182256.26\n}\n````\n\n\n#### 3 -  Get Multiaple price response\n\n```\nconst { MKT } = require('@mkt-eg/mkt')\n\nconst mkt = new MKT(\n  'bbbc22c3a13c74456a6d4bb7ba5745476ebfdc81c867fc240258122b78eb6a6f'\n)\nconst data = mkt\n  .exchange({\n    fsym: 'BTC,ETH', // Single Fysm only\n    tsyms: 'USD,EGP', // Multiaple Tsyms is allowed\n    type: 'multi'\n  })\n  .then(response =\u003e {\n    console.log(JSON.stringify(response.data))\n  })\n  .catch(error =\u003e {\n    console.log(error)\n  })\n\n```\n JSON OUTPUT\n\n```\n{\n   \"BTC\":{\n      \"USD\":9906.65,\n      \"EGP\":182256.26\n   },\n   \"ETH\":{\n      \"USD\":215.27,\n      \"EGP\":3964.07\n   }\n}\n\n```\n\n\n#### 4 - Historical Day/hour/minute OHLCV\nGet open, high, low, close, volumefrom and volumeto from the daily historical data.The values are based on 00:00 GMT time. It uses BTC conversion if data is not available because the coin is not trading in the specified currency. If you want to get all the available historical data, you can use limit=2000 and keep going back in time using the toTs param. You can then keep requesting batches using: \u0026limit=2000\u0026toTs={the earliest timestamp received}.\n\n * apiType parms : 'day' or 'hour' or 'minute'\n * you can left some parameter empty its okay\n * to know more about Request Params please read [Here](https://min-api.cryptocompare.com/documentation?key=Historical\u0026cat=dataHistoday)\n\n```\nconst { MKT } = require('@mkt-eg/mkt')\nconst MKT = new MKT('bbbc22c3a13c74456a6d4bb7ba5745476ebfdc81c867fc240258122b78eb6a6f')\nMKT.historical({\n  sympolPrice: 'true',\n  e: 'CCCAGG',\n  fsym: 'BTC',\n  tsyms: 'USD',\n  type: 'single',\n  aggregate: '1',\n  aggregatePredictableTimePeriods: true,\n  limit: 100,\n  allData: 'false',\n  extraParams: 'NotAvailable',\n  sign: 'false',\n  apiType: 'hour'\n}).then((results)=\u003e{\n console.log(results.data)\n})\n```\n JSON OUTPUT\n\n```\n\n{\n   \"Response\":\"Success\",\n   \"Type\":100,\n   \"Aggregated\":false,\n   \"Data\":[\n      \n      {\n         \"time\":1563544800,\n         \"close\":10341.37,\n         \"high\":10425.08,\n         \"low\":10284.69,\n         \"open\":10319.53,\n         \"volumefrom\":1326,\n         \"volumeto\":13724171.79\n      },\n      {..},\n      {..},\n      {..}\n   ],\n   \"TimeTo\":1563544800,\n   \"TimeFrom\":1563526800,\n   \"FirstValueInArray\":true,\n   \"ConversionType\":{\n      \"type\":\"direct\",\n      \"conversionSymbol\":\"\"\n   },\n   \"RateLimit\":{\n\n   },\n   \"HasWarning\":false\n}\n\n```\n\n#### 4 - Stock Prediction \n\nBefore you start in this section, I recommend that you consult some libraries that can help you to build Neural Network through JavaScript, because we will use them in this section like : [Brain.js]([https://github.com/BrainJS/brain.js)\n\n````\n\nconst array = require('lodash/array');\nconst { MKT } = require('@mkt-eg/mkt')\n\nconst MKT = new MKT('bbbc22c3a13c74456a6d4bb7ba5745476ebfdc81c867fc240258122b78eb6a6f')\nMKT.historical({\n  sympolPrice: 'true',\n  e: 'CCCAGG',\n  fsym: 'BTC',\n  tsyms: 'USD',\n  type: 'single',\n  aggregate: '1',\n  aggregatePredictableTimePeriods: true,\n  limit: 30,\n  allData: 'false',\n  extraParams: 'NotAvailable',\n  sign: 'false',\n  apiType: 'day'\n}).then((results)=\u003e{\nconst data = JSON.stringify(results.data) \nconst options = {\nrawData:data,\nchunkSize:5,// split data into 5 series array\nforcastList:array.chunk(rawData,5)[3], // Get The last series from data.\nsteps:30, // predicit the next 30 days\nNNOptions: {\n      inputSize: 4,\n      hiddenLayers: [4,4],\n      outputSize: 4,\n      learningRate: 0.01,\n      decayRate: 0.999,\n},    \ntrainOptions:{\n      iterations: 20000,    // the maximum times to iterate the training data --\u003e number greater than 0\n      errorThresh: 0.005,   // the acceptable error percentage from training data --\u003e number between 0 and 1\n      log: true,           // true to use console.log, when a function is supplied it is used --\u003e Either true or a function\n      logPeriod: 10,        // iterations between logging out --\u003e number greater than 0\n      learningRate: 0.3,    // scales with delta to effect training rate --\u003e number between 0 and 1\n      momentum: 0.1,        // scales with next layer's change value --\u003e number between 0 and 1\n      callback: null,       // a periodic call back that can be triggered while training --\u003e null or function\n      callbackPeriod: 10,   // the number of iterations through the training data between callback calls --\u003e number greater than 0\n      timeout: Infinity     // the max number of milliseconds to train for --\u003e number greater than 0\n} \n}\n\n console.log(MKT.predict(options))\n \n})\n\n\n````\n\nOutput\n```\n[ {\n\t\"close\":11740.34,\n\t\"high\":11778.22,\n\t\"low\":10992.37,\n\t\"open\":11035.74,\n   },\n   {..},\n   {..},\n   {..}\n   ...\n]\n```\n\n\n## Some of the ideas I put forward and you can get started:\n- Add processing of natural languages to increase confidence in prices that have been predicted\n- Add simulation of the investment process and the development of some strategies of trades.\n- Monitor the markets and manufacture a global dashboard.\n- add simples and examples using MKT.JS\n\n\n## contributions\n- For the first contributor you can delete the file and be the first shareholder (I left it to you)\n- For the rest, if you think of an idea, you should make pull request and apply it immediately.\n\n\nAuthor : Loaii abdalslam\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floaiabdalslam%2Fmkt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floaiabdalslam%2Fmkt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floaiabdalslam%2Fmkt/lists"}