curl -X POST http://localhost:8000/api/analyze \
-H "Content-Type: application/json" \
-d '{"asset":"chatgpt"}' | jq
Dados Esperados:
curl -X POST http://localhost:8000/api/analyze \
-H "Content-Type: application/json" \
-d '{"asset":"claude"}' | jq
Dados Esperados:
curl -X POST http://localhost:8000/api/analyze \
-H "Content-Type: application/json" \
-d '{"asset":"langchain"}' | jq
Dados Esperados:
curl -X POST http://localhost:8000/api/analyze \
-H "Content-Type: application/json" \
-d '{"asset":"bitcoin"}' | jq
Dados CoinGecko:
curl -X POST http://localhost:8000/api/analyze \
-H "Content-Type: application/json" \
-d '{"asset":"ethereum"}' | jq
curl -X POST http://localhost:8000/api/analyze/custom \
-H "Content-Type: application/json" \
-d '{
"pypi_package": "fastapi",
"github_owner": "tiangolo",
"github_repo": "fastapi",
"subreddit": "FastAPI"
}' | jq
curl -X POST http://localhost:8000/api/analyze/custom \
-H "Content-Type: application/json" \
-d '{
"github_owner": "seu-usuario",
"github_repo": "seu-repo",
"pypi_package": "seu-pacote"
}' | jq
curl "http://localhost:8000/api/compare?assets=chatgpt,claude,langchain" | jq
Output esperado:
{
"comparison": [
{"asset": "ChatGPT/OpenAI", "bubble_index": 32.4, "risk_level": "Moderado"},
{"asset": "LangChain", "bubble_index": 28.1, "risk_level": "Baixo"},
{"asset": "Claude/Anthropic", "bubble_index": 25.7, "risk_level": "Baixo"}
]
}
curl http://localhost:8000/presets | jq
Output:
{
"presets": ["chatgpt", "claude", "langchain", "bitcoin", "ethereum", "stable-diffusion"],
"configs": {
"chatgpt": {
"name": "ChatGPT/OpenAI",
"pypi_package": "openai",
"github": {"owner": "openai", "repo": "openai-python"},
"subreddit": "OpenAI",
"category": "AI/LLM"
}
}
}
{
"asset": "ChatGPT/OpenAI",
"category": "AI/LLM",
"data_sources": {
"pypi_downloads": 45000000,
"github_stars": 75000,
"github_forks": 8000,
"github_watchers": 50000,
"reddit_subscribers": 1200000,
"reddit_active": 5000,
"google_trends": 45,
"sentiment": 0.0
},
"analysis": {
"metrics": {
"adoption": 0.750, // 75% - Alta adoção real
"hype": 0.580, // 58% - Hype moderado
"investment": 0.700, // 70% - Alto investimento
"network": 0.650, // 65% - Bom efeito de rede
"feedback": 0.170, // 17% - Feedback equilibrado
"divergence": 0.085 // 8.5% - Baixa divergência (bom!)
},
"bubble_index": 0.324,
"bubble_percentage": 32.4,
"risk": {
"level": "Moderado",
"color": "yellow",
"action": "Monitorar",
"score": 0.324
}
},
"timestamp": "2024-01-15T10:30:00"
}
Analisar startup de IA
curl -X POST http://localhost:8000/api/analyze/custom \
-d '{
"github_owner": "startup-xyz",
"github_repo": "produto-ai",
"pypi_package": "startup-xyz"
}'
Se bubble_index > 60%: Red flag
Se divergence > 50%: Hype >> Adoção
Comparar assets do portfolio
curl "http://localhost:8000/api/compare?assets=bitcoin,ethereum"
Rebalancear se algum > 70%
Comparar frameworks
curl "http://localhost:8000/api/compare?assets=langchain,stable-diffusion"
Ver qual tem melhor adoção real
Análise de ChatGPT
curl -X POST ... -d '{"asset":"chatgpt"}'
Decision:
< 30%: Early, bom momento
30-50%: Growth, monitorar
50-70%: Late, cautela
> 70%: Bubble, evitar
1. Ver presets disponíveis
curl localhost:8000/presets
2. Analisar asset de interesse
curl -X POST localhost:8000/api/analyze \
-H "Content-Type: application/json" \
-d '{"asset":"chatgpt"}'
3. Se não está em preset, usar custom
curl -X POST localhost:8000/api/analyze/custom \
-d '{"pypi_package":"nome-pacote"}'
4. Comparar com competitors
curl "localhost:8000/api/compare?assets=asset1,asset2,asset3"
5. Decisão baseada em bubble_index
1. Abrir http://localhost:3000
2. Selecionar ou digitar asset
3. Clicar "Analisar Bolha"
4. Ver:
- Bubble Index (%)
- Risk Level
- 6 Métricas
- Radar Chart
- Data Sources
5. Tomar decisão
Em fetchers.py
ASSET_CONFIGS["meu-framework"] = {
"name": "Meu Framework",
"pypi_package": "meu-pkg",
"npm_package": "meu-pkg-js",
"github": {"owner": "user", "repo": "repo"},
"subreddit": "MeuFramework",
"category": "AI/Framework"
}
Em calculators.py
self.weights = {
"divergence": 0.30, # Aumentar importância
"investment": 0.25,
"network": 0.20,
"feedback": 0.25
}
Com Redis
@cached(ttl=3600) # 1 hora
async def fetch_pypi(package):
...
Analisar múltiplos de uma vez
assets = ["chatgpt", "claude", "langchain"]
for asset in assets:
result = await analyze(asset)
✅ Sempre disponíveis:
⚠️ Rate limits:
Se API falhar:
Retorna default
{"downloads": 0}
Não quebra análise
Métricas usam dados disponíveis
---
Pro Tip: Use frontend para análise visual, API para integração com sistemas.