The vast majority of database entries are generated by the wallet and do not contain anything that the user can enter. Things that users can enter are generally validated prior to writing to the database, e.g. descriptors imported with importdescriptors must be valid descriptors before they are written.
The sole exception are labels which, by definition, ...
The CoinGecko API is what you are looking for. Here an example request:
You can pipe it through jq:
curl https://api.coingecko.com/api/v3/coins/bitcoin/history?date=28-06-2021 | jq .market_data.current_price.usd
Which gives you 39076.59377063225. The exchange rate of bitcoin at the 28th ...
I'd recommend using the Esplora API that powers blockstream.info for testnet blockchain data.
For example you can use curl to get the latest testnet block hash: