I've put together a sample .Net program in C# and VB.Net.

It enables you to output JSON format data as CSV file data, for use in programs like Excel, such as this 4 day chart:

Here's what it does:

The program takes JSON replies from a file called JSON_Data.txt that will be in your EXE folder (/bin/debug or /bin/release), filtering out empty lines. D eserialises them into a class structure. Skims off the Heart-Rate data, and concatonates all the JSON lines into a single List<DataPoint> Orders the List<DataPont> by sample date. Creates a .CSV file, containing the List<DataPoint> data.

The file can be loaded into any program that supports CSV files.

I hope you find the sample code useful!

IMPORTANT!

This program uses .Net 4.0, and NOT 4,0 Client profile, because you need to add in the references "system.web.extensions.dll", which is not available in the Client-profile platform.

To run the code - create a new .Net "Console Application", and copy and paste the code into the main .CS, or .VB file that is reated. Hit F5 to compile and run it. (make sure you've got some JSON data in that text file!)

VB.Net 4.0

Imports System.Web.Script.Serialization ' Sytem.web.extensions.dll Imports System.IO Imports System.Text Module Module1 public serializer As New JavaScriptSerializer() Sub Main() Dim fileData() As String = File.ReadAllText("JSON_Data.txt").Split(vbLf) Dim datapoints As New List(Of DataPoint) For Each jsonData As String In fileData If jsonData.Trim() <> "" Then datapoints.AddRange(getDeserialisedChargeHRData(jsonData)) Next Dim sortedDataPoints As List(Of DataPoint) = datapoints.OrderBy(Function(o) o.dateTime).ToList() Dim sb As New StringBuilder() sb.AppendLine("Date and time,BPM,Confidence,Calories burned,Default zone,Custom zone") For Each dp As DataPoint In datapoints sb.AppendLine(String.Format("{0},{1},{2},{3},""{4}"",""{5}""", dp.dateTime, dp.bpm, dp.confidence, dp.caloriesBurned, dp.defaultZone, dp.customZone)) Next File.WriteAllText("BMP_Data.csv", sb.ToString()) End Sub Public Function getDeserialisedChargeHRData(ByVal json As String) As List(Of DataPoint) Dim deserializedResult = serializer.Deserialize(Of List(Of RootObject))(json) Return deserializedResult.Item(0).dataSets.activity.dataPoints End Function End Module Public Class DataPoint Public Property bpm() As Integer Public Property confidence() As Integer Public Property caloriesBurned() As Double Public Property defaultZone() As String Public Property customZone() As String Public Property dateTime() As Date End Class Public Class Activity Public Property dataPoints() As List(Of DataPoint) Public Property granularity() As String End Class Public Class DataSets Public Property activity() As Activity End Class Public Class RootObject Public Property dataSets() As DataSets End Class

C# .Net 4.0