{"id":13681683,"url":"https://github.com/gvolpe/exchange-rates","last_synced_at":"2025-03-20T23:30:55.855Z","repository":{"id":147504666,"uuid":"191059538","full_name":"gvolpe/exchange-rates","owner":"gvolpe","description":":currency_exchange: Querying a rate-limited currency exchange API using Redis as a cache","archived":false,"fork":false,"pushed_at":"2020-03-07T02:49:06.000Z","size":191,"stargazers_count":41,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T18:13:03.976Z","etag":null,"topics":["cache","dhall","dhall-lang","exchange-rates","forex","haskell","rate-limiter","redis","transient","wreq"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gvolpe.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}},"created_at":"2019-06-09T22:00:30.000Z","updated_at":"2024-02-27T00:07:38.000Z","dependencies_parsed_at":"2024-01-14T15:24:16.522Z","dependency_job_id":"f43d321d-295c-4dc7-84cd-908774031838","html_url":"https://github.com/gvolpe/exchange-rates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvolpe%2Fexchange-rates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvolpe%2Fexchange-rates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvolpe%2Fexchange-rates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gvolpe%2Fexchange-rates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gvolpe","download_url":"https://codeload.github.com/gvolpe/exchange-rates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244710525,"owners_count":20497254,"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":["cache","dhall","dhall-lang","exchange-rates","forex","haskell","rate-limiter","redis","transient","wreq"],"created_at":"2024-08-02T13:01:34.338Z","updated_at":"2025-03-20T23:30:55.586Z","avatar_url":"https://github.com/gvolpe.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# ![icon](icon.png) exchange-rates\n\n[![CircleCI](https://circleci.com/gh/gvolpe/exchange-rates.svg?style=svg)](https://circleci.com/gh/gvolpe/exchange-rates)\n\nQuerying a [rate-limited foreign currency exchange API](https://free.currencyconverterapi.com/) using [Redis](https://redis.io/) as a cache.\n\n- Number of Requests per Hour: 100 (See config file)\n\n### Http Endpoints\n\n#### GET /v1/currencies\n\nReturns a list of the available currencies. Eg:\n\n```json\n[\"USD\",\"EUR\",\"GBP\",\"AUD\",\"CAD\",\"PLN\",\"ARS\"]\n```\n\n#### GET /v1/rates?from=EUR\u0026to=USD\n\nReturns the current exchange rate, if available:\n\n```json\n{\"to\":\"USD\",\"from\":\"EUR\",\"rate\":1.139556}\n```\n\n### Run it locally\n\nYou'll need a Redis instance. The easiest way to get started is by using `docker`:\n\n```\ndocker run -it --rm -p 6379:6379 redis:5.0.0\n```\n\nAnd then run the web server app using `cabal new-run exchange-rates`, or using Nix `nix-shell --pure shell.nix` and `cabal new-run exchange-rates`. You should see something like:\n\n```\nAppConfig {forex = ForexConfig {host = \"https://free.currconv.com/api/v7\", apiKey = [SECRET], keyExpiration = 1800}, redis = RedisConfig {redisHost = \"127.0.0.1\", redisPort = 6379}}\nStarted server on localhost:8080\nCalling web service for: USD -\u003e GBP\nCalling web service for: USD -\u003e EUR\nCache hit: USD -\u003e GBP\nCalling web service for: USD -\u003e PLN\nCache hit: USD -\u003e PLN\n```\n\nExchange rates are cached to avoid hitting the (limited) external service many times.\n\n### Browse the documentation\n\nThe docs are generated at compile time from the API definition. The API serves a `swagger.json` response that you can visualize in the Swagger UI:\n\n```\ndocker run -p 80:8080 swaggerapi/swagger-ui\n```\n\nGo to `localhost` and enter `http://localhost:8080/swagger.json`.\n\n![docs](docs.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgvolpe%2Fexchange-rates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgvolpe%2Fexchange-rates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgvolpe%2Fexchange-rates/lists"}