MoonDev APImoondev.com ↗
Access MoonDev's live crypto feeds via API: Hyperliquid positions near liquidation, fees leaderboard, PnL stats by address, and Polymarket sweep trades.
What is the MoonDev API?
The MoonDev API exposes 12 endpoints covering live Hyperliquid trading data, Polymarket market intelligence, and stream metadata from moondev.com. The positions_feed endpoint returns the top 50 longs and 50 shorts ranked by proximity to liquidation, with per-position fields including entry price, liquidation price, leverage, and PnL. The all_datastreams endpoint aggregates the major feeds in a single call, optionally scoped to a specific EVM address.
curl -X GET 'https://api.parse.bot/scraper/fc823bb7-01ea-4b22-b26c-dc8faacf37fc/positions_feed?api_key=moondevapi_qe' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace moondev-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: MoonDev crypto datastream SDK — bounded, re-runnable."""
from parse_apis.moondev_public_crypto_datastream_api import (
MoonDev, Period, AddressInvalid
)
client = MoonDev()
# Fetch the fees leaderboard and inspect the top trader.
leaderboard = client.feesleaderboards.get()
print(f"Leaderboard has {leaderboard.count} entries")
top_trader = leaderboard.leaderboard[0]
print(f"Top trader: {top_trader.address}, fees: {top_trader.total_fees_paid}")
# Get current positions feed — live longs/shorts near liquidation.
feed = client.positionsfeeds.get()
print(f"Feed updated: {feed.updated_at}, ws: {feed.ws_connected}")
for pos in feed.longs[:2]:
print(f" Long {pos.coin}: ${pos.value:,.0f} liq {pos.distance_pct}% away")
# Create a share code for the top trader's address, then view PnL.
try:
pnl = client.pnlviews.for_address(
address=top_trader.address, period=Period.PERP_ALL_TIME
)
print(f"PnL profitable: {pnl.statistics.is_profitable}, volume: {pnl.statistics.volume}")
except AddressInvalid as exc:
print(f"Invalid address: {exc.address}")
# Browse expiring Polymarket markets.
for market in client.polymarkets.expiring(limit=3):
print(f" Expiring: {market.title} in {market.hours_until:.1f}h")
# Stream schedule for today.
config = client.streamconfigs.get()
print(f"Stream: {config.headline} on {config.stream_date} at {config.stream_time_start}")
print("Exercised: feesleaderboards.get / positionsfeeds.get / pnlviews.for_address / polymarkets.expiring / streamconfigs.get")
Public aggregated positions feed showing the top 50 longs and 50 shorts by proximity to liquidation. Returns position details including entry price, liquidation price, leverage, PnL, and websocket connectivity status. Positions are sourced from Hyperliquid via MoonDev's real-time websocket connection.
| Param | Type | Description |
|---|---|---|
| api_key | string | API key for the MoonDev positions feed. |
{
"type": "object",
"fields": {
"longs": "array of long position objects",
"shorts": "array of short position objects",
"updated_at": "ISO datetime string of last feed update",
"ws_connected": "boolean websocket connection status",
"total_positions": "integer total positions in the feed",
"price_age_seconds": "float seconds since last price update"
},
"sample": {
"data": {
"longs": [
{
"pnl": -1948.95,
"coin": "xyz:DRAM",
"size": 1923,
"value": 112495.5,
"address": "REDACTED_SECRET",
"leverage": 20,
"liq_price": 57.91,
"entry_price": 59.51,
"distance_pct": 0.9,
"current_price": 58.44
}
],
"shorts": [
{
"pnl": -1595.58,
"coin": "BTC",
"size": -1.60293,
"value": 99622.1,
"address": "REDACTED_SECRET",
"leverage": 30,
"liq_price": 62438.89,
"entry_price": 61154.5,
"distance_pct": 0.51,
"current_price": 62119.5
}
],
"updated_at": "2026-06-11T02:16:25.247740+00:00",
"ws_connected": true,
"total_positions": 4284,
"price_age_seconds": 0.62
},
"status": "success"
}
}About the MoonDev API
Hyperliquid Positions and PnL
The positions_feed endpoint returns up to 100 positions total — 50 longs and 50 shorts — ranked by how close each is to liquidation on Hyperliquid. Each position object includes entry price, liquidation price, leverage, current PnL, and feed freshness indicators (ws_connected, price_age_seconds, updated_at). To narrow the feed to a single trader, positions_by_address accepts an EVM address (address) and returns only the matching positions from that same feed window. Addresses with no entries in the top 100 return empty arrays.
PnL Share Codes and Statistics
PnL data is organized around share codes. hl_share_create accepts an EVM address and returns a share_code (plus existing_code if one was already registered). hl_share_view takes that code and a period selector to return chart_data (arrays of timestamp, account value, and PnL), a statistics block with current_value, total_pnl, volume, and is_profitable, plus views, data_points, and available_periods. If you want both steps in one call, pnl_for_address accepts an address and period directly, creates or reuses the share code internally, and returns the full stats response with share_code included.
Fees Leaderboard and Polymarket Feeds
fees_leaderboard returns the top 25 Hyperliquid addresses by fees paid, with per-entry fields covering total_trades, total_volume, total_fees_paid, bot_fees, savings, and patience_savings — no input parameters needed. The polymarket_sweeps endpoint returns recent large sweep trades with market details, USD amounts, outcomes, and trader info; polymarket_expiring returns markets sorted by time remaining, with slug, title, end_time (Unix timestamp), volume, and hours_until fields. Both Polymarket endpoints accept a limit parameter; passing 0 returns all available items.
Aggregate and Utility Endpoints
all_datastreams is a one-shot aggregator that calls fees leaderboard, positions feed, Polymarket sweeps/expiring, stream config, clips check, and data status in a single request. When an address is provided, it also fetches pnl_for_address and positions_by_address results. Optional boolean flags (include_positions, include_clips, include_stream) control which sub-streams are included, and any stream that fails is captured in an errors object rather than failing the whole response. data_status returns last-updated timestamps and file sizes for the liquidations and open-interest premium datasets without downloading any files.
The MoonDev API is a managed, monitored endpoint for moondev.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when moondev.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official moondev.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Monitor which Hyperliquid positions are closest to liquidation across longs and shorts in real time.
- Look up a specific trader's open positions and PnL history by EVM address using
positions_by_addressandpnl_for_address. - Build a fees analytics dashboard using the
fees_leaderboardfields: total_fees_paid, bot_fees, savings, and patience_savings. - Detect large Polymarket sweep trades and surface them alongside the originating market details.
- Alert on Polymarket markets expiring within a configurable hours_until threshold from the
polymarket_expiringfeed. - Pull all major MoonDev datastreams in a single API call via
all_datastreams, scoped to an address if needed. - Check freshness of MoonDev's liquidations and open-interest datasets before deciding whether to trigger a download.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does MoonDev have an official developer API?+
What does `positions_feed` actually return, and how fresh is the data?+
price_age_seconds and ws_connected fields so you can assess data freshness directly from the payload.Does the API expose historical Hyperliquid trade history or order data beyond PnL chart series?+
hl_share_view and pnl_for_address), current open positions, and the fees leaderboard. Individual trade history, order books, and fill-level data are not included. You can fork this API on Parse and revise it to add endpoints covering those data shapes.Can I retrieve Polymarket sweep data for a specific market or outcome rather than the full feed?+
polymarket_sweeps returns a flat list of recent sweeps across all markets; filtering by market slug or outcome is not a supported parameter. The limit param controls result count only. You can fork the API on Parse and revise it to add market-level filtering logic.What happens in `all_datastreams` if one sub-stream fails?+
errors object keyed by stream name, while successfully fetched streams appear normally in the streams object. The endpoint returns a timestamp_ms for the whole response regardless of partial failures, so callers can handle degraded results without the entire call failing.