SEC-required User-Agent string. Set via set-identity! before making requests.
SEC-required User-Agent string. Set via set-identity! before making requests.
(clear-cache!)Clear the in-memory HTTP response caches (JSON and raw), any registered derived caches (e.g. the ticker maps), and reset the eviction counter. After calling this, the next cache-put! will perform a full eviction sweep.
Clear the in-memory HTTP response caches (JSON and raw), any registered derived caches (e.g. the ticker maps), and reset the eviction counter. After calling this, the next cache-put! will perform a full eviction sweep.
(clear-disk-cache! & {:keys [dir]})Delete every entry in the on-disk cache directory (whether or not the disk cache is currently enabled). Returns the number of entries removed.
Delete every entry in the on-disk cache directory (whether or not the disk cache is currently enabled). Returns the number of entries removed.
(disable-disk-cache!)Disable the on-disk HTTP cache (files are kept; delete with clear-disk-cache! first if desired).
Disable the on-disk HTTP cache (files are kept; delete with clear-disk-cache! first if desired).
(disk-cache-stats)Return {:dir path :entries n :bytes total} for the on-disk cache, or nil when disabled.
Return {:dir path :entries n :bytes total} for the on-disk cache, or nil
when disabled.(edgar-get url & {:keys [raw? cache] :or {raw? false cache :all}})Rate-limited GET against any SEC URL. Returns parsed JSON as a Clojure map, or raw body string if :raw? true. JSON responses are cached in memory (5 min for metadata, 1 hr for XBRL facts). Raw responses are cached in a bounded cache (64 entries, 1 hr TTL) so that repeated content access on the same filing does not re-download it. When the opt-in disk cache is enabled (enable-disk-cache!), responses are also persisted across sessions and consulted between the memory caches and the network. Retries on 429/5xx with exponential backoff (up to 3 retries). Options: :raw? - return body as string instead of parsing JSON (default false) :cache - which caches this request may read and write: :all (default) in-memory and, when enabled, disk :disk skip the in-memory cache — for very large bodies such as the 30-60 MB quarterly full-index files, which would otherwise pin hundreds of MB in the entry-bounded cache :none no caching at all (always hits the network)
Rate-limited GET against any SEC URL.
Returns parsed JSON as a Clojure map, or raw body string if :raw? true.
JSON responses are cached in memory (5 min for metadata, 1 hr for XBRL facts).
Raw responses are cached in a bounded cache (64 entries, 1 hr TTL) so that
repeated content access on the same filing does not re-download it.
When the opt-in disk cache is enabled (enable-disk-cache!), responses are
also persisted across sessions and consulted between the memory caches
and the network.
Retries on 429/5xx with exponential backoff (up to 3 retries).
Options:
:raw? - return body as string instead of parsing JSON (default false)
:cache - which caches this request may read and write:
:all (default) in-memory and, when enabled, disk
:disk skip the in-memory cache — for very large bodies such
as the 30-60 MB quarterly full-index files, which would
otherwise pin hundreds of MB in the entry-bounded cache
:none no caching at all (always hits the network)(edgar-get-bytes url)Rate-limited GET returning raw bytes — for binary/archive downloads. Retries on 429/5xx with exponential backoff.
Rate-limited GET returning raw bytes — for binary/archive downloads. Retries on 429/5xx with exponential backoff.
(enable-disk-cache! &
{:keys [dir ttl-json-ms ttl-raw-ms]
:or {ttl-json-ms (* 24 60 60 1000)
ttl-raw-ms (* 30 24 60 60 1000)}})Enable the persistent on-disk HTTP cache (off by default). Options: :dir - cache directory (default ~/.edgarjure/http-cache) :ttl-json-ms - TTL for JSON endpoints (submissions, companyfacts, tickers, search) and for the full-index/daily-index files, which change while their period is open (default 24 h) :ttl-raw-ms - TTL for raw filing documents: filing HTML/XML and filing indexes (default 30 days; published filings are immutable) Returns the config map in effect.
Enable the persistent on-disk HTTP cache (off by default).
Options:
:dir - cache directory (default ~/.edgarjure/http-cache)
:ttl-json-ms - TTL for JSON endpoints (submissions, companyfacts,
tickers, search) and for the full-index/daily-index
files, which change while their period is open
(default 24 h)
:ttl-raw-ms - TTL for raw filing documents: filing HTML/XML and
filing indexes (default 30 days; published filings
are immutable)
Returns the config map in effect.(pad-cik cik)Normalise a CIK (integer, or numeric string with or without leading zeros) to the 10-digit zero-padded string used in every returned map.
Normalise a CIK (integer, or numeric string with or without leading zeros) to the 10-digit zero-padded string used in every returned map.
(register-cache-clearer! k f)Register (or replace) a named 0-arg fn that clear-cache! also runs. Lets higher-level namespaces hook their own caches into clear-cache! (e.g. edgar.company's ticker maps) without a circular dependency.
Register (or replace) a named 0-arg fn that clear-cache! also runs. Lets higher-level namespaces hook their own caches into clear-cache! (e.g. edgar.company's ticker maps) without a circular dependency.
(set-identity! name-and-email)Set the SEC Edgar identity used in all HTTP requests. Required by SEC fair-use policy. Example: (set-identity! "Your Name your@email.com")
Set the SEC Edgar identity used in all HTTP requests. Required by SEC fair-use policy. Example: (set-identity! "Your Name your@email.com")
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 |