Skip to content

Trading Markets API

Real-time price data for traditional markets. 1,746 equities across 12 global exchanges with ~400ms oracle cadence. Plus 500+ crypto pairs, 30+ forex pairs, and commodities. $0.001/call across every endpoint.

Authentication

Both methods are supported — all requests settle via x402 on-chain:

MethodHeaderDescription
API KeyAuthorization: Bearer sk-...Platform signs x402 from your HD wallet automatically
Private Key (x402)Automatic via SDKAgent signs x402 directly from its own wallet

See Agent Payments (x402) for full details on how both methods work.

Base URL

https://api.jarvisclaw.ai/v1/marketplace/markets

Pricing

Asset ClassPrice per Request
Every endpoint, any asset class$0.001/call

Crypto, FX and commodities are not free

Pricing is flat across the whole service, with no per-asset exception. Earlier docs described crypto, forex, and commodity reads as free — treat that as stale. Read price.amount on the response for the exact charge.

Coverage

Asset ClassCoverageUpdate Cadence
Equities1,746+ symbols across 12 exchanges~400ms
Crypto500+ trading pairsReal-time
Forex30+ currency pairsReal-time
CommoditiesGold, silver, oil, natural gas, and moreReal-time

Endpoints

MethodEndpointDescriptionPrice
GET/stocks/:market/price/:symbolStock price snapshot$0.001
GET/crypto/price/:pairCrypto price$0.001
GET/fx/price/:pairForex rate$0.001
GET/commodity/price/:symbolCommodity price$0.001

Stock Price

GET /v1/marketplace/markets/stocks/:market/price/:symbol

Get a real-time price snapshot for a stock on a specific exchange.

Path Parameters

ParameterTypeRequiredDescription
marketstringYesRegion code (e.g., us, gb, hk, jp)
symbolstringYesTicker symbol (e.g., AAPL, TSLA, NVDA)

Response

json
{
  "symbol": "AAPL",
  "category": "stocks/us",
  "price": 298.17143,
  "confidence": 0.14916,
  "publishTime": 1781812821,
  "timestamp": "2026-06-18T20:00:21.000Z",
  "assetType": "equity",
  "feedId": "0x49f6b65cb1de6b10eaf75e7c03ca029c306d0357e91b5311b175084a5ad55688",
  "source": "pyth"
}

Crypto Price

GET /v1/marketplace/markets/crypto/price/:pair

Get real-time price for a cryptocurrency trading pair.

Path Parameters

ParameterTypeRequiredDescription
pairstringYesTrading pair with dash separator (e.g., BTC-USD, ETH-USD, SOL-USD)

Response

json
{
  "symbol": "BTC-USD",
  "category": "crypto",
  "price": 63680.33,
  "confidence": 38.42,
  "publishTime": 1781957129,
  "timestamp": "2026-06-20T12:05:29.000Z",
  "assetType": "crypto",
  "feedId": "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
  "source": "pyth"
}

Forex Rate

GET /v1/marketplace/markets/fx/price/:pair

Get real-time foreign exchange rate.

Path Parameters

ParameterTypeRequiredDescription
pairstringYesCurrency pair with dash separator (e.g., EUR-USD, GBP-USD, USD-JPY)

Response

json
{
  "pair": "EUR-USD",
  "rate": 1.0847,
  "bid": 1.0846,
  "ask": 1.0848,
  "change_24h": -0.12,
  "timestamp": "2025-06-01T15:30:00Z"
}

Commodity Price

GET /v1/marketplace/markets/commodity/price/:symbol

Get real-time commodity price.

Path Parameters

ParameterTypeRequiredDescription
symbolstringYesCommodity symbol in Pyth feed format (e.g., XAU-USD, XAG-USD, WTI-USD, NATGAS-USD)

Response

json
{
  "symbol": "XAU-USD",
  "price": 2345.60,
  "unit": "USD/oz",
  "change_24h": 0.85,
  "timestamp": "2025-06-01T15:30:00Z"
}

Examples

