tRPC Asset Search API
tRPC Endpoints
tRPC Asset Search API
Public asset search procedure with geo-restriction context
POST
tRPC Asset Search API
The asset search procedure is available on the tRPC base endpoint:
- Base endpoint:
POST /v1/trpc - Procedure:
assets.searchForTokens - Auth: public
- Rate tier:
Tier2
- Procedure:
assets.searchForCommandPalette - Auth: public
- Rate tier:
Tier2 - Optional input:
includeAiSearch - Optional input:
aiSearchLimit - Optional input:
chainFilter— scopes generic token results to the given chain ids - Optional input:
stockChainFilter— scopes stock/Ondo ticker and name results to the given chain ids (independent ofchainFilter, so tokens still surface across every chain). A direct contract-address query opts out of this scope and lists the asset on every chain it exists on (including Ethereum L1). The webapp Search bar sends the user’s chain here — BNB (56) for EVM/Privy logins, Solana for SVM key logins — to keep Ethereum-L1 stocks out of default results.
includeAiSearch is true and platform-api is configured with Cloudflare AI
Search credentials, the response includes an additive aiSearchResults array.
These results are normalized command targets from Cloudflare AI Search chunks:
kind:asset,stock,portfolio,strategy,action,document, orunknowntitle,subtitle,descriptionhref: internal Glider path when the result is directly navigableassetId,chainId,tokenAddress,symbolwhen present in indexed metadatasourceInstanceId,sourceKey, andscorefor debugging/ranking visibility
asset-data-sync worker:
POST /api/command-palette/ai-search/enqueuePOST /api/command-palette/ai-search/sync
Response Notes
assets.searchForTokens returns additive restriction metadata alongside the search
results:
- optional input:
manualCountryCode- intended source:
system.ipDetection - behavior: evaluated in addition to the Cloudflare request country
- intended source:
restrictedAssetsMap: geoblocking result byassetIdrestrictionContext.countryCode: normalized country code used for restriction evaluationrestrictionContext.regionCode: normalized region code used for restriction evaluationrestrictionContext.manualCountryCode: normalized manual country code used for additive restriction checksrestrictionContext.cloudflare: normalized Cloudflare geo metadata used to derive the country and region contextrestrictionContext.ipDebug: raw IP-related request headers plus the derived client IP, country code, and region code used by the backend
restrictionContext.ipDebug
is returned specifically for support and debugging so callers can compare the raw
forwarded headers against the derived values the backend used. If manualCountryCode
is provided, the backend evaluates both countries and keeps the stricter restriction
result.
Cloudflare Geo Fields
restrictionContext.cloudflare includes:
citycontinentcountryCodelatitudelongitudemetroCodepostalCoderegionregionCodetimezone
IP Debug Fields
restrictionContext.ipDebug includes:
rawHeaders.cf-connecting-iprawHeaders.x-forwarded-forrawHeaders.x-real-iprawHeaders.cf-ipcountryrawHeaders.cf-region-coderawHeaders.cf-ipcityrawHeaders.cf-ipcontinentrawHeaders.cf-iplatituderawHeaders.cf-iplongituderawHeaders.cf-regionrawHeaders.cf-metro-coderawHeaders.cf-postal-coderawHeaders.cf-timezonederivedClientIpderivedCountryCodederivedRegionCode