File size: 2,544 Bytes
f6c8eac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# APEX Data Hub API Reference

This package mounts new API routes without replacing the existing Space homepage.

## Console routes

- `GET /datahub` β€” English Data Hub console.
- `GET /datahub/console` β€” same console route.
- `GET /datahub/help` β€” help and operating guide.

## Provider probe API

- `GET /api/provider-probe/catalog`
  - Returns the active provider catalog loaded from `api-resources/apex_provider_runtime_catalog_free_v1.json`.

- `GET /api/provider-probe/status`
  - Returns the latest persisted provider health summary from SQLite.

- `GET /api/provider-probe/run?concurrency=5&timeout=12`
  - Runs a backend-side provider probe from the Hugging Face Space runtime.
  - Returns a single report with summary, healthy/degraded/failed providers, capability matrix, recommended order, missing secrets, and raw evidence.

- `GET /api/provider-probe/report`
  - Returns the latest complete persisted runtime report.

- `GET /api/provider-probe/history?limit=10`
  - Returns recent probe run summaries.

## Compatibility API added for APEX gaps

- `GET /api/coverage`
  - Provider and capability coverage summary derived from persisted health results.

- `GET /api/new-sources/status`
  - New-source and missing-secret status, suitable for diagnostics UI.

- `GET /api/fear-greed`
  - Alternative.me Fear & Greed wrapper. Does not invent upstream confidence.

- `GET /api/defi/protocols`
  - DeFiLlama protocols/TVL wrapper.

- `GET /api/defi/yields`
  - DeFiLlama yields/pools wrapper.

- `GET /api/news/latest`
  - Unified news wrapper: keyed providers first when configured, then public/server-side fallbacks, then explicit `UNAVAILABLE`.

- `GET /api/resources/news/latest`
  - Alias for the unified news service.

## Response states

The package preserves no-fabrication semantics:

- `LIVE` β€” fresh provider data fetched and parsed successfully.
- `CACHED` β€” previously real data, returned within an explicit freshness window.
- `DEGRADED` β€” partial or lower-quality fallback; never treated as primary truth.
- `UNAVAILABLE` β€” no trusted source currently available.
- `NEEDS_KEY` β€” provider is configured in catalog but required/optional key is missing.
- `SCHEMA_MISMATCH` β€” HTTP response arrived but failed parser/validator expectations.
- `RATE_LIMITED` β€” provider rejected due to quota/rate limit.
- `HTTP_ERROR` / `NETWORK_ERROR` β€” transport failed.

## Secret policy

Secret values never appear in committed files, HTML, API responses, JSON reports, or logs. Use Hugging Face Space Secrets only.