Financial data aggregation tools for Polymarket prediction markets and Twitter/X analysis.
sourcer/
├── app.py # FastAPI app (Railway deployment)
├── api/ # Vercel serverless functions
│ ├── polymarket.py # /api/polymarket endpoint
│ └── twitter.py # /api/twitter endpoint
├── lib/ # Core library code
│ ├── polymarket_reader.py
│ ├── twitter_reader.py
│ └── twitter_reader_batch.py
├── examples/ # Example scripts & outputs
│ ├── googl_distribution.py
│ └── output/
├── docs/ # Documentation
├── vercel.json # Vercel config
├── Procfile # Railway config
└── requirements.txt
pip install -r requirements.txtuvicorn app:app --reloadThen visit: http://localhost:8000
# Search Polymarket
python lib/polymarket_reader.py --search "bitcoin"
# Get specific event
python lib/polymarket_reader.py --slug "what-will-googl-hit-before-2026"
# Twitter analysis
python lib/twitter_reader.py --accounts "@elonmusk" --topic "AI" --timeframe "7 days"| Endpoint | Description |
|---|---|
GET /polymarket/search?q=keyword |
Search markets by keyword |
GET /polymarket/event/{slug} |
Get event details by slug |
GET /polymarket/tags |
List all available tags |
| Endpoint | Description |
|---|---|
GET /api/twitter?accounts=@handle&topic=AI |
Analyze Twitter accounts |
- Connect your GitHub repo to Railway
- Railway auto-detects the
Procfile - Deploy!
- Connect your GitHub repo to Vercel
- Vercel auto-detects
vercel.json - Deploy!
The api/ folder becomes serverless endpoints:
/api/polymarket/api/twitter
- Polymarket: Gamma API (
https://gamma-api.polymarket.com) - Twitter/X: FinChat COT API
- Stock Prices: Alpha Vantage (via MCP)
See examples/ folder for analysis scripts:
googl_distribution.py- GOOGL price probability analysis from Polymarket data
MIT