简体   繁体   English

如何在WebApp(Nodejs)中集成货币汇率交换Api

[英]How to integrate currency rate exchange Api in a WebApp (Nodejs)

I'm trying to build a WebApp(for sending money) with React, Nodejs for a customer.我正在尝试使用 React、Nodejs 为客户构建一个 WebApp(用于汇款)。 Since it will be selling goods worldWide I have to integrate the currency exchange feature in it.由于它将在全球范围内销售商品,因此我必须在其中集成货币兑换功能。 After doing some research I found that for some reasons enumerated here Choose backend for All the fetching logic and also the choice of the API provider according to:在做了一些研究之后,我发现由于某些原因,这里列举了为所有获取逻辑选择后端以及 API 提供程序的选择,根据:

  1. API features: features of each of the currency APIs API 特性:各币种API的特性
  2. Data coverage: the number of currencies supported, data sources, frequency of updates, and other data coverage features of the APIs数据覆盖率:支持的币种数量、数据来源、更新频率以及 API 的其他数据覆盖率特性
  3. Price价格
  4. Ease of use.使用方便。

the main question is how do I integrate it?主要问题是如何整合它? the cost of Some API depends on the number of requests, is smart to send a request for updating data every time a customer wants to do a transaction? Some API 的成本取决于请求的数量,每次客户想要进行交易时发送更新数据的请求是否明智? or do I send request from the backend that is not depending on the customer's transaction but save the data?还是我从后端发送不依赖于客户交易但保存数据的请求? if yes, what will be the good frequency?如果是,那么好的频率是多少? is there any free reliable API out there?那里有免费可靠的 API 吗?

Not code question.不是代码问题。 Would like to have the idea of how it works for getting currency rates information, what is good update frequency, is there any good free out there but reliable想知道它是如何获取货币汇率信息的,什么是好的更新频率,有没有好的免费但可靠的

can't you just use money.js你不能只用money.js吗

example:例子:

var fx = require("money");
fx.convert(12.99, {from: "GBP", to: "HKD"});

Disclaimer: I'm one of the programmers of SWOP.免责声明:我是 SWOP 的程序员之一。

You can try SWOP foreign exchange rate API , an easy to use, fast, reliable and transparent foreign exchange rate API.您可以试试SWOP外汇汇率API ,一个简单易用、快速、可靠、透明的外汇汇率API。

  • Generally it's always best to access APIs through your backend to protect your API keys通常最好通过后端访问 API 以保护您的 API 密钥
  • The SWOP API offers rates for 190+ currencies. SWOP API 提供 190 多种货币的汇率。 They are gathered directly from trusted sources like European Central Bank, International Money Fund and various National Banks.它们直接从欧洲中央银行、国际货币基金组织和各种国家银行等可信来源收集。
  • The SWOP API has GraphQL and REST/JSON endpoints for your ease of use SWOP API 具有 GraphQL 和 REST/JSON 端点,方便您使用
  • There's a free plan allowing 1,000 requests per month.有一个免费计划,每月允许 1,000 个请求。 This can be enough with some server side caching, otherwise there are plans with much more requests.这对于一些服务器端缓存就足够了,否则会有更多请求的计划。

Best regards此致

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM