This guide will help you obtain the free API keys needed for CycleSync.
Free Tier: 100 requests/day
Steps to get your key:
- Visit https://newsapi.org/
- Click "Get API Key"
- Sign up with your email
- Verify your email
- Copy your API key from the dashboard
- Add to
.env.local:VITE_NEWSAPI_KEY=your_key_here
Free Tier: 10,000 requests/month
Steps to get your key:
- Visit https://rapidapi.com/
- Sign up for a free account
- Go to ExerciseDB API
- Click "Subscribe to Test"
- Select the Basic (Free) plan
- Copy your
X-RapidAPI-Keyfrom the code snippets - Add to
.env.local:VITE_RAPIDAPI_KEY=your_key_here
Free Tier: 150 requests/day
Steps to get your key:
- Visit https://spoonacular.com/food-api
- Click "Get Access"
- Sign up for a free account
- Go to your Profile
- Copy your API key
- Add to
.env.local:VITE_SPOONACULAR_KEY=your_key_here
Important: The app tracks your daily usage and automatically switches to fallback recipes when you reach the limit. You'll see a friendly message: "You've reached the daily limit for detailed recipes. Tomorrow you'll have more!"
You should already have this from the initial setup.
If not:
- Visit https://makersuite.google.com/app/apikey
- Create an API key
- Add to
.env.local:VITE_GEMINI_API_KEY=your_key_here
-
Create
.env.localfile in the root of your project:cp .env.example .env.local
-
Add all your API keys to
.env.local:VITE_GEMINI_API_KEY=your_gemini_key VITE_NEWSAPI_KEY=your_newsapi_key VITE_RAPIDAPI_KEY=your_rapidapi_key VITE_SPOONACULAR_KEY=your_spoonacular_key
-
Restart your dev server:
npm run dev
| API | Feature | Free Limit | Fallback |
|---|---|---|---|
| NewsAPI | Health articles in Dashboard | 100/day | Static curated articles |
| ExerciseDB | Exercise GIFs and instructions | 10,000/month | 3 basic exercises |
| Spoonacular | Recipe search with nutrition | 150/day | 6 curated recipes |
| Gemini AI | Smart chatbot assistant | Generous free tier | N/A |
The app automatically tracks your Spoonacular API usage:
- Tracks requests in localStorage
- Resets daily at midnight
- Shows warning when limit is reached
- Switches to fallback recipes automatically
- Displays reset time to users
You can check your quota status in the Nutrition page - a banner will appear when you're close to or have exceeded the daily limit.
- Make sure your
.env.localfile exists - Check that all keys start with
VITE_ - Restart your dev server after adding keys
- NewsAPI: Wait until tomorrow or upgrade to paid plan
- ExerciseDB: Very generous limit, unlikely to hit
- Spoonacular: App will show fallback recipes automatically
- Check if your API key is valid
- Verify you're subscribed to the free plan (RapidAPI)
- Check browser console for specific error messages
- Ensure you haven't exceeded rate limits
Total Monthly Cost: $0 🎉
All APIs used in this project have generous free tiers that are more than sufficient for personal use and development.
If you need more requests:
- NewsAPI: $449/month (Business plan)
- Spoonacular: $19/month (500 requests/day)
- ExerciseDB: Free tier is very generous
- All API keys are stored in
.env.local(gitignored) - Keys are only used client-side for this personal project
- For production, consider using a backend proxy to hide API keys
- No user data is sent to third-party APIs
If you encounter any issues:
- Check the browser console for errors
- Verify all API keys are correctly formatted
- Ensure you're using the latest version of the code
- Check API provider status pages
Happy coding! 🚀