Vestige API alternative: moving to the Haystack API
Published by Haystack
Vestige Labs announced on November 14, 2026 that the Vestige API (api.vestigelabs.org) and Vestige's swap aggregator go offline on December 31, 2026. Anything that reads Algorand prices, charts or pools from Vestige, or routes swaps through it, needs a replacement before then.
Haystack covers both halves:
- The Haystack API (
https://api.hay.app/api) serves the market data behind hay.app: assets and prices, price candles, pools, trades and liquidity, and live updates over a WebSocket. - The Haystack Router (
https://hayrouter.txnlab.dev, or the @txnlab/haystack-router SDK) quotes and builds swaps routed across Tinyman, Pact, HumbleSwap, Algofi, Folks Finance, xALGO and tALGO, as one atomic transaction group.
You can start today with the free keys below. This guide maps each Vestige endpoint to its replacement. The Haystack developer docs have every field.
How do I get a Haystack API key?
Both APIs take a key in the X-API-Key header. Two free keys need no sign-up:
- Haystack API:
hay_pk_s5ltqlgh6i44npsb2m2qarpolc, for servers, scripts and apps. It gets half of each endpoint's base rate limit and 1,000 requests a day, per IP address. Browsers can't use it from your own site. - Haystack Router:
hay_pk_4zhj33wahuxfplteyif5xpcgnm, 30 requests a minute per IP address, from servers or browsers.
Vestige's free API advertised unlimited access, so check your traffic against these limits. For a website, higher limits or both APIs on one key, request your own key by email, with who you are, what you're building, the endpoints you'll call, where the calls come from and the traffic you expect.
What changes from the Vestige API?
- A key on every call. The Haystack API refuses a request without one (
401). - Mainnet only. There is no
network_id: Haystack serves Algorand mainnet. - ALGO and USD together. Where Vestige took a
denominating_asset_id, Haystack returns both:pricein ALGO andusdPricein USD, per whole token. Candles are in ALGO, with each candle'salgoUsdto convert. - Lists of IDs. Repeat the parameter:
?asset=0&asset=31566704. - Times. RFC 3339 (
2026-11-15T00:00:00Z) rather than Unix timestamps. - Paging. Lists page by cursor: pass
cursor.nextTokenback aspaginationToken, where Vestige took anoffset. - Units. Most Haystack API amounts are whole tokens. The router works in base units, as Vestige's swap endpoints did.
Which Haystack endpoint replaces each Vestige endpoint?
All Haystack API paths below are under https://api.hay.app/api.
Prices
Vestige's GET /assets/price becomes GET /assets/prices: the price of up to 100 assets per call, as { prices: [{ id, decimals, price, usdPrice, priceConfidence }] }. Assets with no price are left out, so match results by id. priceConfidence (0 to 1) says how deep the pools behind the price are.
curl -H "X-API-Key: hay_pk_s5ltqlgh6i44npsb2m2qarpolc" \
"https://api.hay.app/api/assets/prices?asset=0&asset=31566704"For prices as they change, use the WebSocket below rather than polling.
Assets, lists and search
GET /assets(by ID) becomesGET /assets?asset=<id>, up to 10 per call. Each asset has its name, unit name, decimals, creator and logo, its price, its verification tier (Pera's) andmktData: price changes over 5 minutes, 1 hour, 24 hours, 7 days and 30 days, 24-hour volume, market cap, liquidity (tvl), supply and holders.GET /assets/listbecomesGET /assetswithsortBy(tvl,volume,mcap,chg1h,chg24h,chg7d,chg30dorcreation),orderandlimit(up to 100), paged by cursor.filter=verifiedkeeps verified assets only. Vestige's range filters (tvl__gtand the like) have no equivalent: filter each page yourself.GET /assets/searchbecomesGET /assets?q=<name or ID>, 3 to 20 characters.- A token's description and social links:
GET /assets/details?asset=<id>. - Vestige's trending and top gainers lists:
GET /assets/trending(up to 40, by 24-hour volume) andGET /assets/movers(the biggest gainers and losers, up to 20 each).
Candles
GET /assets/{asset_id}/candles becomes GET /getChart, with asset, start, end and a granularity of 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d or 7d. Each candle has open, high, low and close in ALGO, algoUsd, usdVol (USD volume) and vol (volume in the token). A range may hold up to 1,500 candles, and may always be 31 days.
curl -H "X-API-Key: hay_pk_s5ltqlgh6i44npsb2m2qarpolc" \
"https://api.hay.app/api/getChart?asset=31566704&start=2026-11-01T00:00:00Z&end=2026-11-15T00:00:00Z&granularity=1h"GET /assets/{asset_id}/history has no direct equivalent: the candles' usdVol and vol give the volume, and there is no VWAP or liquidity history.
Pools
GET /pools becomes GET /pools?asset=<id>: every pool holding the asset with more than 1 ALGO of liquidity, deepest first, with its protocol, app ID, fee, both assets, reserves and liquidity in microALGO. Vestige filtered by both assets: here, filter the list by asset2Id. Add conversion=true for the Folks Finance lending pool or the xALGO or tALGO contract that mints the asset. Vestige's GET /assets/{asset_id}/composition is the same list summed by protocol.
Trades
GET /swapsbecomesGET /assets/activity?asset=<id>&kinds=trade, newest first, up to 250 a page. It takesaccountfor one wallet's trades,type(buyorsell),minUsd, andstartandend. Each trade has the account, the amount, the price in ALGO and USD and its USD value. It always takes an asset: there is no feed of one wallet's trades across every asset.GET /marks, a wallet's trades on a chart, is the same call withaccountand the chart'sstartandend.- Liquidity adds and removes in the asset's pools come from the same endpoint with
kinds=liquidity.
Wallets
GET /wallets/{address}/pnlbecomesGET /account/buySellTotals?account=<address>, optionally withasset: what the wallet bought and sold of each asset, in USD and in ALGO at trade time. Its profit is what it sold for plus what it still holds at today's price, less what it paid.GET /wallets/{address}/valueandGET /balanceshave no Haystack endpoint. Read the wallet's holdings from an Algorand node (/v2/accounts/{address}) and price them with/assets/prices. Tokens bought on a HayLaunch bonding curve stay in the HayLaunch app until they graduate: addGET /account/{address}/hayLaunchHoldings.
Not carried over
/networks, /protocols, /protocols/volume, /notes, /vaults and /usage have no Haystack equivalent.
How do live prices work?
The Vestige API had no streaming. Haystack's WebSocket, wss://api.hay.app/api/wsLiveData, sends price changes and every trade for up to 40 assets as they happen, and each one's market data about once a minute. A server sends its key in the X-API-Key header, and a browser passes a publishable key as the apiKey query parameter. Send a watch command to start:
{ "requestId": "req-1", "command": { "type": "watch", "value": { "asset": ["31566704", "0"] } } }How do I replace Vestige's swap aggregator?
Vestige took two calls: GET /swap/v4 for the route and POST /swap/v4/transactions for its transactions. The Haystack Router takes two as well:
GET /api/fetchQuotewithfromASAID,toASAID,amount(in base units) andtype:fixed-inputwhen the amount is what you pay,fixed-outputwhen it's what you receive. It returns the quote and an opaquetxnPayload.POST /api/fetchExecuteSwapTxnswith the swapper'saddress, the quote'stxnPayload(astxnPayloadJSON) andslippagein percent. It returns the transaction group for the swapper to sign and submit.
curl -H "X-API-Key: hay_pk_4zhj33wahuxfplteyif5xpcgnm" \
"https://hayrouter.txnlab.dev/api/fetchQuote?fromASAID=0&toASAID=31566704&amount=100000000&type=fixed-input"In JavaScript or TypeScript, the SDK wraps both calls, signs and submits:
npm install @txnlab/haystack-router algosdkimport { RouterClient } from '@txnlab/haystack-router'
const router = new RouterClient({ apiKey: 'hay_pk_4zhj33wahuxfplteyif5xpcgnm' })
// activeAddress and transactionSigner come from your wallet connection, such as use-wallet
const quote = await router.newQuote({
fromASAID: 0, // ALGO
toASAID: 31566704, // USDC
amount: 1_000_000, // 1 ALGO, in base units
address: activeAddress,
})
const swap = await router.newSwap({ quote, address: activeAddress, signer: transactionSigner, slippage: 1 })
const result = await swap.execute()Before you ship:
- Don't quote to show prices. A quote searches routes for one exact trade, so it is slow and uses up the rate limit. Prices come from
/api/assets/pricesor the WebSocket. - Fees. The router charges
feeBpson the output, 10 (0.10%) by default and at the least. Register a referrer address with the referral program and pass it asreferrerAddress, and that address earns 25% of your swaps' fees. - Opt-ins. Pass
optIn=trueand the group includes the swapper's opt-in to the token they receive. - Post-quantum accounts. For an account that signs with a Falcon key (Pera and Lute quantum accounts, and Haystack Login's passkey accounts), pass
signerType=falconso the group's fees cover its larger signatures. - Busy router. When the router can't quote in time,
fetchQuoteanswers503withRetry-After: 1. Retry after that second.
Frequently asked questions
Is the Haystack API free?
There's a free key for each API: 1,000 Haystack API requests a day per IP address, and 30 router requests a minute per IP address. Higher limits come with a key of your own.
Does the Haystack API support testnet?
No. The Haystack API and the Haystack Router serve Algorand mainnet only.
Can I call the Haystack API from a web page?
Yes, with a publishable browser key registered for your site's origins. The free Haystack API key works only from servers, scripts and apps. The router's free key works from browsers too.
Which exchanges does the Haystack Router route through?
Tinyman, Pact (including its stableswap, V2 and concentrated liquidity pools), HumbleSwap, Algofi, Folks Finance, xALGO and tALGO, and tokens still on a HayLaunch bonding curve. It splits a trade across pools and through intermediate tokens when that returns more, in one atomic transaction group.
Where is the full reference?
The Haystack developer docs explain every endpoint, and the OpenAPI specification lists every field.