Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 344 additions & 8 deletions cli-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,342 @@
"modulePath": "bilibili/user-videos.js",
"sourceFile": "bilibili/user-videos.js"
},
{
"site": "binance",
"name": "asks",
"description": "Order book ask prices for a trading pair",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "symbol",
"type": "str",
"required": true,
"positional": true,
"help": "Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"
},
{
"name": "limit",
"type": "int",
"default": 10,
"required": false,
"help": "Number of price levels (5, 10, 20, 50, 100)"
}
],
"columns": [
"rank",
"ask_price",
"ask_qty"
],
"type": "js",
"modulePath": "binance/asks.js",
"sourceFile": "binance/asks.js"
},
{
"site": "binance",
"name": "depth",
"description": "Order book bid and ask prices for a trading pair",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "symbol",
"type": "str",
"required": true,
"positional": true,
"help": "Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"
},
{
"name": "limit",
"type": "int",
"default": 10,
"required": false,
"help": "Number of price levels (5, 10, 20, 50, 100)"
}
],
"columns": [
"rank",
"bid_price",
"bid_qty",
"ask_price",
"ask_qty"
],
"type": "js",
"modulePath": "binance/depth.js",
"sourceFile": "binance/depth.js"
},
{
"site": "binance",
"name": "gainers",
"description": "Top gaining trading pairs by 24h price change",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "limit",
"type": "int",
"default": 10,
"required": false,
"help": "Number of trading pairs"
}
],
"columns": [
"rank",
"symbol",
"price",
"change_24h",
"volume"
],
"type": "js",
"modulePath": "binance/gainers.js",
"sourceFile": "binance/gainers.js"
},
{
"site": "binance",
"name": "klines",
"description": "Candlestick/kline data for a trading pair",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "symbol",
"type": "str",
"required": true,
"positional": true,
"help": "Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"
},
{
"name": "interval",
"type": "str",
"default": "1d",
"required": false,
"help": "Kline interval (1m, 5m, 15m, 1h, 4h, 1d, 1w, 1M)"
},
{
"name": "limit",
"type": "int",
"default": 10,
"required": false,
"help": "Number of klines (max 1000)"
}
],
"columns": [
"open",
"high",
"low",
"close",
"volume"
],
"type": "js",
"modulePath": "binance/klines.js",
"sourceFile": "binance/klines.js"
},
{
"site": "binance",
"name": "losers",
"description": "Top losing trading pairs by 24h price change",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "limit",
"type": "int",
"default": 10,
"required": false,
"help": "Number of trading pairs"
}
],
"columns": [
"rank",
"symbol",
"price",
"change_24h",
"volume"
],
"type": "js",
"modulePath": "binance/losers.js",
"sourceFile": "binance/losers.js"
},
{
"site": "binance",
"name": "pairs",
"description": "List active trading pairs on Binance",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Number of trading pairs"
}
],
"columns": [
"symbol",
"base",
"quote",
"status"
],
"type": "js",
"modulePath": "binance/pairs.js",
"sourceFile": "binance/pairs.js"
},
{
"site": "binance",
"name": "price",
"description": "Quick price check for a trading pair",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "symbol",
"type": "str",
"required": true,
"positional": true,
"help": "Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"
}
],
"columns": [
"symbol",
"price",
"change",
"change_pct",
"high",
"low",
"volume",
"quote_volume",
"trades"
],
"type": "js",
"modulePath": "binance/price.js",
"sourceFile": "binance/price.js"
},
{
"site": "binance",
"name": "prices",
"description": "Latest prices for all trading pairs",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Number of prices"
}
],
"columns": [
"rank",
"symbol",
"price"
],
"type": "js",
"modulePath": "binance/prices.js",
"sourceFile": "binance/prices.js"
},
{
"site": "binance",
"name": "ticker",
"description": "24h ticker statistics for top trading pairs by volume",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Number of tickers"
}
],
"columns": [
"symbol",
"price",
"change_pct",
"high",
"low",
"volume",
"quote_vol",
"trades"
],
"type": "js",
"modulePath": "binance/ticker.js",
"sourceFile": "binance/ticker.js"
},
{
"site": "binance",
"name": "top",
"description": "Top trading pairs by 24h volume on Binance",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Number of trading pairs"
}
],
"columns": [
"rank",
"symbol",
"price",
"change_24h",
"high",
"low",
"volume"
],
"type": "js",
"modulePath": "binance/top.js",
"sourceFile": "binance/top.js"
},
{
"site": "binance",
"name": "trades",
"description": "Recent trades for a trading pair",
"domain": "data-api.binance.vision",
"strategy": "public",
"browser": false,
"args": [
{
"name": "symbol",
"type": "str",
"required": true,
"positional": true,
"help": "Trading pair symbol (e.g. BTCUSDT, ETHUSDT)"
},
{
"name": "limit",
"type": "int",
"default": 20,
"required": false,
"help": "Number of trades (max 1000)"
}
],
"columns": [
"id",
"price",
"qty",
"quote_qty",
"buyer_maker"
],
"type": "js",
"modulePath": "binance/trades.js",
"sourceFile": "binance/trades.js"
},
{
"site": "bloomberg",
"name": "businessweek",
Expand Down Expand Up @@ -13193,14 +13529,14 @@
"help": ""
}
],
"columns": [
"author",
"text",
"likes",
"retweets",
"bookmarks",
"url"
],
"columns": [
"author",
"text",
"likes",
"retweets",
"bookmarks",
"url"
],
"type": "js",
"modulePath": "twitter/bookmarks.js",
"sourceFile": "twitter/bookmarks.js"
Expand Down
7 changes: 3 additions & 4 deletions clis/binance/depth.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@ import { cli, Strategy } from '@jackwener/opencli/registry';
cli({
site: 'binance',
name: 'depth',
description: 'Order book bid prices for a trading pair',
description: 'Order book bid and ask prices for a trading pair',
domain: 'data-api.binance.vision',
strategy: Strategy.PUBLIC,
browser: false,
args: [
{ name: 'symbol', type: 'str', required: true, positional: true, help: 'Trading pair symbol (e.g. BTCUSDT, ETHUSDT)' },
{ name: 'limit', type: 'int', default: 10, help: 'Number of price levels (5, 10, 20, 50, 100)' },
],
columns: ['rank', 'bid_price', 'bid_qty'],
columns: ['rank', 'bid_price', 'bid_qty', 'ask_price', 'ask_qty'],
pipeline: [
{ fetch: { url: 'https://data-api.binance.vision/api/v3/depth?symbol=${{ args.symbol }}&limit=${{ args.limit }}' } },
{ select: 'bids' },
{ map: { rank: '${{ index + 1 }}', bid_price: '${{ item.0 }}', bid_qty: '${{ item.1 }}' } },
{ map: { select: 'bids', rank: '${{ index + 1 }}', bid_price: '${{ item[0] }}', bid_qty: '${{ item[1] }}', ask_price: '${{ root.asks[index]?.[0] ?? "" }}', ask_qty: '${{ root.asks[index]?.[1] ?? "" }}' } },
{ limit: '${{ args.limit }}' },
],
});
2 changes: 1 addition & 1 deletion src/pipeline/steps/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function stepMap(_page: IPage | null, params: unknown, data: unknow
const row: Record<string, unknown> = {};
for (const [key, template] of Object.entries(templateParams)) {
if (key === 'select') continue;
row[key] = render(template, { args, data: source, item, index: i });
row[key] = render(template, { args, data: source, root: data, item, index: i });
}
result.push(row);
}
Expand Down
Loading
Loading