Complete API documentation for BitMshauri bot integrations
BitMshauri bot provides several API integrations for external services and applications. This documentation covers all available APIs and their usage.
https://api.bitmshauri.com
All API endpoints are relative to this base URL
Authorization: Bearer YOUR_API_KEY
Include your API key in the Authorization header
Content-Type: application/json
All responses are returned in JSON format
{
"success": true,
"data": {
// Response data here
},
"message": "Operation completed successfully",
"timestamp": "2024-01-15T10:30:00Z"
}
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Invalid parameters provided",
"details": "Missing required field: user_id"
},
"timestamp": "2024-01-15T10:30:00Z"
}
The bot responds to various commands and natural language inputs:
/bot/command
Send a command to the bot programmatically
{
"user_id": 123456789,
"command": "/price",
"parameters": {}
}
{
"success": true,
"data": {
"message_id": 987654321,
"response": "Bitcoin price: $43,250.00 USD"
}
}
/bot/status
Check the current status of the bot
{
"success": true,
"data": {
"status": "online",
"uptime": "24h 15m 30s",
"active_users": 1250,
"total_commands": 15420
}
}
Access real-time cryptocurrency price information:
/price/bitcoin
Retrieve current Bitcoin price in multiple currencies
currency
- Target currency (USD, TZS, EUR, etc.)format
- Response format (json, simple){
"success": true,
"data": {
"price_usd": 43250.00,
"price_tzs": 108125000.00,
"change_24h": 2.45,
"market_cap": 847500000000,
"volume_24h": 28500000000,
"last_updated": "2024-01-15T10:30:00Z"
}
}
/price/convert
Convert between different currencies and Bitcoin
amount
- Amount to convertfrom
- Source currencyto
- Target currencyGET /price/convert?amount=100&from=USD&to=BTC
{
"success": true,
"data": {
"amount": 100,
"from": "USD",
"to": "BTC",
"result": 0.00231,
"rate": 43250.00,
"timestamp": "2024-01-15T10:30:00Z"
}
}
Access the AI-powered question answering system:
/ai/ask
Send a question to the AI system for Bitcoin-related answers
{
"question": "What is Bitcoin?",
"language": "en",
"context": "beginner"
}
{
"success": true,
"data": {
"answer": "Bitcoin is a decentralized digital currency...",
"confidence": 0.95,
"sources": ["bitcoin.org", "wikipedia.org"],
"related_topics": ["blockchain", "cryptography", "mining"]
}
}
/ai/topics
Retrieve available topics for AI questions
{
"success": true,
"data": {
"topics": [
"bitcoin_basics",
"blockchain_technology",
"mining",
"wallet_security",
"trading",
"regulation"
]
}
}
Receive real-time notifications about bot events:
Configure webhooks to receive notifications about:
POST https://your-domain.com/webhook/bitmshauri
{
"event": "user_registered",
"user_id": 123456789,
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"username": "john_doe",
"language": "en"
}
}
To ensure fair usage, the API implements rate limiting:
The API includes rate limit information in response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1642233600
Here are some practical examples of how to use the API:
import requests
# Get Bitcoin price
response = requests.get(
'https://api.bitmshauri.com/price/bitcoin',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
if response.status_code == 200:
data = response.json()
price = data['data']['price_usd']
print(f"Bitcoin price: ${price:,.2f}")
// Ask AI question
const response = await fetch('https://api.bitmshauri.com/ai/ask', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({
question: 'What is blockchain?',
language: 'en'
})
});
const data = await response.json();
console.log(data.data.answer);
# Convert currency
curl -X GET \
"https://api.bitmshauri.com/price/convert?amount=100&from=USD&to=BTC" \
-H "Authorization: Bearer YOUR_API_KEY"