{"id":19346708,"url":"https://github.com/colkito/bitpay-rates","last_synced_at":"2025-04-23T05:30:58.763Z","repository":{"id":42216982,"uuid":"43991593","full_name":"colkito/bitpay-rates","owner":"colkito","description":"BitPay Exchange Rates API wrapper for Node.js - A tiny and easy to use library","archived":false,"fork":false,"pushed_at":"2024-06-21T09:24:30.000Z","size":764,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-07T18:16:35.929Z","etag":null,"topics":["bitcoin","bitpay","currency","dollar","nodejs","rates"],"latest_commit_sha":null,"homepage":"https://npmjs.com/bitpay-rates","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colkito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-10T03:10:51.000Z","updated_at":"2024-08-29T17:09:29.000Z","dependencies_parsed_at":"2024-05-31T01:21:05.330Z","dependency_job_id":"682d73fc-d7a7-40ae-810e-5ee9e6202713","html_url":"https://github.com/colkito/bitpay-rates","commit_stats":{"total_commits":232,"total_committers":10,"mean_commits":23.2,"dds":0.6896551724137931,"last_synced_commit":"73abfd248edf6e6f83a8eff8cae1b56b21913681"},"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colkito%2Fbitpay-rates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colkito%2Fbitpay-rates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colkito%2Fbitpay-rates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colkito%2Fbitpay-rates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colkito","download_url":"https://codeload.github.com/colkito/bitpay-rates/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223909963,"owners_count":17223592,"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":["bitcoin","bitpay","currency","dollar","nodejs","rates"],"created_at":"2024-11-10T04:11:43.371Z","updated_at":"2024-11-10T04:11:43.914Z","avatar_url":"https://github.com/colkito.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitpay-rates\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/colkito/bitpay-rates/npm-publish.yml?style=flat-square)\n[![BundlePhobia](https://img.shields.io/bundlephobia/min/bitpay-rates.svg?style=flat-square)](https://bundlephobia.com/result?p=bitpay-rates)\n[![BundlePhobia](https://img.shields.io/bundlephobia/minzip/bitpay-rates.svg?style=flat-square)](https://bundlephobia.com/result?p=bitpay-rates)\n\nA lightweight Node.js wrapper for [BitPay's](https://bitpay.com/rates) exchange rates API, now in TypeScript.\n\nZero-dependency and `promise` support for easy integration into your project. ✨\n\n## Requirements\n\n- nodejs \u003e= 12.x\n\n## Examples\n\nGetting a rate by `code`:\n\n```js\nimport bitpayRates from 'bitpay-rates';\n\nconst code = 'ARS'; // see list of codes below\n\n// Using async/await\ntry {\n  const rate = await bitpayRates.get(code);\n  console.log(`[Async/Await][${code}] Rate:`, rate);\n} catch (err) {\n  console.error(`[Async/Await][${code}] Error:`, err);\n}\n```\n\nHandling an invalid currency code:\n\n```js\nimport bitpayRates from 'bitpay-rates';\n\n// Handling an invalid currency code\nbitpayRates\n  .get('INVALID')\n  .then((rate) =\u003e console.log('[Promise][INVALID] Rate:', rate))\n  .catch((err) =\u003e console.error('[Promise][INVALID] Error:', err));\n```\n\nSuccessful response:\n\n```json\n{\n  \"code\": \"ARS\",\n  \"name\": \"Argentine Peso\",\n  \"rate\": 60612542.16\n}\n```\n\nGetting `all` the rates:\n\n```js\nimport bitpayRates from 'bitpay-rates';\n\n// Using async/await\ntry {\n  const rates = await bitpayRates.get();\n  console.log('[Async/Await] Rates:', rates);\n} catch (err) {\n  console.error('[Async/Await] Error:', err);\n}\n\n// Handling an invalid currency code\nbitpayRates\n  .get('INVALID')\n  .then((rate) =\u003e console.log('[Promise][INVALID] Rate:', rate))\n  .catch((err) =\u003e console.error('[Promise][INVALID] Error:', err));\n```\n\nSuccessful response:\n\n```json\n[\n  {\n    \"code\": \"ARS\",\n    \"name\": \"Argentine Peso\",\n    \"rate\": 5291987.02\n  },\n  {\n    \"code\": \"BUSD\",\n    \"name\": \"Binance USD\",\n    \"rate\": 57818.28\n  },\n  {...}\n]\n```\n\nMore examples [here](example/rates-example.js).\n\n## Available Codes (updated: 2024-01-24)\n\n[Follow this link](CODES.md) to see the complete list of codes.\n\n## Related Packages\n\n- [Blockchain Exchange Rates API](https://npmjs.com/blockchain-rates)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolkito%2Fbitpay-rates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolkito%2Fbitpay-rates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolkito%2Fbitpay-rates/lists"}