Files
bible-app/RAPIDAPI_TROUBLESHOOTING.md
christianandClaude Opus 5 0db5e9b07d Bible App 1.4.34 — full source
First commit on the local Gitea server, made after moving the tree off the
Windows machine. Build outputs, node_modules and the AI models stay out
(see .gitignore); everything the installer build needs is tracked.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 13:05:20 -04:00

84 lines
2.7 KiB
Markdown

# RapidAPI Troubleshooting Guide
## Quick Test
Open your browser console (F12) and run:
```javascript
await window.testRapidAPIDirect('love');
```
This will show you exactly what's happening with the API call.
## Common Issues
### 1. "API key not configured"
**Fix:** Set your API key:
```javascript
localStorage.setItem('rapidapi.key', 'YOUR_KEY_HERE');
```
### 2. "No working endpoint found"
**Problem:** The API endpoint structure is unknown. We're guessing at the endpoints.
**Fix:**
1. Go to the RapidAPI playground: https://rapidapi.com/teachjesusapp/api/complete-study-bible/playground
2. Test different endpoints to see what works
3. Look at the actual endpoint URL in the playground
4. Update the endpoint in `rapidapi-study-bible.js` (around line 42)
### 3. "Authentication failed (401/403)"
**Problem:** Your API key is wrong or you're not subscribed.
**Fix:**
1. Check you're subscribed to the API on RapidAPI
2. Copy your API key again from RapidAPI dashboard
3. Make sure you copied the entire key (they're long!)
### 4. API returns data but nothing shows in popup
**Problem:** The response format doesn't match what we're expecting.
**Fix:**
1. Run `await window.testRapidAPIDirect('love')` in console
2. Look at the "Response data" - see what structure it has
3. The parser tries to find common fields, but might need adjustment
4. Check the console logs - it shows what data was found
## Finding the Right Endpoint
The integration tries these endpoints automatically:
- `/word/{word}`
- `/words/{word}`
- `/search?word={word}`
- `/definition/{word}`
- `/word/{word}/definition`
- `/api/word/{word}`
- `/api/words/{word}`
- `/api/search?word={word}`
**To find the correct one:**
1. Go to RapidAPI playground
2. Look at the actual endpoint URL when you test it
3. Copy that endpoint structure
4. Update line 42 in `rapidapi-study-bible.js` to use that structure
## What to Check in Console
When you click a word, look for these logs:
- `[RapidAPI] Querying word:` - Shows it's trying
- `[RapidAPI] Trying endpoint:` - Shows which endpoints it's testing
- `[RapidAPI] Response status:` - Shows if request succeeded
- `[RapidAPI] ✅ SUCCESS!` - Means it found a working endpoint
- `[RapidAPI] ❌ Failed:` - Shows why it failed
## Still Not Working?
1. **Check RapidAPI playground** - Does it work there?
2. **Check your subscription** - Are you subscribed to the API?
3. **Check API key** - Is it correct?
4. **Check endpoint** - What's the actual endpoint structure?
5. **Check response format** - What does the API actually return?
The integration is flexible but needs to know the correct endpoint structure. Once you find it in the playground, we can update the code to use it.