bash
# Stock price (NVDA on US market) — $0.001
curl "https://api.jarvisclaw.ai/v1/marketplace/markets/stocks/us/price/NVDA" \
  -H "Authorization: Bearer sk-your-api-key"

# Crypto price — $0.001
curl "https://api.jarvisclaw.ai/v1/marketplace/markets/crypto/price/ETH-USD" \
  -H "Authorization: Bearer sk-your-api-key"

# Forex rate — $0.001
curl "https://api.jarvisclaw.ai/v1/marketplace/markets/fx/price/USD-JPY" \
  -H "Authorization: Bearer sk-your-api-key"

# Commodity price — $0.001
curl "https://api.jarvisclaw.ai/v1/marketplace/markets/commodity/price/WTI-USD" \
  -H "Authorization: Bearer sk-your-api-key"
python
import requests

BASE = "https://api.jarvisclaw.ai/v1/marketplace/markets"
HEADERS = {"Authorization": "Bearer sk-your-api-key"}

# Stock price — $0.001 per call
resp = requests.get(f"{BASE}/stocks/us/price/AAPL", headers=HEADERS)
aapl = resp.json()
print(f"AAPL: ${aapl['price']} (source: {aapl['source']})")

# Crypto price — $0.001
resp = requests.get(f"{BASE}/crypto/price/BTC-USD", headers=HEADERS)
btc = resp.json()
print(f"BTC: ${btc['price']:,.2f} (source: {btc['source']})")

# Forex rate — $0.001
resp = requests.get(f"{BASE}/fx/price/EUR-USD", headers=HEADERS)
fx = resp.json()
print(f"EUR/USD: {fx['rate']} (bid: {fx['bid']}, ask: {fx['ask']})")

# Commodity price — $0.001
resp = requests.get(f"{BASE}/commodity/price/XAU-USD", headers=HEADERS)
gold = resp.json()
print(f"Gold: ${gold['price']}/{gold['unit'].split('/')[1]}")

# Multi-stock portfolio check
portfolio = ["AAPL", "NVDA", "TSLA", "MSFT", "GOOGL"]
for symbol in portfolio:
    resp = requests.get(f"{BASE}/stocks/us/price/{symbol}", headers=HEADERS)
    data = resp.json()
    print(f"  {data['symbol']}: ${data['price']} (confidence: {data['confidence']})")
python
from jarvisclaw import MarketplaceClient

# x402 agent — pays $0.001 per call with USDC automatically
client = MarketplaceClient(private_key="0x<agent-wallet-private-key>")

# Stock price (auto-pays $0.001 via x402)
aapl = client.call("markets", "/stocks/us/price/AAPL")
print(f"AAPL: ${aapl['price']}")

# Crypto — $0.001, settles over x402
btc = client.call("markets", "/crypto/price/BTC-USD")
print(f"BTC: ${btc['price']:,.2f}")

# Forex — $0.001
eur = client.call("markets", "/fx/price/EUR-USD")
print(f"EUR/USD: {eur['rate']}")

# Commodity — $0.001
gold = client.call("markets", "/commodity/price/XAU-USD")
print(f"Gold: ${gold['price']}/oz")

# Agent portfolio monitoring loop
import time
while True:
    nvda = client.call("markets", "/stocks/us/price/NVDA")
    if nvda["price"] > 150:
        print(f"NVDA alert: ${nvda['price']}")
        break
    time.sleep(60)
go
package main

import (
    "context"
    "fmt"

    jc "github.com/api-jarvisclaw/go-sdk/v2"
)

