Optional client for the public Price Index API.
The endpoint is GET /v1/market/rates, the read-only API documented in
spec/SPEC.md. No API key. Nothing is requested when this namespace loads.
When the request fails, price-index returns the bundled snapshot from
coworkingview.core/snapshot. A currency filter is never converted
locally: rows in another currency are left out rather than rewritten.
Optional client for the public Price Index API. The endpoint is `GET /v1/market/rates`, the read-only API documented in spec/SPEC.md. No API key. Nothing is requested when this namespace loads. When the request fails, [[price-index]] returns the bundled snapshot from [[coworkingview.core/snapshot]]. A currency filter is never converted locally: rows in another currency are left out rather than rewritten.
(attribution)(attribution opts)CC BY 4.0 credit from price-index.
The live response's own attribution when the request succeeds, otherwise the credit stored with the snapshot.
CC BY 4.0 credit from [[price-index]]. The live response's own attribution when the request succeeds, otherwise the credit stored with the snapshot.
(cities)(cities opts)Cities from price-index, live when the request succeeds, otherwise the snapshot.
opts are the options of price-index.
Cities from [[price-index]], live when the request succeeds, otherwise the snapshot. `opts` are the options of [[price-index]].
Public API origin used when COWORKINGVIEW_API_URL is unset.
Public API origin used when `COWORKINGVIEW_API_URL` is unset.
(price-index)(price-index
{:keys [http sleep offline] :as opts :or {http http-get sleep default-sleep}})Load the Price Index from GET /v1/market/rates.
Options, all optional:
:base-url overrides the origin. The default is COWORKINGVIEW_API_URL
or https://api.coworkingview.com.:locale is en (default), es or de.:city, :country and :currency are the documented query filters.
:currency is EUR, GBP, USD, CHF, AED or VES.:offline skips the request and returns the bundled snapshot.:http and :sleep replace the request and the retry wait. Tests use them.A live result has :origin :api. Rates and cities are parsed from that
body. :license is the response's licence code and :license_url is its
licenseUrl. A failed request, a non-JSON body, or a non-2xx status after
one retry returns the bundled snapshot with :origin :snapshot and
:error. HTTP 429 and 5xx are retried once. The wait is Retry-After,
otherwise RateLimit-Reset, otherwise 2 seconds, and never more than 10.
Other statuses are not retried.
The snapshot fallback does not convert currency. When :currency is set,
only rows already in that currency are returned. :attribution is still
the CC BY 4.0 credit.
Load the Price Index from `GET /v1/market/rates`. Options, all optional: - `:base-url` overrides the origin. The default is `COWORKINGVIEW_API_URL` or `https://api.coworkingview.com`. - `:locale` is `en` (default), `es` or `de`. - `:city`, `:country` and `:currency` are the documented query filters. `:currency` is `EUR`, `GBP`, `USD`, `CHF`, `AED` or `VES`. - `:offline` skips the request and returns the bundled snapshot. - `:http` and `:sleep` replace the request and the retry wait. Tests use them. A live result has `:origin :api`. Rates and cities are parsed from that body. `:license` is the response's licence code and `:license_url` is its `licenseUrl`. A failed request, a non-JSON body, or a non-2xx status after one retry returns the bundled snapshot with `:origin :snapshot` and `:error`. HTTP 429 and 5xx are retried once. The wait is `Retry-After`, otherwise `RateLimit-Reset`, otherwise 2 seconds, and never more than 10. Other statuses are not retried. The snapshot fallback does not convert currency. When `:currency` is set, only rows already in that currency are returned. `:attribution` is still the CC BY 4.0 credit.
(rate city product)(rate city product opts)The Price Index row for city and product.
Uses price-index, so a failed request falls back to the bundled
snapshot. opts are the same options as price-index. Returns nil
when that index has no such row. A :currency the snapshot is not stored
in yields nil on fallback, rather than a converted amount.
The Price Index row for `city` and `product`. Uses [[price-index]], so a failed request falls back to the bundled snapshot. `opts` are the same options as [[price-index]]. Returns `nil` when that index has no such row. A `:currency` the snapshot is not stored in yields `nil` on fallback, rather than a converted amount.
(resolve-base-url)(resolve-base-url explicit)API origin. An explicit URL wins, then COWORKINGVIEW_API_URL, then the public API.
A trailing slash is removed. Blank values are ignored.
API origin. An explicit URL wins, then `COWORKINGVIEW_API_URL`, then the public API. A trailing slash is removed. Blank values are ignored.
User-Agent sent to the public API.
User-Agent sent to the public API.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |