Table of Contents
Behind the scenes
How does it work?
Get eol data of a given product
- A request to
https://endoflife.date/api/v1/products/PRODUCT
is made - The response is saved to
/tmp/eol_<PRODUCT>.json
The local product specific JSON file is used as cache file and expires after 1 day. When checking the same product again the json data is taken from the cache file. This reduces the traffic to the endoflife.date server.
See details of the response in the documentation of the api: 🌐 https://endoflife.date/docs/api/v1/#/Products/product
Find latest version
The block with information of the latest version we get from cat "$API_OUT" | jq ".result .releases.[0]"
. Inside this block…
- The current major version number is in the key
.name
. - The latest minor version is in
.latest .name
$ cat "$API_OUT" | jq ".result .releases.[0]"
{
"name": "8.4",
"codename": null,
"label": "8.4",
"releaseDate": "2024-11-21",
"isLts": false,
"ltsFrom": null,
"isEoas": false,
"eoasFrom": "2026-12-31",
"isEol": false,
"eolFrom": "2028-12-31",
"isMaintained": true,
"latest": {
"name": "8.4.8",
"date": "2025-06-05",
"link": "https://www.php.net/ChangeLog-8.php#8.4.8"
},
"custom": null
}
Find local version
In result -> versionCommand is a command to get the version of a locally installed product.
$ cat "$API_OUT" | jq ".result .versionCommand"
"php --version"
The given command will be executed. Its output won’t be cached.
Remark: If the command containes line breaks (see response for “python”) - then the 1st line will be executed.
Compare versions
The current version is compared with latest major and latest min or version.
Check support
We compare 2 things:
- Is the current version still supported? see
.isMaintained
in the latest release - Is the product still maintained?
$ cat "$API_OUT" | jq ".result .labels .discontinued"