Skip to content

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Macro Scenario Analysis API

Classify ISM Manufacturing PMI releases into actionable trading scenarios. GOLDILOCKS · MODERATE · SOFT_LANDING · CONTRACTION · AMBIGUOUS

Live Site

Landing page: https://473185670.github.io/macro-scenario-api/

Live API (Render, warm 24/7): https://macro-scenario-api.onrender.com

RapidAPI: https://rapidapi.com/category/Finance

Free Strategy Guides (6-page SEO cluster)

Guide URL
Hub — All Guides https://473185670.github.io/macro-scenario-api/macro-trading-guides.html
ISM PMI Trading Strategy https://473185670.github.io/macro-scenario-api/ism-pmi-trading-strategy.html
Macro Trading Journal Template https://473185670.github.io/macro-scenario-api/macro-trading-journal-template.html
Goldilocks Economy Trading https://473185670.github.io/macro-scenario-api/goldilocks-economy-trading.html
Contraction Trading Strategy https://473185670.github.io/macro-scenario-api/contraction-trading-strategy.html
Soft Landing Trade https://473185670.github.io/macro-scenario-api/soft-landing-trade.html
Backtest Simulator https://473185670.github.io/macro-scenario-api/macro-scenario-backtest.html

Products


Why this API exists

Why this API exists

Every month, the ISM Manufacturing PMI release moves markets. Traders manually read the headline, new-orders, and prices-paid numbers, then mentally bucket them into "risk-on" vs "risk-off" and decide what to do. This API automates that:

  • Input: 3 numbers (headline, new_orders, prices_paid — all 0-100)
  • Output: scenario classification, confidence score, sector-by-sector guidance, and a machine-readable list of trading actions.

No market-data dependencies. Pure logic. ~5ms per call.


Endpoints

POST /classify_scenario

Request body:

{
  "headline": 55.6,
  "new_orders": 54.2,
  "prices_paid": 71.1
}

Response:

{
  "scenario": "GOLDILOCKS — Strong Growth, No Overheat",
  "scenario_code": "GOLDILOCKS",
  "bias": "RISK-ON",
  "confidence": 85,
  "confidence_breakdown": {"headline_strength": 40, "new_orders_strength": 30, "alignment": 15},
  "equity": "BUY dip. Cyclical rotation into Industrials, Materials, Small Caps.",
  "rates": "US10Y likely tests 4.80%+. Duration short.",
  "crypto": "BTC benefits from risk-on. Target $66k+.",
  "crdo": "Structural bid reinforced. Target $210-230.",
  "actions": [
    {"asset": "SPY/Equities", "direction": "BUY", "note": "...", "priority": "HIGH"},
    {"asset": "US10Y", "direction": "SHORT_DURATION", "note": "...", "priority": "MEDIUM"},
    {"asset": "BTC", "direction": "BUY", "note": "...", "priority": "MEDIUM"},
    {"asset": "CRDO", "direction": "BUY", "note": "...", "priority": "HIGH"}
  ],
  "inputs": {"headline": 55.6, "new_orders": 54.2, "prices_paid": 71.1},
  "surprise": {"headline_surprise": 1.1, "new_orders_surprise": 1.2, "prices_paid_surprise": 15.1, "label": "BEAT"}
}

POST /ism_report

Same input, returns a full Markdown report:

{"report": "# ISM Manufacturing PMI Reaction Report\n..."}

GET /health

{"status": "ok", "version": "1.0.0"}

Scenario Logic

Condition Scenario Bias Confidence
headline ≥ 55 AND new_orders ≥ 54 GOLDILOCKS RISK-ON 85%
headline ≥ 52 AND new_orders ≥ 50 MODERATE NEUTRAL-SLIGHT-RISK-ON 70%
headline ≥ 50 AND new_orders < 50 SOFT_LANDING CAUTIOUS 65%
headline < 50 CONTRACTION RISK-OFF 90%
otherwise AMBIGUOUS HOLD 40%