func main() {
    ctx := context.Background()
    mc, _ := jc.NewMarketplaceClient(jc.WithAPIKey("sk-your-api-key"))

    // Stock price
    stock, _ := mc.Call(ctx, "markets", "/stocks/us/price/NVDA")
    fmt.Printf("NVDA: $%.2f (confidence: %.5f)\n", stock["price"].(float64), stock["confidence"].(float64))

    // Crypto price — $0.001
    crypto, _ := mc.Call(ctx, "markets", "/crypto/price/BTC-USD")
    fmt.Printf("BTC-USD: $%.2f (source: %s)\n", crypto["price"].(float64), crypto["source"].(string))

    // Forex rate — $0.001
    fx, _ := mc.Call(ctx, "markets", "/fx/price/EUR-USD")
    fmt.Printf("EUR-USD: %.4f\n", fx["rate"].(float64))

    // Commodity price — $0.001
    commodity, _ := mc.Call(ctx, "markets", "/commodity/price/XAU-USD")
    fmt.Printf("Gold: $%.2f %s\n", commodity["price"].(float64), commodity["unit"].(string))
}
go
package main

import (
    "context"
    "fmt"
    "time"

    jc "github.com/api-jarvisclaw/go-sdk/v2"
)

func main() {
    ctx := context.Background()

    // x402 agent — auto-pays $0.001 per call with USDC
    mc, err := jc.NewMarketplaceClient(
        jc.WithPrivateKey("0x<agent-wallet-private-key>"),
    )
    if err != nil {
        panic(err)
    }

    // Stock price (x402 pays automatically)
    stock, _ := mc.Call(ctx, "markets", "/stocks/us/price/AAPL")
    fmt.Printf("AAPL: $%.2f\n", stock["price"].(float64))

    // Crypto — $0.001, settles over x402
    btc, _ := mc.Call(ctx, "markets", "/crypto/price/BTC-USD")
    fmt.Printf("BTC: $%.2f\n", btc["price"].(float64))

    // Agent price monitoring
    for {
        nvda, _ := mc.Call(ctx, "markets", "/stocks/us/price/NVDA")
        if nvda["price"].(float64) > 150 {
            fmt.Printf("NVDA alert: $%.2f\n", nvda["price"].(float64))
            break
        }
        time.Sleep(60 * time.Second)
    }
}

Supported Markets

CodeRegionNotable Symbols
usUnited StatesAAPL, NVDA, TSLA, MSFT, GOOGL, AMZN
gbUnited KingdomSHEL, AZN, HSBA, ULVR
deGermanySAP, SIE, ALV, BAS
frFranceMC, OR, SAN, AIR
nlNetherlandsASML, INGA, PHIA
ieIrelandCRH, KYGA, SKG
luLuxembourgARCE, SES, RTL
hkHong Kong0700, 9988, 0005, 1299
jpJapan7203, 6758, 9984, 6861
krSouth Korea005930, 000660, 035420
cnChina600519, 601318, 000858
caCanadaRY, TD, SHOP, ENB

Errors

Gateway-level errors use a flat shape — a single error string, no nested code:

json
{ "error": "service 'markets' is at capacity, please retry in a moment" }
HTTPMeaningResolution
401Missing or invalid API key / x402 signatureCheck Authorization, or let the SDK re-sign
402Settlement failed — wallet could not pay upstreamTop up the wallet, then retry
403Insufficient balanceTop up, or check your spend limits
404Unknown symbol, exchange code, or pathVerify against the supported-markets table
429Too many concurrent requestsBack off and retry
502Upstream price provider failedRetry; if persistent the provider is down
503Service temporarily unavailable, or exchange closedRetry later

Errors raised by the upstream price provider (unknown ticker, malformed pair, closed exchange) are passed through unchanged, so their shape is the provider's, not JarvisClaw's.


Limitations

  • Trading hours only — Stock prices are live during market hours; returns last closing price with 503 status when market is closed
  • No historical OHLC — Only current price snapshots; no candle data or historical time series
  • 12 exchanges only — Limited to the listed exchanges; other markets are not covered
  • ~400ms is not HFT — Oracle cadence is suitable for monitoring and display, not high-frequency trading strategies
  • Read-only — Price data only; no order placement, execution, or portfolio management
  • USD denomination — All prices are returned in USD unless the pair/exchange implies otherwise
  • Dash separator required — Pairs use dash format (BTC-USD, EUR-USD), not slash (BTC/USD)
  • No pre/post-market — Only regular trading session data for equities
  • Concurrency cap — heavy parallel use can return a 429; back off and retry