{"id":22196665,"url":"https://github.com/druids/clj-currencylayer","last_synced_at":"2025-09-14T19:29:06.523Z","repository":{"id":57713416,"uuid":"125816661","full_name":"druids/clj-currencylayer","owner":"druids","description":"A client for currencylayer.com API based on clj-http.client","archived":false,"fork":false,"pushed_at":"2018-06-26T15:39:03.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-03T03:39:42.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/druids.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}},"created_at":"2018-03-19T07:15:49.000Z","updated_at":"2018-06-26T15:39:04.000Z","dependencies_parsed_at":"2022-09-26T16:40:15.617Z","dependency_job_id":null,"html_url":"https://github.com/druids/clj-currencylayer","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/druids/clj-currencylayer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fclj-currencylayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fclj-currencylayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fclj-currencylayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fclj-currencylayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/druids","download_url":"https://codeload.github.com/druids/clj-currencylayer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druids%2Fclj-currencylayer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275155199,"owners_count":25415003,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-02T14:16:01.522Z","updated_at":"2025-09-14T19:29:06.464Z","avatar_url":"https://github.com/druids.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"clj-currencylayer\n=================\n\nA client for [currencylayer.com API](currencylayer.com) based on [clj-http.client](https://clojars.org/clj-http).\n\n[![CircleCI](https://circleci.com/gh/druids/clj-currencylayer.svg?style=svg)](https://circleci.com/gh/druids/clj-currencylayer)\n[![Dependencies Status](https://jarkeeper.com/druids/clj-currencylayer/status.png)](https://jarkeeper.com/druids/clj-currencylayer)\n[![License](https://img.shields.io/badge/MIT-Clause-blue.svg)](https://opensource.org/licenses/MIT)\n\n\nLeiningen/Boot\n--------------\n\n```clojure\n[clj-currencylayer \"0.2.0\"]\n```\n\n\nDocumentation\n-------------\n\nAll functions are designed to return errors instead of throwing exceptions (except `:pre` in a function).\n\nAll API calls return a tuple within following structure: `[:keyword body response]` where`:keyword` can be:\n- :ok when a response is a success and parsed\n- :error-XXX when a response is parsed but it's an error response (where XXX is an error code from\n  [error codes](https://currencylayer.com/documentation#error\\_codes))\n- :error-unmarshalling when a response is not a valid JSON\n\nA `body` is a parsed body and `response` is an original response.\n\nTo be able to run examples this line is needed:\n\n```clojure\n(require '[clj-currencylayer.core :as currencylayer])\n```\n\n### get-live\n\nReturns the most recent exchange rate data. Pass all parameters via `params` hash-map.\n\n```clojure\n(currencylayer/get-live {:access_key \"asdf\", :source \"USD\", :currencies [\"EUR\" \"CZK\"]})\n;; [:ok\n;;  {:success true, :timestamp 1521448156, :source \"USD\", :quotes {:USDCZK 20.7104, :USDEUR 0.814495}, ...\n;;  {:request-time 386, ...\n```\n\n`:currencies` are joined automatically, thus you can pass them as a sequence\n\n```clojure\n(currencylayer/get-live {:access_key \"asdf\"} [\"EUR\" \"CZK\"])\n```\n\nBecause of a tuple you can do kind of \"pattern matching\":\n\n```clojure\n(let [[status body _] (:currencylayer/get-live {:access_key \"asdf\", :source \"EUR\", :currencies [\"CZK\"]})]\n  (case status\n    :ok (process-currencies body)\n    :error-101 (missing-auth-key body)\n    (default-error body)))\n```\n\nWhen you need to mock a response, you can pass a host to a caller\n\n```clojure\n(currencylayer/get-live {:access_key \"asdf\"} \"my-mock-domain.localhost\")\n```\n\nOr for development you can use HTTP host\n\n```clojure\n(currencylayer/get-live {:access_key \"asdf\"} currencylayer/currencylayer-host-http)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruids%2Fclj-currencylayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdruids%2Fclj-currencylayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruids%2Fclj-currencylayer/lists"}