Get latest release version number for chrome browser
Asked Answered
E

6

13

I am trying to figure out a rather stable way to programmatically determine the latest release version number of the chrome browser.

It doesn't have to be failproof as it's only a nice-to-have-feature I can blend out whenever the result looks "suspicious".

  • There seems to be no API (is there?).
  • I dont want to rely on third parties handling that stuff manually.
  • I dont want to parse any website output.

So I ended up fetching git files.

My first approach was to fetch this file:

https://chromium.googlesource.com/chromium/src.git/+/master/chrome/VERSION?format=TEXT

Which gives the latest version number.
From there on the solution is just a preg_match_all away ... Unfortunately its not the latest release version but the latest dev version.

There seems to be no "release" branch nor a "release" tag or something else I can think of neither.

You might answer "why?"... I know about feature detection, I know browser sniffing can be fooled and I am aware of the fact that (every) browser will notify their users when it's time to update. Still makes sense in my case. On the other hand its solely for display purposes. Nothing is going to depend on it later on – promise :-)

Any – even the faintest – ideas are highly appreciated!

Excitable answered 31/1, 2016 at 13:57 Comment(7)
It really doesn't make sense what you want to do. Chrome keeps itself automatically updated.Straw
Thanks, for your Answer. That is why I wrote the paragraph 'You might answer "why?"'. Trust me it does make sense in this case. It doesn't make sense on its own – I agree. But I am printing out the latest release numbers for a couple of browsers (which too makes sense in my case). For the sake of consistency I want to print out the latest version for chrome too. But thank you anyway for trying to save me some time – really appreciate that Charlotte!Excitable
Well, then you need to parse HTML, I don't see any other way.Straw
Thanks. I already did something like pushing a HEAD Request and parsing the Location Header of the response for a redirected Download-Link for Firefox and using a regex to filter out the version number inside that link. Works quite well and could work out quite stable. I was hoping someone comes around with an equally adventurous solution for chrome. I am hoping solutions like that stay stable longer. A Website is changed quite frequently. A build process stays that way for a longer time. I keep waiting and hoping.Excitable
I couldn't imagine websites like these do that manually all the time...Excitable
If you're on debian based linux, you could install and update your chrome once a day, and somehow parse the installation log and save it.Freetown
@Freetown that sounds like one of these solutions I was hoping to find here! Big thanks! This will be my last resort, as I would like to be able to keep it kinda portable.Excitable
O
15

The Chrome team uses the OmahaProxy dashboard to keep track of current versions in stable/beta/dev/canary. If you can scrape that you can get whatever version number you're looking for.

Osuna answered 2/2, 2016 at 3:23 Comment(3)
Thanks a lot! Even easier than previous solutions, but I am a little suspicious that the "view" (meaning the html structure) of said document might change more often than the data/structure from @Freetown answer. + way easier - more 'fragile'Excitable
At the bottom of that page (you may have to scroll down), there's links to get the data as raw CSV or JSONOsuna
OmahaProxy has been deprecated and is no longer usable for this purpose (September 2023).Tasman
I
9

I've found the following endpoints from OmahaProxy that give the latest stable versions of the respective OS.

Identic answered 2/8, 2021 at 18:41 Comment(1)
OmahaProxy has been deprecated and is no longer usable for this purpose (September 2023).Tasman
W
7

The ChromiumDash also makes the data available via an API. You can use that to fetch the latest tag for a platform and a channel.

Eg: https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Windows&num=1

Returns

