File size: 2,789 Bytes
d6d843f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# Script to test all HuggingFace Space endpoints

BASE_URL="https://really-amin-datasourceforcryptocurrency.hf.space"

echo "=================================="
echo "πŸ§ͺ Testing HuggingFace Space API"
echo "=================================="
echo ""

# Color codes
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color

test_endpoint() {
    local name=$1
    local endpoint=$2
    
    echo -n "Testing $name ... "
    response=$(curl -s -w "\n%{http_code}" "$BASE_URL$endpoint" 2>&1)
    http_code=$(echo "$response" | tail -n1)
    body=$(echo "$response" | head -n-1)
    
    if [ "$http_code" = "200" ]; then
        echo -e "${GREEN}βœ“ OK${NC} (HTTP $http_code)"
        return 0
    else
        echo -e "${RED}βœ— FAILED${NC} (HTTP $http_code)"
        echo "  Response: $body"
        return 1
    fi
}

# Core Endpoints
echo "πŸ“Š Core Endpoints"
echo "==================="
test_endpoint "Health" "/health"
test_endpoint "Info" "/info"
test_endpoint "Providers" "/api/providers"
echo ""

# Data Endpoints
echo "πŸ’° Market Data Endpoints"
echo "========================="
test_endpoint "OHLCV (BTC)" "/api/ohlcv?symbol=BTCUSDT&interval=1h&limit=10"
test_endpoint "Top Prices" "/api/crypto/prices/top?limit=5"
test_endpoint "BTC Price" "/api/crypto/price/BTC"
test_endpoint "Market Overview" "/api/crypto/market-overview"
test_endpoint "Multiple Prices" "/api/market/prices?symbols=BTC,ETH,SOL"
test_endpoint "Market Data Prices" "/api/market-data/prices?symbols=BTC,ETH"
echo ""

# Analysis Endpoints
echo "πŸ“ˆ Analysis Endpoints"
echo "====================="
test_endpoint "Trading Signals" "/api/analysis/signals?symbol=BTCUSDT"
test_endpoint "SMC Analysis" "/api/analysis/smc?symbol=BTCUSDT"
test_endpoint "Scoring Snapshot" "/api/scoring/snapshot?symbol=BTCUSDT"
test_endpoint "All Signals" "/api/signals"
test_endpoint "Sentiment" "/api/sentiment"
echo ""

# System Endpoints
echo "βš™οΈ  System Endpoints"
echo "===================="
test_endpoint "System Status" "/api/system/status"
test_endpoint "System Config" "/api/system/config"
test_endpoint "Categories" "/api/categories"
test_endpoint "Rate Limits" "/api/rate-limits"
test_endpoint "Logs" "/api/logs?limit=10"
test_endpoint "Alerts" "/api/alerts"
echo ""

# HuggingFace Endpoints
echo "πŸ€— HuggingFace Endpoints"
echo "========================="
test_endpoint "HF Health" "/api/hf/health"
test_endpoint "HF Registry" "/api/hf/registry?kind=models"
echo ""

echo "=================================="
echo "βœ… Testing Complete!"
echo "=================================="
echo ""
echo "πŸ“– Full documentation: ${BASE_URL}/docs"
echo "πŸ“‹ API Guide: See HUGGINGFACE_API_GUIDE.md"