2024-08-23

·Visit Project

Fitness API (GoogleFit)

The unofficial API for google fit/noise.

Table of Contents

Introduction

A simple Express.js application that integrates with the Google Fit API to fetch and aggregate fitness data. This app uses Google OAuth2 for authentication and Appwrite for additional backend functionality.

Features

  • Authenticate users with Google OAuth2
  • Fetch fitness data from Google Fit API
  • Aggregate various fitness metrics such as step count, blood glucose, heart rate, weight, height, sleep hours, and body fat percentage
  • Serve static files and a basic HTML interface

Endpoints

  • GET /auth/google

    Generates and returns the Google OAuth2 authentication URL.

  • GET /auth/google/callback

    Handles the OAuth2 callback, exchanges the authorization code for tokens, and retrieves user profile data.

  • GET /fetch-data

    Fetches and aggregates fitness data from the Google Fit API and returns it as a JSON response.

  • GET /

    Serves a static index.html file.

Usage

  1. Visit http://localhost:3000/ to access the application.
  2. Navigate to /auth/google to initiate the Google authentication process.
  3. After successful authentication, the application will redirect to /fetch-data to display the aggregated fitness data.

Debugging

Check the console logs for debugging information, including raw API responses and user profile data.


#Tags

google
fit
api

Contact

Need more project details, have any doubts in mind, or interested in working together? Reach out to me directly at krushnavyas066@gmail.com. I'd be happy to connect and talk!

← All Projects