getquote

Getquote implementation for ledger(1)
Log | Files | Refs | README

getquote.1 (2163B)


      1 ./"
      2 ./" Copyright (c) 2026 Jacob R. Edwards <jacob@jacobedwards.org>
      3 ./"
      4 ./" Permission to use, copy, modify, and distribute this software for any
      5 ./" purpose with or without fee is hereby granted, provided that the above
      6 ./" copyright notice and this permission notice appear in all copies.
      7 ./"
      8 ./" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIE
      9 ./" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     10 ./" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     11 ./" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     12 ./" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     13 ./" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     14 ./" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     15 ./"
     16 .Dd January 22, 2026
     17 .Dt GETQUOTE 1
     18 .Os
     19 .Sh NAME
     20 .Nm getquote
     21 .Nd Fetch commodity prices for ledger(1)
     22 .Sh SYNOPSIS
     23 .Nm
     24 .Ar symbol
     25 .Op Ar exchange_to
     26 .Sh DESCRIPTION
     27 .Nm
     28 is a getquote implementation for
     29 .Xr ledger 1
     30 using the TwelveData API.
     31 .Pp
     32 By default,
     33 .Nm
     34 first treats
     35 .Ar symbol
     36 as a currency and attempts to fetch the exchange rate of it and
     37 .Ar exchange_to
     38 (or USD if not given). If that fails, it will then treat
     39 .Ar symbol
     40 as a ticker and retrieve a quote.
     41 .Pp
     42 The default behavior can be altered using the configuration file described in
     43 .Xr getquote 5 .
     44 .Sh ENVIRONMENT
     45 .Bl -tag -width Ds
     46 .It Ev TWELVE_DATA_API_KEY
     47 API key for Twelve Data.
     48 .It Ev XDG_CONFIG_HOME
     49 Location of the
     50 .Pa getquote
     51 configuration directory. (Defaults to
     52 .Pa ~/.local/config )
     53 .Sh FILES
     54 .Bl -tag -width Ds
     55 .It Pa $XDG_DATA_HOME/getquote/keys/api.twelvedata.com
     56 API key to use if
     57 .Ev TWELVE_DATA_API_KEY
     58 isn't set.
     59 .El
     60 .Bl -tag -width Ds
     61 .It Pa $XDG_DATA_HOME/getquote/symbols
     62 Symbols file to be processed by
     63 .Xr getquoteaction .
     64 .El
     65 .Sh EXIT STATUS
     66 .Ex -std
     67 .Sh EXAMPLES
     68 .Pp
     69 Get the price of Vanguard's Total Stock Market ETF (VTI) in a format
     70 suitable for ledger:
     71 .Pp
     72 .Dl $ getquote VTI
     73 .Pp
     74 Get the XMR/EUR exchange rate:
     75 .Pp
     76 .Dl $ getquote XMR EUR
     77 .Sh SEE ALSO
     78 .Xr ledger 1 ,
     79 .Xr getquoteaction 1
     80 .Sh AUTHORS
     81 .An Jacob R. Edwards Aq Mt jacob@jacobedwards.org