Everything the site does, from your own code: test a video, a typed idea or a script, read the verdict and every trade, price it at your broker, and paper-trade it with alerts to your webhook. A key acts as you: same plan, same allowances.
Send the key as a bearer token. 120 requests a minute per key.
Test a video
curl -X POST https://strategygrade.com/api/runs \
-H "Authorization: Bearer sg_your_key" -H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=..."}'Test your own rules, a Pine script or strategy code (ChatGPT's, backtrader, MQL5…)
curl -X POST https://strategygrade.com/api/runs/idea \
-H "Authorization: Bearer sg_your_key" -H "Content-Type: application/json" \
-d '{"kind": "code", "market": "EURUSD", "timeframe": "1h", "text": "<your code>"}'Wait for the verdict, then take everything
import time, requests
H = {"Authorization": "Bearer sg_your_key"}
run = requests.post("https://strategygrade.com/api/runs", json={"url": "https://youtu.be/..."}, headers=H).json()
while run["status"] not in ("done", "untestable", "failed"):
time.sleep(10); run = requests.get(f"https://strategygrade.com/api/runs/{run['id']}", headers=H).json()
print(run["verdict"]["code"], run["verdict"]["mean_bp"], run["rules"])
trades_csv = requests.get(f"https://strategygrade.com/api/runs/{run['id']}/trades.csv", headers=H).text
rules = requests.get(f"https://strategygrade.com/api/runs/{run['id']}/rules.json", headers=H).json()
brokers = requests.get(f"https://strategygrade.com/api/runs/{run['id']}/brokers", headers=H).json() # cheapest venue first| POST /api/runs | test a video link (YouTube, TikTok, X, Instagram, Reddit) |
| POST /api/runs/idea | test typed rules, a Pine script or strategy code; market and timeframe optional |
| GET /api/runs/{id} | status, verdict, rules in plain English |
| GET /api/runs/{id}/trades.csv | every simulated trade |
| GET /api/runs/{id}/rules.json | the exact rule spec that was simulated |
| GET /api/runs/{id}/eras | year by year |
| GET /api/runs/{id}/equity-monthly | the account curve at month ends |
| GET /api/runs/{id}/brokers | the same trades at every venue's own fees |
| GET /api/runs/{id}/prop | prop-firm pass and payout odds |
| GET /api/runs/{id}/pine?kind=strategy | TradingView Pine v6 |
| GET /api/runs/public | the public library |
| POST /api/paper | paper-trade a report: {"run_id": ...} |
| GET /api/paper/{id} | paper ledger, open position, pending signal |
| PUT /api/paper/channels | your webhook for alerts: {"webhook_url": "https://..."} |
Paper-trading alerts POST JSON to your URL: event.kind is signal, opened, closed or drift. Each request is signed with your webhook secret (on Paper trading); check it before you act on anything:
import hmac, hashlib
def is_from_strategygrade(secret: str, body: bytes, header: str) -> bool:
want = "sha256=" + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
return hmac.compare_digest(want, header) # header = X-StrategyGrade-SignatureResults are hypothetical backtests and paper trades for education. Nothing here is trading advice, and nothing is traded for you.