Retrieve the Latest and Recent Market Activity for Prediction Markets
This tutorial shows how to pull (a) the latest trade + quote snapshot and (b) recent trades + quotes for a specific prediction market using FinFeedAPI’s Prediction Markets REST API.
What you’ll build
By the end, you’ll be able to:
- Fetch the current/latest trade + quote
- Fetch recent trades and recent quotes (lists)
- Handle common cases like null activity and 404 market not found
Endpoints used:
GET /v1/activity/:exchange_id/:market_id/current→ current trade + current quote (either may be null)GET /v1/activity/:exchange_id/:market_id/latest→ recent trades + recent quotes (lists may be empty)
Base host (REST):
https://api.prediction-markets.finfeedapi.com
What you need before you start
- ✅ A FinFeedAPI API Key
- ✅ Any HTTP client:
- Terminal (
curl) - Postman / Insomnia
- Browser (for simple GET requests)
- Terminal (
- ✅ Completed the following tutorials:
🔐 Step 1 — Add authentication to your request
- Put API key in the query string:
?apikey=YOUR_API_KEYor, - Put API key in the Authorization header:
Authorization: API Key YOUR_API_KEY
Example header:
Example query string:
🧭 Step 2 — Choose exchange_id and market_id
Both endpoints require:
exchange_id(string)market_id(string)
If your system already knows the market you want, you can proceed. Otherwise, you’d typically discover these via the Markets endpoints (covered in a separate tutorial).
⚡ Step 3 — Get the latest trade and latest quote (snapshot)
Endpoint
What it returns
A single object containing:
trade: latest trade (ornull)quote: latest quote (ornull)
Trade fields include price, quantity, timestamp, outcome, and side (Buy/Sell).
Quote fields include entry_time, recv_time, ask, bid, ask_volume, bid_volume.
When to use /current
Use it when you want a fast “now” view:
- last print + current top-of-book
- quick UI refresh
- lightweight monitoring/alert checks
🧾 Step 4 — Get recent trades and recent quotes (lists)
Endpoint
What it returns
trades: array (may be empty)quotes: array (may be empty)
Each trade item has the same shape as in /current.
Each quote item includes entry_time, recv_time, ask, bid, ask_volume, bid_volume.
When to use /latest
Use it when you want a short rolling window of activity:
- mini tape (recent trades)
- recent quote updates for spread/liquidity changes
- “what just happened?” context around a move
🧠 Step 5 — Handle common responses safely
200 OK with “no activity”
/current:tradeand/orquotecan benull/latest:trades/quotesarrays can be empty
Treat this as normal: it can happen when a market is inactive or newly listed.
404 Not Found
Both endpoints can return 404 (e.g., market not found / no activity).
If you see 404:
- verify
exchange_idspelling/case - verify
market_idexists on that exchange - confirm the market hasn’t been retired/renamed on the upstream venue
🎉 Wrap-up
You now have two clean building blocks for “right now” prediction markets:
/currentfor a snapshot of the latest trade + quote/latestfor short rolling lists of trades and quotes