Consensus: headline 54.5, new_orders 53.0, prices_paid 56.0. Surprise label: BEAT if > +0.3, MISS if < −0.3, else IN-LINE.


Local Development

cd products/rapidapi_macro_scenario
pip install -r requirements.txt

# Run tests (no pytest needed)
python test_engine.py

# Start server
uvicorn main:app --reload --port 8000
# Open http://localhost:8000/docs  (Swagger UI)

Deploy to Render.com (free tier)

  1. Push this directory to a GitHub repo (or the whole Arbitrage repo).
  2. Go to https://render.com → New → Web Service → connect repo.
  3. Render auto-detects render.yaml. Confirm and deploy.
  4. Your API lives at https://macro-scenario-analysis-api.onrender.com.
  5. Set RAPIDAPI_PROXY_SECRET env var (optional, for gateway auth).

Free tier: 750 hours/month, sleeps after 15min idle. Sufficient for API testing. For production, upgrade to Starter ($7/mo) — no sleep, always-on.


Register on RapidAPI

  1. Go to https://rapidapi.com → Sign in → "Add API".
  2. API Name: Macro Scenario Analysis
  3. Base URL: your Render URL (e.g. https://macro-scenario-analysis-api.onrender.com)
  4. Endpoints to expose:
    • POST /classify_scenario — "Classify ISM PMI into trading scenario"
    • POST /ism_report — "Full ISM reaction report (Markdown)"
    • GET /health — "Health check"
  5. Pricing:
    • Free tier: 100 requests/month
    • Pro: $0.01 per request above free tier
    • Mega: $20/month for 5,000 requests
  6. Categories: Finance, Data, Machine Learning
  7. Publish. RapidAPI handles billing, rate-limiting, and key management.

RapidAPI Listing Copy (paste into the listing form)

Short description (≤100 chars):

Classify ISM Manufacturing PMI releases into trading scenarios with confidence scores.

Long description:

Every month, the ISM Manufacturing PMI release moves global markets. This API
classifies the release into one of five trading scenarios — GOLDILOCKS, MODERATE
EXPANSION, SOFT LANDING RISK, CONTRACTION, or AMBIGUOUS — and returns:

- Scenario code + human-readable name
- Risk bias (RISK-ON / NEUTRAL / CAUTIOUS / RISK-OFF)
- Confidence score (0-100) with breakdown
- Sector-by-sector guidance (equities, rates, crypto, AI interconnect)
- Machine-readable trading actions list (asset, direction, priority, note)
- Consensus surprise computation (BEAT / MISS / IN-LINE)

Pure logic, no external data calls — sub-10ms response. Perfect for:
- Automated trading signal generation
- Macro research dashboards
- Backtesting ISM-reaction strategies
- Embedding in Discord/Slack/Telegram trading bots

Input: three ISM indices (headline, new_orders, prices_paid), each 0-100.
Output: full scenario analysis JSON or Markdown report.

Tags: ism, pmi, macro, trading, scenario, manufacturing, finance


Files

File Purpose
scenario_engine.py Core classification logic (no deps, reusable)
main.py FastAPI app with 3 endpoints
test_engine.py 19 unit tests (run without pytest)
requirements.txt Python deps
render.yaml Render.com deploy config
README.md This file

Revenue Model

  • Price: $0.01/call (free tier: 100 calls/mo)
  • Marketplace: RapidAPI (3M+ developers)
  • Maintenance: ~zero (pure logic, no data deps to break)
  • Projected: 500 visitors/mo × 10% active × ~100 calls = ~$50/mo

Built by Macro Edge Bot — Revenue Pipeline Node 💳 SOL: DiXt5GSxLW47szTATVGyF3vsj9g8YTGBQJj4BrQUST2y

About

ISM Macro Scenario Classification API - RapidAPI Provider

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages