Units_cur Jan 2026 packetizer problem and fix

gnu units is a command line unit conversion and calculation program.

There is a python script units_cur for updating the currency and cpi data for that.

Those are available for termux.

iirc units_cur ceased working about after Jan. 20 2026:

[code]$ units_cur
Error connecting to currency server:
404 Error: Not Found for url: https://services.packetizer.com/spotprices?f=json.[/code]

Recently, I found, that packetizer still works, but the url is slightly different, to the one in the error message above.

So I made a quick fix, that I will post about below.

(Unfortunately, I am having trouble, properly editing my posts here - especially using the device I’m forced to use at the time :frowning: .)

$ cat units_curr_packetizer_fix.patch
--- /data/data/com.termux/files/usr/bin/units_cur_orig  2026-01-18 04:37:00.000000000 +0000
+++ /data/data/com.termux/files/usr/bin/units_cur       2026-02-23 13:14:19.028000173 +0000
@@ -556,8 +556,8 @@
 # Get precious metals data and bitcoin
 #

-metals = getjson('https://services.packetizer.com/spotprices',{'f':'json'})
-bitcoin = getjson('https://services.packetizer.com/btc',{'f':'json'})
+metals = getjson('https://services.packetizer.com/spotprices/',{'f':'json'})
+bitcoin = getjson('https://services.packetizer.com/btc/',{'f':'json'})

 metallist = ['']*len(validmetals)
 for metal, price in metals.items():

The above patch should fix the problem.

I hope it posted correctly.

I’m out of time at the moment.