Skip to content

Generic connector for Garmin Rest API written in Java. It allows you to persist HTTP session to file.

Notifications You must be signed in to change notification settings

kacirekj/garmin-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

garmin-api

Generic connector for Garmin Rest API written in Java.

Features

  • Supports UserSummary and HeartRates
  • Allows you to persist Http Session to file so you can workaround Garmin API login amount limitations
  • Generic JSON reponses - you can create your own models

Usage

  1. Basic usage:
// Login for GarminSession

LoginConnector loginConnector = new LoginConnector();
GarminSession garminSession = loginConnector.login("[email protected]", "password");

// Fetch data from API

DataConnector dataConnector = new DataConnector(garminSession);
Map<String,Object> userSummary = dataConnector.getUserSummary(LocalDate.now().minusDays(1));
Map<String,Object> heartRates = dataConnector.getHeartRates(LocalDate.now().minusDays(1));

System.out.println(userSummary);
System.out.println(heartRates);
System.out.println(garminSession);

  1. You can also serialize (e.g. into file) GarminSession object and reuse it during next application execution:
String json = garminSession.toJson();
GarminSession reusedGarminSession = GarminSession.createFromJson(json);

// Login is not needed
DataConnector anotherDataConnector = new DataConnector(reusedGarminSession);
Map<String,Object> anotherUserSummary = dataConnector.getUserSummary(LocalDate.now().minusDays(1));

Todo

  • More Datasets support

About

Generic connector for Garmin Rest API written in Java. It allows you to persist HTTP session to file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages