Authentication
All API requests require authentication using an API key.
Getting an API Key
- Create an account at app.apibiblia.com/register
- Go to your Dashboard
- Click Create New Key
- Copy and securely store your API key
WARNING
Your API key is shown only once when created. If you lose it, you'll need to create a new one.
Using Your API Key
Include your API key in the X-API-Key header with every request:
bash
curl "https://api.apibiblia.com/v1/versions" \
-H "X-API-Key: ab_live_xxxxx"API Key Format
API keys follow this format:
ab_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxab_- ApiBiblia prefixlive_- Environment (live for production)xxxxx...- 64 character unique identifier
Security Best Practices
Do
- ✅ Store API keys in environment variables
- ✅ Use different keys for development and production
- ✅ Rotate keys periodically
- ✅ Delete unused keys
Don't
- ❌ Commit API keys to version control
- ❌ Share API keys in public repositories
- ❌ Expose keys in client-side code
- ❌ Use the same key across all environments
Environment Variables
Store your API key in an environment variable:
bash
APIBIBLIA_API_KEY=ab_live_xxxxxjavascript
const apiKey = process.env.APIBIBLIA_API_KEY;
const response = await fetch(
'https://api.apibiblia.com/v1/versions',
{
headers: {
'X-API-Key': apiKey
}
}
);python
import os
import requests
api_key = os.environ.get('APIBIBLIA_API_KEY')
response = requests.get(
'https://api.apibiblia.com/v1/versions',
headers={'X-API-Key': api_key}
)Error Responses
Missing API Key
json
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "API key is required"
}
}Invalid API Key
json
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
}
}Expired API Key
json
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "API key has expired"
}
}Managing Keys
You can manage your API keys from the Dashboard:
- Create new keys with custom names
- Disable keys temporarily without deleting them
- Delete keys that are no longer needed
- View usage statistics for each key
Testing Your API Key
Each API key page includes a built-in API testing tool:
- Go to your API Keys
- Click on any key to view its details
- Scroll to the Test API Call section
- Select a Bible version, book, chapter, and verse type
- Click Test API Call to make a live request
The testing tool lets you:
- Test with different Bible versions
- Select specific books and chapters
- Fetch entire chapters or individual verses
- View the actual API response
TIP
Use the testing tool to verify your API key is working correctly before integrating it into your application.