{"id":20426523,"url":"https://github.com/futurestudio/fixer-node","last_synced_at":"2025-04-12T19:07:44.613Z","repository":{"id":32275254,"uuid":"132117353","full_name":"futurestudio/fixer-node","owner":"futurestudio","description":"Node.js library to access the fixer.io API for currency conversion and exchange rates","archived":false,"fork":false,"pushed_at":"2024-08-09T09:43:14.000Z","size":172,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-11T12:17:04.146Z","etag":null,"topics":["currency-conversion","exchange-rate","fixer","fixer-node","future-studio-university","request-exchange-rates"],"latest_commit_sha":null,"homepage":"","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/futurestudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-05-04T09:13:08.000Z","updated_at":"2024-08-09T09:43:12.000Z","dependencies_parsed_at":"2023-02-17T03:31:08.240Z","dependency_job_id":"ffff351d-42ee-4f03-a4cb-f70a8b92a9e5","html_url":"https://github.com/futurestudio/fixer-node","commit_stats":null,"previous_names":["fs-opensource/fixer-node"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurestudio%2Ffixer-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurestudio%2Ffixer-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurestudio%2Ffixer-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futurestudio%2Ffixer-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/futurestudio","download_url":"https://codeload.github.com/futurestudio/fixer-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224742317,"owners_count":17362232,"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":["currency-conversion","exchange-rate","fixer","fixer-node","future-studio-university","request-exchange-rates"],"created_at":"2024-11-15T07:16:49.867Z","updated_at":"2024-11-15T07:16:50.482Z","avatar_url":"https://github.com/futurestudio.png","language":"JavaScript","readme":"# fixer-node\n\nA Node.js SDK to interact with the [fixer.io](https://fixer.io) API for currency conversion and exchange rates.\n\nFor release notes, see the [CHANGELOG](https://github.com/futurestudio/fixer-node/blob/master/CHANGELOG.md).\n\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://travis-ci.org/futurestudio/fixer-node\"\u003e\u003cimg src=\"https://travis-ci.org/futurestudio/fixer-node.svg?branch=master\" alt=\"Build Status\" data-canonical-src=\"https://travis-ci.org/futurestudio/fixer-node.svg?branch=master\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://snyk.io/test/github/futurestudio/fixer-node\"\u003e\u003cimg src=\"https://snyk.io/test/github/futurestudio/fixer-node/badge.svg\" alt=\"Known Vulnerabilities\" data-canonical-src=\"https://snyk.io/test/github/futurestudio/fixer-node\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://greenkeeper.io/\" rel=\"nofollow\" class=\"rich-diff-level-one\"\u003e\u003cimg src=\"https://badges.greenkeeper.io/futurestudio/fixer-node.svg\" alt=\"Greenkeeper badge\" data-canonical-src=\"https://badges.greenkeeper.io/futurestudio/fixer-node.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/fixer-node\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/fixer-node.svg\" alt=\"fixer-node Version\" data-canonical-src=\"https://img.shields.io/npm/v/fixer-node.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n------\n\n\u003cp align=\"center\"\u003e\u003csup\u003eThe \u003ca href=\"https://futurestud.io\"\u003eFuture Studio University\u003c/a\u003e supports development of this Node.js library 🚀\u003c/sup\u003e\n\u003cbr\u003e\u003cb\u003e\nJoin the \u003ca href=\"https://futurestud.io/university\"\u003eFuture Studio University and Skyrocket in Node.js\u003c/a\u003e\u003c/b\u003e\n\u003c/p\u003e\n\n------\n\n\n## Requirements\n\u003e **Node.js v8 (or newer)**\n\n`fixer-node` uses async/await which requires **Node.js v8 or newer**.\n\n\n## Installation\nAdd `fixer-node` as a dependency to your project:\n\n```bash\n# NPM v5 users, this way is yours\nnpm i fixer-node\n\n# you’re using NPM v4:\nnpm i -S fixer-node\n```\n\n\n## Usage\nInitialize an instance of `fixer-node` and pass your fixer.io access key as an argument:\n\n```js\nconst Fixer = require('fixer-node')\nconst fixer = new Fixer('access-key')\n```\n\n\n### Options\nThe constructor of `fixer-node` requires an access key as the first argument.\n\nThe second argument is an `options` object allowing the following properties:\n\n- `https:` (boolean) set the fixer.io API base URL to either `https` or `http`; default: `http`\n\n```js\nconst Fixer = require('fixer-node')\nconst fixer = new Fixer('access-key', {\n  https: true\n})\n```\n\n## Error Handling\n`fixer-node` throws a custom error instance: [FixerError](https://github.com/futurestudio/fixer-node/blob/master/lib/fixer-error.js).\n\nThe `FixerError` contains the fixer.io API related error properties for `info`, `code`, and `type`.\nThe error message is derived from the `info` property.\n\n```js\nconst Fixer = require('node-fixer')\nconst fixer = new Fixer('access-key')\n\ntry {\n  const data = fixer.base({ base: 'USD' })\n} catch (err) {\n  // err.info is the same as err.message,\n  // e.g. \"Your monthly API request volume has been reached. Please upgrade your plan\"\n  const info = err.info\n\n  // err.code the fixer.io API code,\n  // e.g. \"201\" which represents \"An invalid base currency has been entered.\"\n  const code = err.code\n}\n```\n\nFind more details on errors in the [fixer.io API docs](https://fixer.io/documentation#errors).\n\n\n## API\n\u003e aka “how to use this library”\n\n`fixer-node` supports all fixer.io API endpoints. Here’s an overview on how to use the methods.\n\n### Symbols\nRequest a list of currency symbols.\nThis is a mapping between the currency shortcut (EUR) and full name (Euro).\n\n```js\nconst data = await fixer.symbols()\n```\n\n\n### Latest\nRequest the latest exchange rates.\n\nThe `.latest()` method accepts two parameters:\n\n1. `symbols`: (string) a list of symbols you want the exchange rates for (this reduces the response payload)\n2. `base`: (string) the base currency\n\n```js\n// get the latest rates for all currencies\nconst latest = await fixer.latest()\n\n// get the latest rates for selected currencies\nconst latest = await fixer.latest({ symbols: 'EUR, USD, AUD' })\n\n// get the latest rates for selected currencies and base\nconst latest = await fixer.latest({ symbols: 'EUR, USD', base: 'AUD' })\n```\n\n\n### Base\nRequest exchange rates for a given base.\n\n```js\n// get all rates for a selected base\nconst base = await fixer.base({ base: 'AUD' })\n\n// get specific rates for a selected base\nconst base = await fixer.base({ base: 'AUD', symbols: 'USD, EUR' })\n```\n\n\n### Historic\nRequest historic exchange rates for a given day.\n\n```js\n// get exchange rates for May 9th, 2018\nconst date = await fixer.forDate({ date: '2018-05-09' })\n\n// with symbols\nconst date = await fixer.forDate({ date: '2018-05-09', symbols: 'USD, EUR, AUD' })\n\n// with symbols and base\nconst date = await fixer.forDate({ date: '2018-05-09', symbols: 'EUR, AUD', base: 'USD' })\n```\n\n\n### Convert\nConvert an amount from one currency to another.\n\nThe `.convert()` method is aliased as `fromTo()`.\nUse both, `.convert()` and `.fromTo()`, for the same operation.\n\n```js\n// 25 from GBP to JPY\nconst convert = await fixer.convert({ from: 'GBP', to: 'JPY', amount: 25 })\n\n// 25 from GBP to JPY on 2018-05-08\nconst convert = await fixer.fromTo({ from: 'GBP', to: 'JPY', amount: 25, date: '2018-05-08' })\n```\n\n\n### Time-Series\nHistorical exchange rates between two dates.\n\nThe `.timeseries()` method is aliased as `between()`.\nUse both, `.timeseries()` and `.between()`, for the same operation.\n\n\n```js\n// start - end\nconst timeseries = await fixer.timeseries({\n  start_date: '2018-05-05',\n  end_date: '2018-05-08'\n})\n\n// start - end with base and symbols\nconst timeseries = await fixer.between({\n  start_date: '2018-05-05',\n  end_date: '2018-05-08',\n  symbols: 'EUR, USD',\n  base: 'AUD'\n})\n```\n\n\n### Fluctuation\nRetrieve information about how currencies fluctuate on a day-to-day basis.\n\n```js\n// start - end\nconst fluctuation = await fixer.fluctuation({\n  start_date: '2018-05-05',\n  end_date: '2018-05-08'\n})\n\n// start - end with base and symbols\nconst fluctuation = await fixer.fluctuation({\n  start_date: '2018-05-05',\n  end_date: '2018-05-08',\n  symbols: 'EUR, USD',\n  base: 'AUD'\n})\n```\n\n\n## Feature Requests\nDo you miss a feature? Please don’t hesitate to\n[create an issue](https://github.com/futurestudio/fixer-node/issues) with a short description of your desired addition to this plugin.\n\n\n## Links \u0026 Resources\n\n- [fixer.io](https://fixer.io): exchange rate and currency conversion\n\n\n## Contributing\nWe highly appreciate your pull request and any kind of support!\n\n1.  Create a fork\n2.  Create your feature branch: `git checkout -b my-feature`\n3.  Commit your changes: `git commit -am 'Add some feature'`\n4.  Push to the branch: `git push origin my-new-feature`\n5.  Submit a pull request 🚀\n\n\n## License\n\nMIT © [Future Studio](https://futurestud.io)\n\n---\n\n\u003e [futurestud.io](https://futurestud.io) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e GitHub [@futurestudio](https://github.com/futurestudio/) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e Twitter [@futurestud_io](https://twitter.com/futurestud_io)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturestudio%2Ffixer-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuturestudio%2Ffixer-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturestudio%2Ffixer-node/lists"}