{"id":18285884,"url":"https://github.com/exodusmovement/prices","last_synced_at":"2025-04-05T07:32:35.907Z","repository":{"id":33153924,"uuid":"136527834","full_name":"ExodusMovement/prices","owner":"ExodusMovement","description":"JavaScript module to get historical prices for cryptocurrencies / blockchain assets.","archived":false,"fork":false,"pushed_at":"2023-01-26T02:42:05.000Z","size":165,"stargazers_count":4,"open_issues_count":6,"forks_count":9,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-03-21T00:33:08.421Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ExodusMovement.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-07T20:29:47.000Z","updated_at":"2024-01-17T07:52:52.000Z","dependencies_parsed_at":"2023-02-14T13:31:04.922Z","dependency_job_id":null,"html_url":"https://github.com/ExodusMovement/prices","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExodusMovement%2Fprices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExodusMovement%2Fprices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExodusMovement%2Fprices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExodusMovement%2Fprices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ExodusMovement","download_url":"https://codeload.github.com/ExodusMovement/prices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305879,"owners_count":20917201,"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":[],"created_at":"2024-11-05T13:18:04.482Z","updated_at":"2025-04-05T07:32:30.844Z","avatar_url":"https://github.com/ExodusMovement.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Historical Cryptocurrency Prices\n=====================\n\n[![npm][npm-image]][npm-url]\n[![travis][travis-image]][travis-url]\n[![standard][standard-image]][standard-url]\n\n[npm-image]: https://img.shields.io/npm/v/@exodus/prices.svg?style=flat-square\n[npm-url]: https://www.npmjs.com/package/@exodus/prices\n[travis-image]: https://img.shields.io/travis/ExodusMovement/prices.svg?style=flat-square\n[travis-url]: https://travis-ci.org/ExodusMovement/prices\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\n[standard-url]: http://npm.im/standard\n\nYou can use this JavaScript module to get historical prices for cryptocurrencies / blockchain assets.\n\n\nInstall\n-------\n\n    npm i --save @exodus/prices\n\n\nUsage\n-----\n\n### Methods\n\n### `fetchPrice()`\n\n*parameters:*\n- `fromSym`: `\u003cstring\u003e`: An asset or fiat string symbol.\n- `toSym`: `\u003cstring\u003e`: An asset or fiat string symbol.\n- `date`: `\u003cDate\u003e`: An instance of `Date` representing some date in the past.\n\n*Example:*\n\n```js\nglobal.fetch = require('node-fetch') // not necessary in the browser\nconst { fetchPrice } = require('@exodus/prices')\n\nconst t1 = new Date('2017-01-10 12:25 CST')\nconst btcPrice = await fetchPrice('BTC', 'USD', t1)\nconsole.log(btcPrice.toFixed(2)) // =\u003e 903.30\n\nconst ethPrice = await fetchPrice('ETH', 'USD', t1)\nconsole.log(ethPrice.toFixed(2)) // =\u003e 10.47\n```\n\n\n### Notes\n\n1. Requires `global.fetch`\n\nthis depends on [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch) being defined globally.\n\n- If you are using this in Electron, it should work without any configuration assuming it's running in the renderer process.\n- If you are using this in Node.js, you will need to use [`node-fetch`](https://www.npmjs.com/package/node-fetch).\n\n2. This depends upon the [cryptocompare](https://github.com/ExodusMovement/cryptocompare) API.\n\n3. Granularity is only limited to daily. Thus, anytime in the day uses a simple linear interpolation between the open and close prices.\n\n4. Occasionally cryptocompare's historical data changes. See https://github.com/ExodusMovement/audit-pricing/commit/2f9cc8cb61eb2e38983c3fee704943d67c6a9ef5 as an example.\n\n\nWork With Exodus?\n-----------------\n\nIf cryptocurrencies are interesting to you and you want to help solve some insanely challenging computer science problems, maybe you'd like to work at Exodus? Reach out and apply here: https://www.exodus.io/careers/\n\n\nLicense\n-------\n\n[MIT](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexodusmovement%2Fprices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexodusmovement%2Fprices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexodusmovement%2Fprices/lists"}