Quick Start

bash
# Install the SDK npm install @fitlifepro/sdk # Initialize with your API key const FitLife = require('@fitlifepro/sdk'); const client = new FitLife({ apiKey: 'flp_live_xxxxxxxxxxxx' });
javascript
// Fetch user profile const profile = await client.users.getProfile({ userId: 'usr_12345' }); console.log(profile.name); // "Alex Chen" console.log(profile.plan); // "pro"

Authentication

🔑 API Keys

Generate API keys from your dashboard. Keys are prefixed with flp_live_ for production and flp_test_ for sandbox.

flp_live_xK9mP2vL4nQ8rT6wY1...

🔐 OAuth 2.0

For third-party integrations, use our OAuth 2.0 flow. Request the offline_access scope for refresh tokens.

https://api.fitlifepro.com/oauth/authorize ?client_id=YOUR_CLIENT_ID &redirect_uri=YOUR_URI &scope=read write &response_type=code

API Endpoints

GET /v2/users/{userId} Get user profile
+

Returns the profile information for a specific user.

Parameter Type Description
userId required string The unique user identifier
include string Comma-separated: workouts, nutrition, progress
{
  "id": "usr_12345",
  "name": "Alex Chen",
  "email": "alex@example.com",
  "plan": "pro",
  "createdAt": "2024-03-15T10:30:00Z"
}
POST /v2/workouts Create workout log
+

Log a new workout session for the authenticated user.

Parameter Type Description
type required string strength, cardio, hiit, flexibility
duration required integer Duration in minutes
exercises array Array of exercise objects
GET /v2/nutrition/logs Get nutrition history
+

Retrieve nutrition logs for the user within a date range.

Parameter Type Description
startDate required date ISO 8601 date format
endDate required date ISO 8601 date format
PUT /v2/progress/weight Update weight entry
+

Add or update a weight measurement in the user's progress history.

Parameter Type Description
value required float Weight in kilograms
date required date Measurement date
DELETE /v2/workouts/{workoutId} Delete workout
+

Permanently delete a workout log. This action cannot be undone.

Parameter Type Description
workoutId required string The workout identifier to delete

Rate Limits

1000
Requests / Hour
100
Requests / Minute
10
Write Ops / Minute
50
Bulk Requests / Min

HTTP Status Codes

200 OK - Request succeeded
201 Created - Resource created
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
403 Forbidden - Insufficient permissions
404 Not Found - Resource doesn't exist
429 Too Many Requests - Rate limited
500 Server Error - Something went wrong

SDKs & Libraries

📦

Node.js

npm install @fitlifepro/sdk

🐍

Python

pip install fitlifepro

Java

com.fitlifepro:sdk

🍎

Swift

FitLifeProSDK