[
  {
    "channel": "Stable", 
    "chromium_main_branch_position": 950365, 
    "hashes": {
      "angle": "343b7bb57268e1cb47da26fcb0ed40fe47e8ff5d", 
      "chromium": "cab11adacc41ee856c79e669c2fd38d8864e52c4", 
      "dawn": "1b1b658d365591b6a8d4bfb0c3524832c89afc99", 
      "devtools": "b6f648d8921ea8be8f2b32c2061fec7503b56610", 
      "pdfium": "27cabf3dae38d0634a53316da0ad069bf0413495", 
      "skia": "a6986cd7224f104044fd5bc29cb5f80796d76f5a", 
      "v8": "db77a493a5595b835655b243202ac0c2fb1898a6", 
      "webrtc": "a6b138d6b4ef3a5b2c87f899b67f3b5c8dd3c002"
    }, 
    "milestone": 98, 
    "platform": "Windows", 
    "previous_version": "98.0.4758.81", 
    "time": 1643754840000, 
    "version": "98.0.4758.82"
  }
]
Watanabe answered 2/2, 2022 at 9:56 Comment(2)
Good find. Two things worth noting however: there's an "Extended" channel which you may want vs the "Stable" channel. And Google seems to do 50/50 releases and item 0 may be actually older than item 1 in the JSON (e.g. right now where "120.0.6099.72" is #0 and "120.0.6099.109" is #1). See chromiumdash.appspot.com/releases?platform=WindowsKampmann
Its still not perfect, I just updated chrome to 124.0.6367.92 and in both channels the latest is 124.0.6367.91Pensive
N
5

Feel free to use my online service vergrabber to get latest versions of different kind of software in json format. It's available at http://vergrabber.kingu.pl/vergrabber.json

Nonbelligerent answered 24/3, 2017 at 15:0 Comment(6)
Cool Thanks @twk! How did you technically manage the chrome part? Should you need the other browsers too: feel free to try my first attempt for an api for browser versions: browserapi.nachvorne.de By far not perfect and actually even fetches some browser versions (some only fallback) by crawling wikipedia until I come across a better idea but might work partly. Gotta work on sanitizing the fetched Version numbers too as you can determine by looking at the output data.Excitable
I write a module for every app to scrap version info directly from their official website. This is the most accurate I think, because wikipedia is updated manualy as far as I know.Nonbelligerent
For Chrome, I use json from the page mentioned above by @DavidBokan.Nonbelligerent
I do a mixture of both. The official website is updated the fastest, but website's markup change quite often so this fails from time to time. On the other hand wikipedia is a bit outdated (usually a few hours) but more stable. I'd prefer git or dashboards or the like as a source. Rather fail proof and even faster than the official websites.Excitable
Website's markup doesn't change that often. I need to update my scrapping scripts from time to time, maybe once a month for a 20 apps.Nonbelligerent
This API has not been updated since 2021Tasman
F
1

If you're on debian based linux, you could install and update your chrome once a day, and somehow parse the version number, but this is not realtime.

For example:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb

Which will give a log like this:

(Reading database ... 113338 files and directories currently installed.)
Preparing to unpack google-chrome-stable_current_amd64.deb ...
Unpacking google-chrome-stable (48.0.2564.97-1) over (47.0.2526.111-1) ...
Setting up google-chrome-stable (48.0.2564.97-1) ...
Processing triggers for menu (2.1.47) ...

Then just parse it.

Freetown answered 31/1, 2016 at 14:50 Comment(6)
That's a badass answer! Genious. Still hoping for something portable which doesn't include the need to have install-privileges.Excitable
You could set a cron job once a day and let it update a database, write to a text file or something. I don't think there's any other way that doing this without installing or checking manually.Freetown
Absolutely doesn't have to be realtime. I am playing around with downloading that file and reading contents (tar xzpvf). We'll see where I get from there.Excitable
un-tar that file results in a control.tar.gz being created. Inside that one we have a file named 'control'. Row 2 in that said file says "Version: 48.0.2564.97-1". No need to install the package. Case closed! Thanks so much! Saved my day.Excitable
that's even better, no need to install :)Freetown
Keep in mind that the latest version for Windows maybe be a bit differentPensive
D
0

https://cdn.jsdelivr.net/gh/berstend/chrome-versions/data/stable/all/version/latest.json

$response = Invoke-RestMethod -Uri "https://cdn.jsdelivr.net/gh/berstend/chrome-versions/data/stable/all/version/latest.json" -UseBasicParsing
$ver = $response.windows.version
$ver

#-------------------------------------------------------------

https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Windows&num=1

$response = Invoke-RestMethod -Uri "https://chromiumdash.appspot.com/fetch_releases?channel=Stable&platform=Windows&num=1" -UseBasicParsing
$ver = $response.version
$ver
Discountenance answered 14/6 at 8:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.