download fit file from web link?

Good afternoon,

I am a physics professor and am working with a student on her honor's project.  She wants to collect Garmin data from participants in a local 5K so that she can analyze differences in performance. 

Other users can share data from events on their news feed via weblink, and these weblinks provide the detailed data.  However, that data is not easily accessible for our purposes. We really need the FIT files to get the spreadsheet that contains all of the data.  As of now, I think the only way to get those FIT files is to have the user open their Garmin account, download the FIT file for an event, and email that file to us. Since we are gathering data at the site of the 5K, I fear that users will not be able to go through this many steps even if they are willing to share their data with us. 

Is there a way to download the FIT files from these shared web links?  

Garmin, can we get a link to the original FIT file on the pages connected via these weblinks?

Thanks

Chad 

  • Is there a way to download the FIT files from these shared web links?

    No, but you can use the JSON data accessible through browser's DevTools. It contains most of the data, and additionally it is in human readable format, and can be easily converted to a number of other formats. If you have any coder on your team, with some basic knowledge of JavaScript, it will be an easy task. I'd tell easier than parsing the FIT files.

    Garmin, can we get a link to the original FIT file on the pages connected via these weblinks?

    Garmin does not answer any posts here. This forum is set up for suggesting ideas to 3rd party Connect IQ developers. You can contact Garmin's Support directly through their website at https://support.garmin.com, but frankly told I highly doubt they would ever allow the direct download of FIT files by anyone else than the owner.

  • Thanks trux!  I'll check with some of the programmers at our University. Do you know if I can also gather the GPX data (with positional info) from the JSON?

    Thanksl
    Chad

  • Hey Trux,  thanks so much for your reply!  I'm checking with some of our math faculty, to see if they can help.  I'm a decent (not great) programmer, but I've never done anything like this...can you direct me to some resources? 
    Thanks,
    Chad

  • BTW, this is an example of a link that I'd like the data for:

    https://connect.garmin.com/modern/activity/16769408439?share_unique_id=11

    The graphs show pace, heart rate, etc....I'd like to have that data in a CSV format.

  • Do you know if I can also gather the GPX data (with positional info) from the JSON?

    All coordinates are in the JSON data in a human readable form (see below). However, if for some reason you need the data in GPX format, you can simply save the shared activity as Course, and then export the course as GPX:

         

    As for the JSON data, in fact you do not need to be a coder at all. It is rather a trivial task to process the data in the way you need. JSON format is very easy to work with, and there are also countless tools (including JSON to CSV convertors) and tutorials available online for such task, so you do not need to be any experienced coder. Some very rudimentary knowledge of data structures and computing logics, common sense, is all you need. Any high school graduate should be able doing it, so I guess an university student in physics won't have any problems with it.

    Simply open DevTools when on the activity page, reload the page, go to the Network tab, enter "details" into the search box, and you get the JSON data file on the Preview tab. Use the Response tab for copying and pasting the raw data to any external editors or tools.

    All data (including the GPS coordinates) is in under the node "activityDetailMetrics" and the description of individual fields is under the node "metricsDescriptors". Please note that the order of the descriptors is random, and usually differs at each reloading of the page!

    As for the JSON to CSV conversion, there are countless of tools available, and also  many spreadsheet and database programs can read JSON data directly. I use for example the tool at https://www.convertcsv.com/json-to-csv.htm, but as I told there are countless other possibilities and some of them may be more suitable for your purpose.

  • Trux,

    That is very helpful. I'm able to get the data into a usable format.  My student and I are so grateful for your input.

    Chad

  • I know it might be too late but for future reference:

    The "Garmin" way to do it would be something like:

    1. Create an app using the developer SDK. However Garmin might only approve businesses, you need to check it with them (though the university might be ok, worth to ask Garmin)

    2. Print a huge QR code, ask participants to scan it BEFORE the race. They'll need to approve connecting their Connect account to your app (similar to how you connect to Strava)

    3. Their run will automatically sync to your app as they save it at the end of the race.

  • Thanks!  I have actually moved to scraping the data from Strava.  This gets decent data (HR, pace, cadence, coords) without all the fuss of downloading the fit file from individuals.  The results have been very interesting!  We've downloaded and analyzed data from a sample of marathoners from novice to advanced.

  • But even that you should be able to do only after the activity was shared with you (privacy settings, etc)

  • But even that you should be able to do only after the activity was shared with you (privacy settings, etc)

    Not if they implemented an app that uses the Strava API. Strava users can grant 3rd party apps access to their activity data, including private activities (no need to set the visibility of activities to public). 

    https://support.strava.com/hc/en-us/articles/360018969732-App-Authorization-Settings

    Ofc this must also be possible with the Garmin API, otherwise it would be impossible for apps/sites like Strava, runalyze and smashrun to grab both public and private activity data from Garmin.

    It does seem that Strava has a lot more tiny apps from small indie devs compared to Garmin Connect. (I’m talking about apps that read/write activity data after the fact of course, and not Connect IQ apps that run on the watch.)  Idk if this has whether this is because of Strava’s relative popularity, the cost / ease of use / functionality of each of the APIs, or the demand for end users.

    For example, there’s several little apps that will rewrite your Strava activity title/description with info such as the weather information or the details of your running interval workout. Afaik, there’s nothing like that for Connect. Is it because: it’s not possible with Connect, the cost of using Garmin’s API doesn’t make it worth it, or there’s no demand from end users (possibly because most runners use Strava to share their activities and not Connect).