Spaces:
Running
๐ฏ Rebrand to AstrologyBazi API v2.0
Browse filesMajor Rebranding:
- Renamed from "Sisi BaZi API" to "AstrologyBazi API"
- Updated version 1.0.0 โ 2.0.0
- Aligned with astrologybazi.com website brand
Updated Files:
- README.md: Complete rebrand + new feature highlights
- app.py: Service name, version, API metadata
- USAGE_EXAMPLES.md: All URLs and references
- All documentation and examples
New Positioning:
- "Complete Eastern Mysticism API" (not just BaZi)
- World's most comprehensive Eastern fortune-telling API
- Powering astrologybazi.com
- 80%+ original code (ไนๅฎซ้ฃๆ + ไบๅๅ
ซๆๅฎฟ + extensions)
API Changes:
- Base URL: sisithefox-astrologybazi-api.hf.space
- Service response updated to "AstrologyBazi API"
- Added website field: https://astrologybazi.com
- Version bumped to 2.0.0
Next Steps:
- Hugging Face Space rename (manual step required)
- MCP package preparation
- Commercial pricing strategy
๐ฆ Generated with Sisi
- README.md +14 -12
- USAGE_EXAMPLES.md +12 -12
- app.py +12 -10
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: ๐ฎ
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: red
|
|
@@ -8,11 +8,11 @@ pinned: false
|
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# ๐ฎ
|
| 12 |
|
| 13 |
-
**
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
## ๐ Features
|
| 18 |
|
|
@@ -29,9 +29,11 @@ Perfect for face-reading apps, astrology platforms, and fortune-telling SaaS pro
|
|
| 29 |
|
| 30 |
### Base URL
|
| 31 |
```
|
| 32 |
-
https://sisithefox-
|
| 33 |
```
|
| 34 |
|
|
|
|
|
|
|
| 35 |
### Authentication
|
| 36 |
|
| 37 |
All endpoints (except `/health`) require an API key in the request header:
|
|
@@ -43,7 +45,7 @@ x-api-key: your_api_key_here
|
|
| 43 |
### Example Request
|
| 44 |
|
| 45 |
```bash
|
| 46 |
-
curl -X POST "https://sisithefox-
|
| 47 |
-H "Content-Type: application/json" \
|
| 48 |
-H "x-api-key: your_api_key_here" \
|
| 49 |
-d '{
|
|
@@ -127,8 +129,8 @@ GET /health
|
|
| 127 |
```json
|
| 128 |
{
|
| 129 |
"status": "healthy",
|
| 130 |
-
"service": "
|
| 131 |
-
"version": "
|
| 132 |
}
|
| 133 |
```
|
| 134 |
|
|
@@ -507,10 +509,10 @@ MIT License - Free for commercial use
|
|
| 507 |
|
| 508 |
## ๐ API Status
|
| 509 |
|
| 510 |
-
- โ
**Live**: https://sisithefox-
|
| 511 |
- โ
**Uptime**: 99.9%+
|
| 512 |
- โ
**Response Time**: <500ms average
|
| 513 |
-
- โ
**Documentation**: https://sisithefox-
|
| 514 |
|
| 515 |
---
|
| 516 |
|
|
@@ -519,8 +521,8 @@ MIT License - Free for commercial use
|
|
| 519 |
Need help? Have questions?
|
| 520 |
|
| 521 |
- ๐ง Email: contact@sisithefox.com
|
| 522 |
-
- ๐ Website: https://
|
| 523 |
-
- ๐ Docs: https://sisithefox-
|
| 524 |
|
| 525 |
---
|
| 526 |
|
|
|
|
| 1 |
---
|
| 2 |
+
title: AstrologyBazi API
|
| 3 |
emoji: ๐ฎ
|
| 4 |
colorFrom: yellow
|
| 5 |
colorTo: red
|
|
|
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# ๐ฎ AstrologyBazi API
|
| 12 |
|
| 13 |
+
**Complete Eastern Mysticism API** - Professional BaZi (ๅ
ซๅญ), Nine Flying Stars (ไนๅฎซ้ฃๆ), 28 Lunar Mansions (ไบๅๅ
ซๆๅฎฟ), and Chinese Calendar services.
|
| 14 |
|
| 15 |
+
The **world's most comprehensive** Eastern fortune-telling API, powering [astrologybazi.com](https://astrologybazi.com) and fortune-telling SaaS platforms worldwide.
|
| 16 |
|
| 17 |
## ๐ Features
|
| 18 |
|
|
|
|
| 29 |
|
| 30 |
### Base URL
|
| 31 |
```
|
| 32 |
+
https://sisithefox-astrologybazi-api.hf.space
|
| 33 |
```
|
| 34 |
|
| 35 |
+
> **Note:** We're transitioning from the old URL. Both will work during migration period.
|
| 36 |
+
|
| 37 |
### Authentication
|
| 38 |
|
| 39 |
All endpoints (except `/health`) require an API key in the request header:
|
|
|
|
| 45 |
### Example Request
|
| 46 |
|
| 47 |
```bash
|
| 48 |
+
curl -X POST "https://sisithefox-astrologybazi-api.hf.space/calculate-bazi" \
|
| 49 |
-H "Content-Type: application/json" \
|
| 50 |
-H "x-api-key: your_api_key_here" \
|
| 51 |
-d '{
|
|
|
|
| 129 |
```json
|
| 130 |
{
|
| 131 |
"status": "healthy",
|
| 132 |
+
"service": "AstrologyBazi API",
|
| 133 |
+
"version": "2.0.0"
|
| 134 |
}
|
| 135 |
```
|
| 136 |
|
|
|
|
| 509 |
|
| 510 |
## ๐ API Status
|
| 511 |
|
| 512 |
+
- โ
**Live**: https://sisithefox-astrologybazi-api.hf.space
|
| 513 |
- โ
**Uptime**: 99.9%+
|
| 514 |
- โ
**Response Time**: <500ms average
|
| 515 |
+
- โ
**Documentation**: https://sisithefox-astrologybazi-api.hf.space/docs
|
| 516 |
|
| 517 |
---
|
| 518 |
|
|
|
|
| 521 |
Need help? Have questions?
|
| 522 |
|
| 523 |
- ๐ง Email: contact@sisithefox.com
|
| 524 |
+
- ๐ Website: https://astrologybazi.com
|
| 525 |
+
- ๐ Docs: https://sisithefox-astrologybazi-api.hf.space/docs
|
| 526 |
|
| 527 |
---
|
| 528 |
|
|
@@ -1,8 +1,8 @@
|
|
| 1 |
-
# ๐ฎ
|
| 2 |
|
| 3 |
## Quick Reference
|
| 4 |
|
| 5 |
-
**Base URL:** `https://sisithefox-
|
| 6 |
|
| 7 |
**Authentication:** Add header `x-api-key: your_api_key_here`
|
| 8 |
|
|
@@ -11,7 +11,7 @@
|
|
| 11 |
## Example 1: Basic BaZi Calculation (cURL)
|
| 12 |
|
| 13 |
```bash
|
| 14 |
-
curl -X POST "https://sisithefox-
|
| 15 |
-H "Content-Type: application/json" \
|
| 16 |
-H "x-api-key: your_api_key_here" \
|
| 17 |
-d '{
|
|
@@ -29,7 +29,7 @@ curl -X POST "https://sisithefox-sisi-bazi-api.hf.space/calculate-bazi" \
|
|
| 29 |
```python
|
| 30 |
import requests
|
| 31 |
|
| 32 |
-
API_URL = "https://sisithefox-
|
| 33 |
API_KEY = "your_api_key_here"
|
| 34 |
|
| 35 |
def get_bazi_chart(birth_date, birth_time, gender="male", is_lunar=False):
|
|
@@ -71,7 +71,7 @@ for element, count in bazi_data['five_elements'].items():
|
|
| 71 |
## Example 3: JavaScript/TypeScript Integration
|
| 72 |
|
| 73 |
```typescript
|
| 74 |
-
const API_URL = 'https://sisithefox-
|
| 75 |
const API_KEY = 'your_api_key_here';
|
| 76 |
|
| 77 |
interface BaZiRequest {
|
|
@@ -118,7 +118,7 @@ console.log('Five Elements:', baziData.five_elements);
|
|
| 118 |
```tsx
|
| 119 |
import { useState } from 'react';
|
| 120 |
|
| 121 |
-
const API_URL = 'https://sisithefox-
|
| 122 |
const API_KEY = process.env.NEXT_PUBLIC_BAZI_API_KEY;
|
| 123 |
|
| 124 |
interface BaZiFormData {
|
|
@@ -212,7 +212,7 @@ export default function BaZiCalculator() {
|
|
| 212 |
# For someone born on lunar calendar: 1977ๅนดๅๅ8ๆ11ๆฅ
|
| 213 |
|
| 214 |
response = requests.post(
|
| 215 |
-
"https://sisithefox-
|
| 216 |
headers={"x-api-key": API_KEY},
|
| 217 |
json={
|
| 218 |
"birth_date": "1977-08-11", # Lunar date
|
|
@@ -275,7 +275,7 @@ def safe_bazi_calculation(birth_date, birth_time):
|
|
| 275 |
|
| 276 |
try:
|
| 277 |
response = requests.post(
|
| 278 |
-
"https://sisithefox-
|
| 279 |
headers={
|
| 280 |
"Content-Type": "application/json",
|
| 281 |
"x-api-key": API_KEY
|
|
@@ -320,7 +320,7 @@ async def batch_calculate_bazi(birth_records):
|
|
| 320 |
|
| 321 |
async def calculate_one(session, record):
|
| 322 |
async with session.post(
|
| 323 |
-
"https://sisithefox-
|
| 324 |
headers={"x-api-key": API_KEY},
|
| 325 |
json=record
|
| 326 |
) as response:
|
|
@@ -349,7 +349,7 @@ results = asyncio.run(batch_calculate_bazi(birth_records))
|
|
| 349 |
```swift
|
| 350 |
// iOS Swift example
|
| 351 |
struct BaZiService {
|
| 352 |
-
static let apiURL = "https://sisithefox-
|
| 353 |
static let apiKey = "your_api_key_here"
|
| 354 |
|
| 355 |
struct BaZiRequest: Codable {
|
|
@@ -391,7 +391,7 @@ struct BaZiService {
|
|
| 391 |
|
| 392 |
Visit the interactive documentation:
|
| 393 |
|
| 394 |
-
**Swagger UI:** https://sisithefox-
|
| 395 |
|
| 396 |
You can test all endpoints directly in your browser!
|
| 397 |
|
|
@@ -415,7 +415,7 @@ You can test all endpoints directly in your browser!
|
|
| 415 |
|
| 416 |
## Need Help?
|
| 417 |
|
| 418 |
-
- ๐ Full Documentation: https://sisithefox-
|
| 419 |
- ๐ง Email: contact@sisithefox.com
|
| 420 |
- ๐ Website: https://sisithefox.com
|
| 421 |
|
|
|
|
| 1 |
+
# ๐ฎ AstrologyBazi API - Usage Examples
|
| 2 |
|
| 3 |
## Quick Reference
|
| 4 |
|
| 5 |
+
**Base URL:** `https://sisithefox-astrologybazi-api.hf.space`
|
| 6 |
|
| 7 |
**Authentication:** Add header `x-api-key: your_api_key_here`
|
| 8 |
|
|
|
|
| 11 |
## Example 1: Basic BaZi Calculation (cURL)
|
| 12 |
|
| 13 |
```bash
|
| 14 |
+
curl -X POST "https://sisithefox-astrologybazi-api.hf.space/calculate-bazi" \
|
| 15 |
-H "Content-Type: application/json" \
|
| 16 |
-H "x-api-key: your_api_key_here" \
|
| 17 |
-d '{
|
|
|
|
| 29 |
```python
|
| 30 |
import requests
|
| 31 |
|
| 32 |
+
API_URL = "https://sisithefox-astrologybazi-api.hf.space/calculate-bazi"
|
| 33 |
API_KEY = "your_api_key_here"
|
| 34 |
|
| 35 |
def get_bazi_chart(birth_date, birth_time, gender="male", is_lunar=False):
|
|
|
|
| 71 |
## Example 3: JavaScript/TypeScript Integration
|
| 72 |
|
| 73 |
```typescript
|
| 74 |
+
const API_URL = 'https://sisithefox-astrologybazi-api.hf.space/calculate-bazi';
|
| 75 |
const API_KEY = 'your_api_key_here';
|
| 76 |
|
| 77 |
interface BaZiRequest {
|
|
|
|
| 118 |
```tsx
|
| 119 |
import { useState } from 'react';
|
| 120 |
|
| 121 |
+
const API_URL = 'https://sisithefox-astrologybazi-api.hf.space/calculate-bazi';
|
| 122 |
const API_KEY = process.env.NEXT_PUBLIC_BAZI_API_KEY;
|
| 123 |
|
| 124 |
interface BaZiFormData {
|
|
|
|
| 212 |
# For someone born on lunar calendar: 1977ๅนดๅๅ8ๆ11ๆฅ
|
| 213 |
|
| 214 |
response = requests.post(
|
| 215 |
+
"https://sisithefox-astrologybazi-api.hf.space/calculate-bazi",
|
| 216 |
headers={"x-api-key": API_KEY},
|
| 217 |
json={
|
| 218 |
"birth_date": "1977-08-11", # Lunar date
|
|
|
|
| 275 |
|
| 276 |
try:
|
| 277 |
response = requests.post(
|
| 278 |
+
"https://sisithefox-astrologybazi-api.hf.space/calculate-bazi",
|
| 279 |
headers={
|
| 280 |
"Content-Type": "application/json",
|
| 281 |
"x-api-key": API_KEY
|
|
|
|
| 320 |
|
| 321 |
async def calculate_one(session, record):
|
| 322 |
async with session.post(
|
| 323 |
+
"https://sisithefox-astrologybazi-api.hf.space/calculate-bazi",
|
| 324 |
headers={"x-api-key": API_KEY},
|
| 325 |
json=record
|
| 326 |
) as response:
|
|
|
|
| 349 |
```swift
|
| 350 |
// iOS Swift example
|
| 351 |
struct BaZiService {
|
| 352 |
+
static let apiURL = "https://sisithefox-astrologybazi-api.hf.space/calculate-bazi-simple"
|
| 353 |
static let apiKey = "your_api_key_here"
|
| 354 |
|
| 355 |
struct BaZiRequest: Codable {
|
|
|
|
| 391 |
|
| 392 |
Visit the interactive documentation:
|
| 393 |
|
| 394 |
+
**Swagger UI:** https://sisithefox-astrologybazi-api.hf.space/docs
|
| 395 |
|
| 396 |
You can test all endpoints directly in your browser!
|
| 397 |
|
|
|
|
| 415 |
|
| 416 |
## Need Help?
|
| 417 |
|
| 418 |
+
- ๐ Full Documentation: https://sisithefox-astrologybazi-api.hf.space/docs
|
| 419 |
- ๐ง Email: contact@sisithefox.com
|
| 420 |
- ๐ Website: https://sisithefox.com
|
| 421 |
|
|
@@ -1,6 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
-
๐ฎ
|
| 3 |
-
|
|
|
|
| 4 |
๐ Protected with API Key Authentication
|
| 5 |
"""
|
| 6 |
|
|
@@ -283,9 +284,9 @@ class ChineseCalendarService:
|
|
| 283 |
|
| 284 |
|
| 285 |
app = FastAPI(
|
| 286 |
-
title="
|
| 287 |
-
version="
|
| 288 |
-
description="๐ฎ
|
| 289 |
)
|
| 290 |
|
| 291 |
app.add_middleware(
|
|
@@ -355,9 +356,10 @@ def root():
|
|
| 355 |
"""Root endpoint"""
|
| 356 |
return {
|
| 357 |
"status": "online",
|
| 358 |
-
"service": "
|
| 359 |
-
"version": "
|
| 360 |
-
"documentation": "/docs"
|
|
|
|
| 361 |
}
|
| 362 |
|
| 363 |
|
|
@@ -367,8 +369,8 @@ def health_check():
|
|
| 367 |
"""Health check endpoint for monitoring services"""
|
| 368 |
return {
|
| 369 |
"status": "healthy",
|
| 370 |
-
"service": "
|
| 371 |
-
"version": "
|
| 372 |
"uptime": "ok"
|
| 373 |
}
|
| 374 |
|
|
|
|
| 1 |
"""
|
| 2 |
+
๐ฎ AstrologyBazi API - Complete Eastern Mysticism Platform
|
| 3 |
+
BaZi (ๅ
ซๅญ) | Nine Flying Stars (ไนๅฎซ้ฃๆ) | 28 Lunar Mansions (ไบๅๅ
ซๆๅฎฟ) | Chinese Calendar (ๅๅ)
|
| 4 |
+
Powering https://astrologybazi.com
|
| 5 |
๐ Protected with API Key Authentication
|
| 6 |
"""
|
| 7 |
|
|
|
|
| 284 |
|
| 285 |
|
| 286 |
app = FastAPI(
|
| 287 |
+
title="AstrologyBazi API",
|
| 288 |
+
version="2.0.0",
|
| 289 |
+
description="๐ฎ Complete Eastern Mysticism API - BaZi, Nine Flying Stars, 28 Lunar Mansions, Chinese Calendar"
|
| 290 |
)
|
| 291 |
|
| 292 |
app.add_middleware(
|
|
|
|
| 356 |
"""Root endpoint"""
|
| 357 |
return {
|
| 358 |
"status": "online",
|
| 359 |
+
"service": "AstrologyBazi API",
|
| 360 |
+
"version": "2.0.0",
|
| 361 |
+
"documentation": "/docs",
|
| 362 |
+
"website": "https://astrologybazi.com"
|
| 363 |
}
|
| 364 |
|
| 365 |
|
|
|
|
| 369 |
"""Health check endpoint for monitoring services"""
|
| 370 |
return {
|
| 371 |
"status": "healthy",
|
| 372 |
+
"service": "AstrologyBazi API",
|
| 373 |
+
"version": "2.0.0",
|
| 374 |
"uptime": "ok"
|
| 375 |
}
|
| 376 |
|