A market-watching bot does one job well: it pulls fresh market data on a schedule, checks it against a rule you define, and tells you when something worth noticing happens. It never places an order. That distinction matters here, because this guide is built on the Elgon API — a read-only market-data service. Elgon returns quotes and reference data; it cannot place, route, or cancel trades. Anything actionable happens in your own broker, by you.
This is a good thing for a first bot. You remove the riskiest component — order execution — and focus on the part that actually decides whether a bot is useful: reliable data and a signal you trust. Once your alerts are solid, wiring them into a broker is a separate, deliberate step you take with your eyes open.
In this guide you will fetch live (delayed) quotes from Elgon with a plain HTTP GET, poll them on an interval, compute a simple moving-average crossover, and log an alert when the signal flips. Everything runs against the public sandbox key elgon_sandbox_pub, so you can copy, paste, and run without signing up.
What a market-watching bot needs from a data API
Strip a market bot down to its data layer and you need three things: quotes you can trust, a way to pull them on a schedule, and enough history in memory to compute a signal. Here is how Elgon covers each.
Quotes (real, delayed)
The /quotes endpoint returns the last price, bid, ask, change, and volume for one or more symbols in a single request. This data is real — sourced from live markets — but delayed, not real-time. It is tagged "source":"live" in the response. Delayed quotes are fine for a market-watching bot that polls every few seconds and reacts on the scale of minutes; they are not suitable for latency-sensitive execution, and Elgon does not pretend otherwise.
Instruments (real, delayed)
The /instruments endpoint resolves a search term into symbols — useful when you want your bot to confirm a ticker before it starts polling. It is also "source":"live".
Options and predictions (simulated sandbox)
Elgon also exposes /options and /predictions, but both return simulated sample data tagged "source":"sandbox". They are great for building and testing your plumbing, but do not build trading signals on them and do not report their numbers as real. For a price-driven market-watching bot you will use /quotes.
The endpoint you will call
Every Elgon endpoint is a plain GET that returns JSON and sends permissive CORS headers, so you can call it from a server, a script, or the browser. Authenticate with the sandbox key as a query parameter or a bearer token. Start with one request:
curl "https://elgonrpc.xyz/api/v1/quotes?symbols=AAPL,MSFT,SPY&key=elgon_sandbox_pub"
The response wraps the quotes in a data array, along with a source flag and a signed receipt you can verify later:
{
"data": [
{ "symbol": "AAPL", "price": 333.74, "bid": 333.71, "ask": 333.77, "change": 0.48, "volume": 63407059, "asOf": "2026-07-19T21:25:16.131Z" }
],
"source": "live",
"plan": "free",
"receipt": { "alg": "sha256", "hash": "560c86c5…4df7b", "endpoint": "/api/v1/quotes" }
}
Step 1: Fetch a single price
The whole data layer is a fetch call. No SDK to install, no GraphQL schema to learn — just an HTTP request. Here it is in JavaScript (works in Node 18+ and in the browser):
const res = await fetch(
"https://elgonrpc.xyz/api/v1/quotes?symbols=AAPL&key=elgon_sandbox_pub"
);
const { data, source } = await res.json();
console.log(source); // "live" — real quotes, delayed (not real-time)
console.log(data[0].price); // e.g. 333.74
The same call in Python with requests:
import requests
URL = "https://elgonrpc.xyz/api/v1/quotes"
r = requests.get(URL, params={"symbols": "AAPL", "key": "elgon_sandbox_pub"})
quote = r.json()["data"][0]
print(quote["symbol"], quote["price"])
Step 2: Poll on an interval
A market-watching bot is a loop: fetch, evaluate, wait, repeat. Pick an interval that respects Elgon's rate limit — the free tier allows 60 requests per minute, so polling one symbol every 15 seconds (4 requests/min) leaves plenty of headroom. The Growth plan raises the limit to 600 requests/min if you need to watch many symbols at once.
const SYMBOL = "AAPL";
const INTERVAL_MS = 15000; // 4 requests/min — well under the 60/min free limit
async function fetchPrice(symbol) {
const res = await fetch(
`https://elgonrpc.xyz/api/v1/quotes?symbols=${symbol}&key=elgon_sandbox_pub`
);
const { data } = await res.json();
return data[0].price;
}
setInterval(async () => {
const price = await fetchPrice(SYMBOL);
console.log(new Date().toISOString(), SYMBOL, price);
}, INTERVAL_MS);
Step 3: Compute a signal (moving-average crossover)
The classic starter signal is a moving-average crossover: keep a short-window average and a long-window average of recent prices, and treat the moment the short crosses the long as a change in trend. Keep the recent prices in an array and recompute on every tick.
const prices = [];
const SHORT = 5;
const LONG = 20;
function sma(values, n) {
if (values.length < n) return null;
const slice = values.slice(-n);
return slice.reduce((a, b) => a + b, 0) / n;
}
function signalFor(price) {
prices.push(price);
const shortMa = sma(prices, SHORT);
const longMa = sma(prices, LONG);
if (shortMa === null || longMa === null) return null; // not enough data yet
return shortMa > longMa ? "bullish" : "bearish";
}
Because Elgon quotes are delayed, treat the crossover as a heads-up on the minute-to-hour scale, not a millisecond trigger. That is the honest envelope for delayed data, and it is plenty for a watch-and-alert bot.
Step 4: Log the alert (and stop there)
The final step is to fire an alert only when the signal actually flips, so you are not spammed on every tick. This is where the bot ends. Elgon is a market-data API: it returns quotes only and cannot place, route, or cancel orders. The alert is a notification for you — act on it yourself, in your own broker, if you choose to.
let lastSignal = null;
async function tick() {
const price = await fetchPrice(SYMBOL);
const signal = signalFor(price);
if (signal && signal !== lastSignal) {
console.log(`ALERT: ${SYMBOL} turned ${signal} at ${price}`);
// Notify yourself here — email, Slack, a webhook you own.
// Elgon does not and cannot execute trades.
lastSignal = signal;
}
}
setInterval(tick, INTERVAL_MS);
Swap the console.log for whatever notification channel you prefer. Because the whole thing is read-only, you can run it continuously without any risk of it moving money.
Rate limits and plans
Elgon's plans are simple. The free tier is self-serve — mint a key with a single POST /api/keys request or from the dashboard — and allows 60 requests per minute at no cost. The Growth plan is $350/month via Stripe and raises the limit to 600 requests per minute. Enterprise limits are custom. For a bot watching a handful of symbols on a 15-second poll, the free tier is more than enough.
Common pitfalls
Treating delayed quotes as real-time. Elgon quotes are real but delayed. Size your poll interval and your signal windows to that reality instead of expecting sub-second precision.
Ignoring the rate limit. At 60 requests/min on the free tier, batch multiple symbols into one ?symbols=A,B,C call rather than firing one request per symbol per tick.
Expecting the API to trade. Elgon has no order endpoint. If your design assumes the data provider will also execute, redesign: data and execution are separate systems, and Elgon is only the first.
Building signals on sandbox data. The /options and /predictions endpoints are simulated. Keep price-driven logic on /quotes.
FAQ
Can the Elgon API place trades for my bot?
No. Elgon is a read-only market-data API. It returns quotes, instruments, and reference data. It has no endpoint to place, route, or cancel an order. A bot built on Elgon watches the market and alerts you; execution is entirely separate.
Is the quote data real-time?
The quotes are real market data but delayed, tagged "source":"live". That is well suited to a market-watching bot that reacts over minutes. It is not intended for latency-sensitive execution.
Do I need an SDK or GraphQL?
No. Every endpoint is a plain HTTP GET that returns JSON. You call it with fetch, curl, requests, or any HTTP client. There is no SDK to install and no GraphQL layer.
What does it cost?
Free to start: 60 requests/min on a self-serve key. Growth is $350/month for 600 requests/min via Stripe. Enterprise is custom.
Is Elgon affiliated with Robinhood?
No. Elgon is an independent project, not affiliated with Robinhood. It is a market-data API you call directly.
Ready to build? Get your API key and follow along with the code examples above.

