OpenNumismat / open-numismat

OpenNumismat, is intended primarily for registering a collection of coins. But it is also suitable for other types of collectibles - stamps, postcards, badges and more exotic things.
http://opennumismat.github.io/
GNU General Public License v3.0
95 stars 28 forks source link

[Feature Request] Information about the price of total gold/silver holdings according to daily quotes. #63

Open NEKolev opened 2 years ago

NEKolev commented 2 years ago

I think it would be useful for people describing investment coins to add information about the price of total gold/silver holdings according to daily quotes. The price should be in the currency of the program language set or a separate parameter.

NEKolev commented 1 month ago

@JanisV As far as I've searched, there's no free API that doesn't have request limits (around 100 per month), but I think I've found a workaround that will solve two problems:

The London Bullion Market Association (LBMA) site has 1968 prices by day in dollars, pounds and euros. As far as I read the reference price is in dollars for 1 troy ounce (31.1035 grams) so it is best to be a reference. The price is there at the opening and closing of the exchange. I could not find specific information on which of the two prices is charged. Some sources say AM, but PM is also mentioned. I could not find specific information on which of the two prices is charged. Some sources say AM, but PM is also mentioned. I don't know if it should be a parameter which of the two prices to take. Maybe the average price between AM and PM. In a public order of the Bulgarian National Bank, they want the price from AM. So I lean more towards her, maybe.

https://www.lbma.org.uk/prices-and-data/precious-metal-prices#/table

https://cdn.lbma.org.uk/downloads/Publications/LBMA-The-Guide-2017-v1.pdf

The website of the European Central Bank has quotes between different currencies by day since 1999. https://www.ecb.europa.eu/stats/policy_and_exchange_rates/euro_reference_exchange_rates/html/index.bg.html#:~:text=Time%20series,XML%20(SDMX%2DML)

So if you scrape LBMA and make a table with the data and a separate table with the data from the European Central Bank, it will be easy to load the prices for the metals by day, and we will also have the data for the exchange rates between the different currencies. And so you will solve a ticket https://github.com/OpenNumismat/open-numismat/issues/69

Once the data from both sites has been initialised up to a certain date, for the following dates it can be done at a certain period to be supplemented.

NEKolev commented 1 month ago

So, I found the prices from LBMA on this site https://db.nomics.world/LBMA. So that eliminates the hassle of getting the data from the LBMA site, which I think makes things a lot easier. Unfortunately, I can't find the exchange rate data on this site at the moment. If I find them, I'll add a link.

Also probably best to make it compare in euros rather than dollars. This way, the data before 1999 will not be available, but it will save one conversion from dollar to euro and then from euro conversion to another currency.

NEKolev commented 1 month ago

I measured the exchange rate data on the same DBnomics site. There's even an API.

https://db.nomics.world/ECB/EXR?dimensions=%7B%22EXR_SUFFIX%22%3A%5B%22A%22%5D%7D&q=Exchange+rates&tab=list

https://docs.db.nomics.world/ https://api.db.nomics.world/v22/apidocs