3

How to get the latest version of firefox? This URL was found, but is there no API? I would like to get the latest version, e.g. 58.0.2 so this could be used for other purposes. Just latest is insufficient as I require the version in one of my ansible roles to lookup the checksum.


At the moment I am considering to parse https://www.mozilla.org/en-US/firefox/releases/

030
  • 13,383
  • 17
  • 76
  • 178

2 Answers2

3

You do not want to be parsing HTML in a programmatic way. Avoid it at all costs, if you can. It would be a nightmare to support on-going. There's actually a JSON output that Mozilla provides of all the versions:

https://product-details.mozilla.org/1.0/firefox_versions.json

Edit: Here is a simple bash script example that will always return the latest Firefox version. Make sure you have jq & curl installed on your system:

curl -s https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r .LATEST_FIREFOX_VERSION

This returns:

58.0.2

BoomShadow
  • 1,472
  • 1
  • 15
  • 11
3

I pulled this from the Firefox Chef cookbook (in particular this .rb file). This an example of the request they use to get the latest version based on OS and language.

https://download.mozilla.org/?product=firefox-latest#&os=win#&lang=#en-US

It adheres to the following format:

https://download.mozilla.org/?product=firefox-{VERSION_NUMBER}#&os={OS_ABBREVIATION}#&lang=#{LANGUAGE_ABBREVIATION}

I searched around for official api documentation, but couldn't find anything. If I do, I will post a link to it in this answer.

Preston Martin
  • 3,288
  • 4
  • 18
  • 39