### Install Velo Python SDK Source: https://docs.velo.xyz/sdks/python/getting-started Use pip to install the velodata library. ```bash pip install velodata ``` -------------------------------- ### Install Velo SDK with bun Source: https://docs.velo.xyz/sdks/typescript/getting-started Install the Velo SDK package using bun. ```bash bun add velo-sdk ``` -------------------------------- ### Install Velo SDK with pnpm Source: https://docs.velo.xyz/sdks/typescript/getting-started Install the Velo SDK package using pnpm. ```bash pnpm add velo-sdk ``` -------------------------------- ### Install Velo SDK with yarn Source: https://docs.velo.xyz/sdks/typescript/getting-started Install the Velo SDK package using yarn. ```bash yarn add velo-sdk ``` -------------------------------- ### Install Velo SDK with npm Source: https://docs.velo.xyz/sdks/typescript/getting-started Install the Velo SDK package using npm. ```bash npm install velo-sdk ``` -------------------------------- ### Basic Authentication Header Example Source: https://docs.velo.xyz/api/news Example command to generate the base64 encoded authorization string for HTTP basic auth. ```bash $(printf "api:your_api_key" | base64) ``` -------------------------------- ### Example CSV response for GET /api/v1/caps Source: https://docs.velo.xyz/api/data Example of the 200 response body, showing the CSV format with columns coin, time, circ, circ_dollars, fdv, and fdv_dollars. The data is sorted by circulating market cap descending. ```csv coin,time,circ,circ_dollars,fdv,fdv_dollars BTC,1783513513252,20053612,1248112746545.6,20053612,1248112746545.6 ETH,1783513513258,120683132.8744947,210719990986.8402,120683132.8744947,210719990986.8402 SOL,1783513513276,581831126.765334,45045365834.17216,629975180.6654124,48772678487.116234 ``` -------------------------------- ### Install Velo Node.js SDK Source: https://docs.velo.xyz/sdks/nodejs/getting-started Use npm to install the required velo-node package in your project. ```bash npm install velo-node ``` -------------------------------- ### 400 response example Source: https://docs.velo.xyz/api/data Example error response for an invalid request. Returns the string 'invalid '. ```text "invalid " ``` -------------------------------- ### Query with options.vega Source: https://docs.velo.xyz/sdks/typescript/api/options/vega Example of using options.vega to query coin metrics over a specific time range. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .vega({ metric: 'coin' }) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### 503 response example Source: https://docs.velo.xyz/api/data Example error response for temporary unavailability. Returns the string 'api temporarily unavailable'. ```text "api temporarily unavailable" ``` -------------------------------- ### .version Source: https://docs.velo.xyz/sdks/python/api/client Returns the SDK's hard-coded version string. Use this to check the installed SDK version. ```APIDOC ## .version ### Description Returns the SDK's hard-coded version string. ### Method .version ### Returns The SDK version string. ``` -------------------------------- ### Querying with premium options Source: https://docs.velo.xyz/sdks/typescript/api/options/premium Example of using the premium method to select the 'put' column in a query. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .premium(['put']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### MarketCap result example Source: https://docs.velo.xyz/sdks/typescript/guides/fetch-market-caps An example of the JSON structure returned by velo.query() when fetching market caps. ```json [ { "coin": "BTC", "time": 1783513513252, "circ": 20053612, "circ_dollars": 1248112746545.6, "fdv": 20053612, "fdv_dollars": 1248112746545.6 } ] ``` -------------------------------- ### Get client version Source: https://docs.velo.xyz/sdks/python/api/client/version Retrieves the version string from the client instance. ```python sdk_version = client.version() ``` -------------------------------- ### Query spot price with specific exchanges Source: https://docs.velo.xyz/sdks/typescript/api/spot/for Example of querying spot prices for BTC on Binance and Coinbase over a 1-day period. ```typescript import { Velo, spot } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( spot .price(['close']) .for({ exchanges: ['binance', 'coinbase'], coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); ``` -------------------------------- ### 200 response example Source: https://docs.velo.xyz/api/data Example CSV response for a successful request. Shows the format with headers and data rows. ```csv "exchange,coin,product,time,close_price\nbinance-futures,BTC,BTCUSDT,1767225600000,87824.6\nbinance-futures,ETH,ETHUSDT,1767225600000,2979.01\nbinance-futures,BTC,BTCUSDT,1767240000000,87603.7\nbinance-futures,ETH,ETHUSDT,1767240000000,2977.18\nbinance-futures,BTC,BTCUSDT,1767254400000,87980.1\nbinance-futures,ETH,ETHUSDT,1767254400000,2988\n" ``` -------------------------------- ### 429 response example Source: https://docs.velo.xyz/api/data Example error response for rate limit exceeded. Returns the string 'rate limited'. ```text "rate limited" ``` -------------------------------- ### Query Options Catalog Source: https://docs.velo.xyz/sdks/typescript/api/catalog/options Example of querying the options catalog filtered by coin and exchange. ```typescript import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const products = await velo.query( catalog.options({ coin: 'BTC', exchange: 'deribit', }), ); ``` -------------------------------- ### Query historical market caps Source: https://docs.velo.xyz/sdks/typescript/api/market-caps/history Example showing how to initialize the Velo client and query historical market-cap data for specific coins. ```typescript import { Velo, marketCaps } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const caps = await velo.query( marketCaps.history({ coins: ['BTC', 'ETH'] }), ); ``` -------------------------------- ### Query with volume options Source: https://docs.velo.xyz/sdks/typescript/api/options/volume Example of using the volume option to query call volume for BTC over a specific time range. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .volume(['call']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### Orderbook snapshot visualization Source: https://docs.velo.xyz/sdks/typescript/guides/fetch-orderbook-data An example representation of a snapshot for coin BTC, showing depth, price, and size for both bids and asks. ```text // Example snapshot for coin `BTC` asks bids ┌───────┬───────┬────────────┐┌───────┬───────┬────────────┐ │ depth │ price │ size ││ depth │ price │ size │ ├───────┼───────┼────────────┤├───────┼───────┼────────────┤ │ 1 │ 64710 │ 5771.51513 ││ 1 │ 64695 │ 4523.11767 │ │ 2 │ 64725 │ 5275.07568 ││ 2 │ 64680 │ 6011.80615 │ │ 3 │ 64740 │ 5563.13037 ││ 3 │ 64665 │ 4952.93603 │ │ 4 │ 64755 │ 447.168518 ││ 4 │ 64650 │ 4475.40917 │ │ 5 │ 64770 │ 195.603027 ││ 5 │ 64635 │ 2156.96655 │ │ 6 │ 64785 │ 208.961578 ││ 6 │ 64620 │ 197.118194 │ │ ... │ ... │ ... ││ ... │ ... │ ... │ │ 214 │ 67905 │ 5.78559017 ││ 214 │ 61500 │ 595.669799 │ │ 215 │ 67920 │ 7.74172019 ││ 215 │ 61485 │ 2.72295999 │ │ 216 │ 67935 │ 59.1259193 ││ 216 │ 61470 │ 2.05807995 │ └───────┴───────┴────────────┘└───────┴───────┴────────────┘ ``` -------------------------------- ### Querying with skew options Source: https://docs.velo.xyz/sdks/typescript/api/options/skew Example of using the skew method to select specific tenors within a query builder. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .skew(['1m', '3m']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### Query spot trades Source: https://docs.velo.xyz/sdks/typescript/api/spot/trades Example of querying buy and sell trade counts for BTC-USD over the last day with 1-hour resolution. ```typescript import { Velo, spot } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( spot .trades(['buy', 'sell']) .for({ products: ['BTC-USD'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### Query with gamma options Source: https://docs.velo.xyz/sdks/typescript/api/options/gamma Example of using the gamma method within a query to specify a metric and time range. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .gamma({ metric: 'coin' }) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### Querying Futures Open Interest Source: https://docs.velo.xyz/sdks/typescript/api/futures/open-interest Example demonstrating how to query futures open interest for a specific product over a defined time range. ```typescript import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .openInterest(['close'], { metric: 'coin' }) .for({ products: ['BTCUSDT'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### Request orderbook data with cURL Source: https://docs.velo.xyz/api/data Example command to fetch orderbook data using cURL with basic authentication. ```bash curl 'https://api.velo.xyz/api/v1/heatmap ?exchange=binance-futures &product=BTCUSDT' \ --header 'Authorization: Basic $(printf "api:your_api_key" | base64)' ``` -------------------------------- ### Querying with indexPrice Source: https://docs.velo.xyz/sdks/typescript/api/options/index-price Example of using indexPrice within a query builder to fetch BTC data over a 1-day period with 1-hour resolution. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .indexPrice() .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### Querying the spot catalog Source: https://docs.velo.xyz/sdks/typescript/api/catalog/spot Example showing how to initialize the Velo client and query the spot catalog with specific coin and exchange filters. ```typescript import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const products = await velo.query( catalog.spot({ coin: 'BTC', exchange: 'coinbase', }), ); ``` -------------------------------- ### Error responses for GET /api/v1/caps Source: https://docs.velo.xyz/api/data Example response bodies for the error status codes: 400 invalid request, 403 unauthorized API key, 429 rate limit exceeded, and 503 service unavailable. ```text "invalid coins param" ``` ```text "api key not authorized" ``` ```text "rate limited" ``` ```text "api temporarily unavailable" ``` -------------------------------- ### Make a Data Request Source: https://docs.velo.xyz/sdks/python/getting-started Initialize a client with your API key, select a futures product and columns, and retrieve rows as a dataframe. ```python from velodata import lib as velo # new velo client client = velo.client('api_key') # get futures and pick one future = client.get_futures()[0] # get futures columns and pick two columns = client.get_futures_columns()[:2] # last 10 minutes in 1 minute resolution params = { 'type': 'futures', 'columns': columns, 'exchanges': [future['exchange']], 'products': [future['product']], 'begin': client.timestamp() - 1000 * 60 * 11, 'end': client.timestamp(), 'resolution': '1m' } # returns dataframe print(client.get_rows(params)) ``` -------------------------------- ### Fetch 3m_basis_ann data Source: https://docs.velo.xyz/sdks/python/guides/fetch-futures-basis This example demonstrates how to initialize the velodata client and request 3m_basis_ann data for BTC and ETH over a 5-day period with 1-hour resolution. ```python from velodata import lib as velo day_in_ms = 1000 * 60 * 60 * 24 # new velo client client = velo.client('api_key') # from 5 days ago in 1 hour resolution params = { 'type': 'futures', 'columns': ['3m_basis_ann'], 'coins': ['BTC', 'ETH'], 'begin': client.timestamp() - day_in_ms * 5, 'end': client.timestamp(), 'resolution': '1h' } # returns dataframe print(client.get_rows(params)) ``` -------------------------------- ### Query Spot Volume Source: https://docs.velo.xyz/sdks/typescript/api/spot/volume Example of using the spot.volume method to query buy volume in coin metric for BTC-USD over the last day with 1-hour resolution. ```typescript import { Velo, spot } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( spot .volume(['buy'], { metric: 'coin' }) .for({ products: ['BTC-USD'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### 200 response example (unquoted) Source: https://docs.velo.xyz/api/data Alternative example of a successful CSV response, shown without surrounding quotes. ```csv exchange,coin,product,time,close_price binance-futures,BTC,BTCUSDT,1767225600000,87824.6 binance-futures,ETH,ETHUSDT,1767225600000,2979.01 binance-futures,BTC,BTCUSDT,1767240000000,87603.7 binance-futures,ETH,ETHUSDT,1767240000000,2977.18 binance-futures,BTC,BTCUSDT,1767254400000,87980.1 binance-futures,ETH,ETHUSDT,1767254400000,2988 ``` -------------------------------- ### .spot() Source: https://docs.velo.xyz/sdks/typescript/api/catalog Fetches and filters spot products. Filters are exact and case-insensitive, and coin and product are mutually exclusive but can be combined with exchange. ```APIDOC ## .spot() ### Description Fetches and filters spot products. ### Method .spot() ### Parameters - **coin** (string) - Optional - Exact and case-insensitive filter. Mutually exclusive with product. - **product** (string) - Optional - Exact and case-insensitive filter. Mutually exclusive with coin. - **exchange** (string) - Optional - Exact and case-insensitive filter. Can be combined with coin or product. ### Response Returns the filtered list of spot products. If no filters are provided, returns the complete spot catalog. ``` -------------------------------- ### Query news stories Source: https://docs.velo.xyz/sdks/typescript/api/news/stories Example showing how to initialize the Velo client and query news stories published within the last 24 hours. ```typescript import { Velo, news } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const stories = await velo.query( news.stories({ begin: Date.now() - 24 * 60 * 60 * 1000, }), ); for (const story of stories) { console.log(story.time, story.headline); } ``` -------------------------------- ### Example story object Source: https://docs.velo.xyz/sdks/typescript/guides/fetch-news A sample JSON object representing a news story. ```json { "id": 1646, "time": 1765554594943, "effectiveTime": 1765554594943, "effectivePrice": 29.058, "headline": "Hyperliquid To Introduce Portfolio Margin", "source": "Team", "priority": 2, "coins": ["HYPE"], "summary": "Portfolio margin is coming.", "link": "https://t.me/hyperliquid_announcements" } ``` -------------------------------- ### Fetch orderbook depth data with the velodata client Source: https://docs.velo.xyz/sdks/python/guides/fetch-orderbook-data This example demonstrates how to initialize the velo client, select a future with orderbook data, and iterate through depth snapshots for the last 24 hours at 5-minute resolution. ```python from velodata import lib as velo day_in_ms = 1000 * 60 * 60 * 24 # new velo client client = velo.client('api_key') # pick a supported future futures = client.get_futures() futures_with_orderbook_data = [f for f in futures if f['depth']] future = futures_with_orderbook_data[0] # last 24 hours in 5 minute resolution params = { 'exchange': future['exchange'], 'product': future['product'], 'begin': client.timestamp() - day_in_ms, 'end': client.timestamp(), 'resolution': '5m' } # prints orderbook at each timestamp as it finishes for df in client.depth(params): print(df) ``` -------------------------------- ### Streaming large requests with stream_rows Source: https://docs.velo.xyz/sdks/python/concepts/large-requests This example demonstrates how to configure a request with multiple products and columns, create batches using 'batch_rows', and process the results individually using 'stream_rows'. ```python from velodata import lib as velo day_in_ms = 1000 * 60 * 60 * 24 # new velo client client = velo.client('api_key') # from 5 days ago in 1 minute resolution # 2 columns * 4 products * 1 exchange * 7200 rows = 57600 values params = { 'type': 'futures', 'columns': ['open_price', 'close_price'], 'exchanges': ['binance-futures'], 'products': ['LTCUSDT', 'ETCUSDT', 'BCHUSDT', 'SOLUSDT'], 'begin': client.timestamp() - day_in_ms * 5, 'end': client.timestamp(), 'resolution': '1m' } # creates 3 batches (57600 values / 22500 limit) batches = client.batch_rows(params) # prints each batch as it finishes for df in client.stream_rows(batches): print(df) ``` -------------------------------- ### Orderbook CSV response format Source: https://docs.velo.xyz/api/data Example of the headerless CSV data returned by the API. ```csv 15 1767225600000,87824.6,87780,12.4,87795,8.1,87810,4.2,87825,3.9,87840,7.6 1767225660000,87839.8,87795,10.2,87810,6.7,87825,5.1,87840,4.4,87855,9.3 ``` -------------------------------- ### Builder methods: price(), volume(), openInterest(), fundingRate(), for(), over() Source: https://docs.velo.xyz/sdks/typescript/concepts/builder-and-query Fluent builder methods for describing market data requests. ```APIDOC ## Builder Methods ### Description Fluent builder methods on the futures, options, and spot namespaces for describing market data requests. ### Methods - **price(columns)** - Selects price columns. - **volume(columns)** - Selects volume columns. - **openInterest(columns)** - Selects open interest columns. - **fundingRate(columns)** - Selects funding rate columns. - **for(scope)** - Sets the market scope: exchanges plus exactly one of coins or products. - **over(scope)** - Sets the time scope: exactly one of between or last, plus a resolution. ### Parameters #### for(scope) - **exchanges** (string[]) - Optional - List of exchange names. If omitted, every exchange for the market is selected. - **coins** (string[]) - Optional - List of coin symbols. Exactly one of coins or products must be provided. - **products** (string[]) - Optional - List of product symbols. Exactly one of coins or products must be provided. #### over(scope) - **between** (array) - Optional - Time range [begin, end) where begin is included and end is excluded. Accepts Date objects or millisecond timestamps. - **last** (string) - Optional - Duration in minutes, hours, days, or weeks (e.g., '30m', '2h', '3D', '1W'). Anchored when the request is executed. - **resolution** (string) - Required - Time resolution for the data. ### Request Example ```typescript const btc = futures .price(['close']) .volume(['total']) .for({ exchanges: ['bybit'], coins: ['BTC'] }); const hourly = await velo.query(btc.over({ last: '7D', resolution: '1h' })); const daily = await velo.query(btc.over({ last: '90D', resolution: '1D' })); ``` ``` -------------------------------- ### Query Futures Catalog Source: https://docs.velo.xyz/sdks/typescript/api/catalog/futures Example of querying the futures catalog filtered by a specific coin and exchange. ```typescript import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const products = await velo.query( catalog.futures({ coin: 'BTC', exchange: 'binance-futures', }), ); ``` -------------------------------- ### .options() Source: https://docs.velo.xyz/sdks/typescript/api/catalog Fetches and filters options products. Filters are exact and case-insensitive, and coin and product are mutually exclusive but can be combined with exchange. ```APIDOC ## .options() ### Description Fetches and filters options products. ### Method .options() ### Parameters - **coin** (string) - Optional - Exact and case-insensitive filter. Mutually exclusive with product. - **product** (string) - Optional - Exact and case-insensitive filter. Mutually exclusive with coin. - **exchange** (string) - Optional - Exact and case-insensitive filter. Can be combined with coin or product. ### Response Returns the filtered list of options products. If no filters are provided, returns the complete options catalog. ``` -------------------------------- ### WebSocket JSON Message Example Source: https://docs.velo.xyz/api/news A sample JSON message received after the WebSocket handshake is completed. ```json { "id": 1646, "headline": "Hyperliquid To Introduce Portfolio Margin", "source": "Team", "priority": 2, "summary": "- The Hyperliquid blockchain will introduce portfolio margin in an upcoming network upgrade. This feature is live on testnet in pre-alpha mode", "link": "https://t.me/hyperliquid_announcements", "time": 1765554594943, "effectiveTime": 1765554594943, "effectivePrice": 29.058, "coins": [ "HYPE" ] } ``` -------------------------------- ### Query with notional options Source: https://docs.velo.xyz/sdks/typescript/api/options/notional Example of using the notional option to filter for call notional data in a query. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .notional(['call']) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### catalog.spot(params?) Source: https://docs.velo.xyz/sdks/typescript/api/catalog/spot Fetches the spot product catalog with optional filters. Returns an immutable request builder that resolves to an array of SpotProduct objects. ```APIDOC ## Function: spot(params?: SpotCatalogParams) ### Description Fetches the spot product catalog and optionally filters it by coin, product, or exchange. Active products are returned by default. ### Signature ```typescript function spot(params?: SpotCatalogParams): SpotCatalogBuilder; ``` ### Parameters #### params (optional) - **Type:** `SpotCatalogParams` - **Optional** | Property | Type | Description | |----------|------|-------------| | `coin` | `string` | Matches a Velo-aggregated coin symbol. | | `product` | `string` | Matches an exchange-native product symbol. | | `exchange` | `SpotExchange` | Matches a supported spot exchange. | | `delisted` | `boolean` | When `true`, returns the delisted-only catalog. Defaults to `false`. | Note: `coin` and `product` are mutually exclusive. All filters are exact and case-insensitive. ### Return Type - **Type:** `SpotCatalogBuilder` Returns an immutable request builder. Passing it to `velo.query()` resolves to `SpotProduct[]`: an array of matching catalog products, or an empty array when no products match. Per-request timeout, retry, and abort-signal options (`HttpRequestOptions`) are supplied as the second argument to `velo.query()`. ### SpotProduct Properties | Property | Type | Description | |----------|------|-------------| | `exchange` | `SpotExchange` | The exchange and spot market. | | `coin` | `string` | The Velo-aggregated coin symbol. | | `product` | `string` | The exchange-native product symbol. | | `begin` | `number` | First available timestamp in milliseconds. | | `end` | Optional `number` | Last available timestamp for a delisted product. | ### Example ```typescript import { Velo, catalog } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const products = await velo.query( catalog.spot({ coin: 'BTC', exchange: 'coinbase', }), ); ``` ``` -------------------------------- ### Query options for all exchanges Source: https://docs.velo.xyz/sdks/typescript/api/options/for Example of omitting the exchanges property to query across all available options exchanges. ```typescript options.iv(['1m']).for({ coins: ['BTC'] }); ``` -------------------------------- ### Query with fluent builder Source: https://docs.velo.xyz/sdks/typescript/api/query Executes a query using the fluent builder pattern to fetch price and volume data for BTC on Binance Futures. ```typescript import { Velo, futures } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( futures .price(['close']) .volume(['total']) .for({ exchanges: ['binance-futures'], coins: ['BTC'] }) .over({ last: '24h', resolution: '1h' }), ); for (const row of data.rows()) { console.log(row); } ``` -------------------------------- ### Query with delta options Source: https://docs.velo.xyz/sdks/typescript/api/options/delta Example of using the delta method to query data with specific metrics and parts. ```typescript import { Velo, options } from 'velo-sdk'; const velo = new Velo({ apiKey: process.env.VELO_API_KEY! }); const data = await velo.query( options .delta(['put'], { metric: 'coin' }) .for({ coins: ['BTC'], }) .over({ last: '1D', resolution: '1h', }), ); const rows = data.rows(); ``` -------------------------------- ### Querying futures products with filters Source: https://docs.velo.xyz/sdks/typescript/guides/discover-products Demonstrates how to query the catalog for all futures, filter by coin, filter by coin and exchange, or retrieve a specific exchange product. ```typescript // All futures products const allProducts = await velo.query(catalog.futures()); // All BTC futures products const btcFutures = await velo.query( catalog.futures({ coin: 'BTC', }), ); // All BTC futures products on `binance-futures` const btcBinanceFutures = await velo.query( catalog.futures({ coin: 'BTC', exchange: 'binance-futures', }), ); // One exchange product from `binance-futures` const binanceBtc = await velo.query( catalog.futures({ product: 'BTCUSDT', exchange: 'binance-futures', }), ); ``` -------------------------------- ### Query with between date range Source: https://docs.velo.xyz/sdks/typescript/api/futures/over Example of using the 'between' property to define an absolute time window for the query. ```typescript const data = await velo.query( futures .price(['close']) .for({ coins: ['BTC'] }) .over({ between: [ new Date('2026-01-01T00:00:00Z'), new Date('2026-02-01T00:00:00Z'), ], resolution: '4h', }), ); ``` -------------------------------- ### Query with last duration Source: https://docs.velo.xyz/sdks/typescript/api/futures/over Example of using the 'last' property to define a trailing time window for the query. ```typescript const data = await velo.query( futures .price(['close']) .for({ coins: ['BTC'] }) .over({ last: '1D', resolution: '1h', }), ); ``` -------------------------------- ### .client Source: https://docs.velo.xyz/sdks/python/api/client Creates a Velo API client. Use this method to initialize the client with your API key. ```APIDOC ## .client ### Description Creates a Velo API client. ### Method .client ### Parameters - **api_key** (string) - Required - The API key used to authenticate with the Velo API. ### Returns A Velo API client instance. ```