0xarchive

Query historical crypto market data from 0xArchive across Hyperliquid, Lighter.xyz, and HIP-3. Covers orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality. Use when the user asks about crypto market data, orderbooks, trades, funding rates, or historical prices on Hyperliquid, Lighter.xyz, or HIP-3.

Safety Notice

This item is sourced from the public archived skills repository. Treat as untrusted until reviewed.

Copy this and send it to your AI assistant to learn

Install skill "0xarchive" with this command: npx skills add 0xfantommenace/0xarchive

0xArchive API Skill

Query historical and real-time crypto market data from 0xArchive using curl. Three exchanges are supported: Hyperliquid (perps DEX), Lighter.xyz (order-book DEX), and HIP-3 (Hyperliquid builder perps). Data types: orderbooks, trades, candles, funding rates, open interest, liquidations, and data quality metrics.

Authentication

All endpoints require the x-api-key header. The key is read from $OXARCHIVE_API_KEY.

curl -s -H "x-api-key: $OXARCHIVE_API_KEY" "https://api.0xarchive.io/v1/..."

Exchanges & Coin Naming

ExchangePath prefixCoin formatExamples
Hyperliquid/v1/hyperliquidUPPERCASEBTC, ETH, SOL
HIP-3/v1/hyperliquid/hip3Case-sensitive, builder:NAMEkm:US500, xyz:GOLD, hyna:BTC, vntl:SPACEX, flx:TSLA, cash:NVDA
Lighter/v1/lighterUPPERCASEBTC, ETH

Hyperliquid and Lighter auto-uppercase the symbol server-side. HIP-3 coin names are passed through as-is.

Timestamps

All timestamps are Unix milliseconds. Use these shell helpers:

NOW=$(( $(date +%s) * 1000 ))
HOUR_AGO=$(( NOW - 3600000 ))
DAY_AGO=$(( NOW - 86400000 ))
WEEK_AGO=$(( NOW - 604800000 ))

Response Format

Every response follows this shape:

{
  "success": true,
  "data": [ ... ],
  "meta": {
    "count": 100,
    "request_id": "uuid",
    "next_cursor": "1706000000000"   // present when more pages exist
  }
}

Endpoint Reference

Hyperliquid (/v1/hyperliquid)

EndpointParamsNotes
GET /instruments--List all instruments
GET /instruments/{symbol}--Single instrument details
GET /orderbook/{symbol}timestamp, depthLatest or at timestamp
GET /orderbook/{symbol}/historystart, end, limit, cursor, depthHistorical snapshots
GET /trades/{symbol}start, end, limit, cursorTrade history
GET /candles/{symbol}start, end, limit, cursor, intervalOHLCV candles
GET /funding/{symbol}/current--Current funding rate
GET /funding/{symbol}start, end, limit, cursor, intervalFunding rate history
GET /openinterest/{symbol}/current--Current open interest
GET /openinterest/{symbol}start, end, limit, cursor, intervalOI history
GET /liquidations/{symbol}start, end, limit, cursorLiquidation events
GET /liquidations/{symbol}/volumestart, end, limit, cursor, intervalAggregated liquidation volume (USD)
GET /liquidations/user/{address}start, end, limit, cursor, coinLiquidations for a user
GET /freshness/{symbol}--Data freshness per data type
GET /summary/{symbol}--Combined market summary (price, funding, OI, volume, liquidations)
GET /prices/{symbol}start, end, limit, cursor, intervalMark/oracle/mid price history
GET /orders/{symbol}/historystart, end, user, status, order_type, limit, cursorOrder history with user attribution (Build+)
GET /orders/{symbol}/flowstart, end, interval, limitOrder flow aggregation (Build+)
GET /orders/{symbol}/tpslstart, end, user, triggered, limit, cursorTP/SL order history (Pro+)
GET /orderbook/{symbol}/l4timestamp, depthL4 orderbook reconstruction (Pro+)
GET /orderbook/{symbol}/l4/diffsstart, end, limit, cursorL4 orderbook diffs (Pro+)
GET /orderbook/{symbol}/l4/historystart, end, limit, cursorL4 orderbook checkpoints (Pro+)
GET /orderbook/{symbol}/l2timestamp, depthL2 full-depth orderbook derived from L4 (Build+)
GET /orderbook/{symbol}/l2/historystart, end, limit, cursor, depthL2 full-depth checkpoints (Build+)
GET /orderbook/{symbol}/l2/diffsstart, end, limit, cursorL2 tick-level diffs (Pro+)

HIP-3 (/v1/hyperliquid/hip3)

Coin names are case-sensitive (e.g., km:US500). Free tier includes km:US500 for orderbook and orderbook history; Build+ unlocks all HIP-3 symbols.

EndpointParamsNotes
GET /instruments--List HIP-3 instruments
GET /instruments/{coin}--Single instrument
GET /orderbook/{coin}timestamp, depthFree: km:US500 only. Build+: all HIP-3 symbols.
GET /orderbook/{coin}/historystart, end, limit, cursor, depthFree: km:US500 only. Build+: all HIP-3 symbols.
GET /trades/{coin}start, end, limit, cursorTrade history
GET /trades/{coin}/recentlimitRecent trades (no time range needed)
GET /candles/{coin}start, end, limit, cursor, intervalOHLCV candles
GET /funding/{coin}/current--Current funding rate
GET /funding/{coin}start, end, limit, cursor, intervalFunding history
GET /openinterest/{coin}/current--Current OI
GET /openinterest/{coin}start, end, limit, cursor, intervalOI history
GET /liquidations/{coin}start, end, limit, cursorLiquidation events
GET /liquidations/{coin}/volumestart, end, limit, cursor, intervalAggregated liquidation volume (USD)
GET /freshness/{coin}--Data freshness per data type
GET /summary/{coin}--Combined market summary (price, funding, OI)
GET /prices/{coin}start, end, limit, cursor, intervalMark/oracle/mid price history
GET /orders/{coin}/historystart, end, user, status, order_type, limit, cursorOrder history with user attribution (Build+)
GET /orders/{coin}/flowstart, end, interval, limitOrder flow aggregation (Build+)
GET /orders/{coin}/tpslstart, end, user, triggered, limit, cursorTP/SL order history (Pro+)
GET /orderbook/{coin}/l4timestamp, depthL4 orderbook reconstruction (Pro+)
GET /orderbook/{coin}/l4/diffsstart, end, limit, cursorL4 orderbook diffs (Pro+)
GET /orderbook/{coin}/l4/historystart, end, limit, cursorL4 orderbook checkpoints (Pro+)
GET /orderbook/{coin}/l2timestamp, depthL2 full-depth orderbook derived from L4 (Build+)
GET /orderbook/{coin}/l2/historystart, end, limit, cursor, depthL2 full-depth checkpoints (Build+)
GET /orderbook/{coin}/l2/diffsstart, end, limit, cursorL2 tick-level diffs (Pro+)

Lighter (/v1/lighter)

Same data types as Hyperliquid except: no liquidations. Adds granularity on orderbook history and /recent trades.

EndpointParamsNotes
GET /instruments--List Lighter instruments
GET /instruments/{symbol}--Single instrument
GET /orderbook/{symbol}timestamp, depthLatest or at timestamp
GET /orderbook/{symbol}/historystart, end, limit, cursor, depth, granularityDefault granularity: checkpoint
GET /trades/{symbol}start, end, limit, cursorTrade history
GET /trades/{symbol}/recentlimitRecent trades (no time range needed)
GET /candles/{symbol}start, end, limit, cursor, intervalOHLCV candles
GET /funding/{symbol}/current--Current funding rate
GET /funding/{symbol}start, end, limit, cursor, intervalFunding history
GET /openinterest/{symbol}/current--Current OI
GET /openinterest/{symbol}start, end, limit, cursor, intervalOI history
GET /freshness/{symbol}--Data freshness per data type
GET /summary/{symbol}--Combined market summary (price, funding, OI)
GET /prices/{symbol}start, end, limit, cursor, intervalMark/oracle price history
GET /l3orderbook/{symbol}timestamp, depth, accountL3 order-level orderbook (Pro+)
GET /l3orderbook/{symbol}/historystart, end, limit, cursor, granularity, accountHistorical L3 snapshots (Pro+)

Data Quality (/v1/data-quality)

EndpointParamsNotes
GET /status--System health status
GET /coverage--Coverage summary, all exchanges
GET /coverage/{exchange}--Coverage for one exchange
GET /coverage/{exchange}/{symbol}from, toSymbol-level coverage + gaps
GET /incidentsstatus, exchange, since, limit, offsetList incidents
GET /incidents/{id}--Single incident
GET /latency--Ingestion latency metrics
GET /slayear, monthSLA compliance report

WebSocket Channels

Additional real-time channels available via WebSocket (wss://api.0xarchive.io/ws?apiKey=KEY):

ChannelNotes
l4_diffsL4 orderbook diffs with user attribution (Pro+, real-time only)
l4_ordersOrder lifecycle events with user attribution (Pro+, real-time only)
lighter_l3_orderbookLighter L3 order-level orderbook snapshots (Pro+, historical only)
hip3_liquidationsHIP-3 liquidation events with long/short direction (Build+, historical only)
hip3_l4_diffsHIP-3 L4 orderbook diffs (Pro+, real-time only)
hip3_l4_ordersHIP-3 order lifecycle events (Pro+, real-time only)

Web3 Authentication (/v1)

Get API keys programmatically using an Ethereum wallet (SIWE). No API key required for these endpoints.

EndpointParamsNotes
POST /auth/web3/challengeaddress (wallet address)Returns SIWE message to sign
POST /web3/signupmessage, signatureReturns free-tier API key
POST /web3/keysmessage, signatureList all keys for wallet
POST /web3/keys/revokemessage, signature, key_idRevoke a key
POST /web3/subscribetier (build or pro), payment-signature headerx402 USDC subscription (see flow below)

Free-tier flow: Call /auth/web3/challenge with wallet address → sign the returned message with personal_sign (EIP-191) → submit to /web3/signup with the message and signature → receive API key.

Paid-tier flow (x402):

  1. POST /web3/subscribe with { "tier": "build" } → server returns 402 with payment.amount (micro-USDC), payment.pay_to (treasury address), payment.network.
  2. Sign an EIP-712 TransferWithAuthorization (EIP-3009) on USDC Base:
    • Domain: { name: "USD Coin", version: "2", chainId: 8453, verifyingContract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }
    • Type: TransferWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce)
    • Message: { from: <wallet>, to: <pay_to>, value: <amount>, validAfter: 0, validBefore: <now+3600>, nonce: <32 random bytes hex> }
  3. Build x402 v2 payment payload:
    {
      "x402Version": 2,
      "payload": {
        "signature": "0x<EIP-712 signature hex>",
        "authorization": {
          "from": "0x<wallet>",
          "to": "0x<pay_to from step 1>",
          "value": "<amount as string>",
          "validAfter": "0",
          "validBefore": "<unix timestamp as string>",
          "nonce": "0x<64 hex chars>"
        }
      }
    }
    
  4. Base64-encode the JSON and retry: POST /web3/subscribe with { "tier": "build" } and header payment-signature: <base64 payload> → receive API key + subscription.

Important: All authorization values (value, validAfter, validBefore) must be strings, not numbers. See scripts/web3_subscribe.py for a complete working Python implementation.

Common Parameters

ParamTypeDescription
startintStart timestamp (Unix ms). Defaults to 24h ago.
endintEnd timestamp (Unix ms). Defaults to now.
limitintMax records. Default 100, max 1000 (max 10000 for candles).
cursorstringPagination cursor from meta.next_cursor.
intervalstringCandle interval: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w. Default: 1h. For OI/funding: 5m, 15m, 30m, 1h, 4h, 1d. Omit for raw data.
depthintOrderbook depth (number of price levels per side).
granularitystringLighter orderbook resolution: checkpoint (default), 30s, 10s, 1s, tick.
accountintLighter L3 orderbook: filter by account index (e.g., 281474976710654 for LLP vault).

Smart Defaults

When the user does not specify a time range, default to the last 24 hours:

NOW=$(( $(date +%s) * 1000 ))
DAY_AGO=$(( NOW - 86400000 ))

For candles with no explicit range, default to a range that makes sense for the interval (e.g., last 7 days for 4h candles, last 30 days for 1d candles).

Trade Response Fields

Each trade/fill record includes:

FieldTypeDescription
coin / symbolstringTrading pair symbol
sidestringB (buy) or A/S (sell)
pricestringExecution price
sizestringTrade size
timestampstringISO 8601 timestamp
trade_idintegerUnique trade ID
order_idintegerAssociated order ID
crossedbooleantrue = taker, false = maker
feestringBase trading fee
fee_tokenstringFee denomination (e.g., USDC)
closed_pnlstringRealized PnL if closing position
directionstringOpen Long, Close Short, Long > Short, etc.
start_positionstringPosition size before trade
user_addressstringUser's wallet address
builder_addressstringBuilder address that routed this order. Only present when the order was placed through a builder.
builder_feestringBuilder fee charged on this fill, paid to the builder (quote currency, typically USDC). Only present when builder_address is set.
deployer_feestringHIP-3 deployer fee share (quote currency). Negative for the maker side (rebate), positive for the taker side. HIP-3 only.
priority_gasnumberPriority fee burned in HYPE (not USDC) for write priority on the Hyperliquid validator queue. Independent of builder_fee and deployer_fee — paid to the network, not to a builder or deployer. Only present when the order paid for priority.
cloidstringClient order ID
twap_idintegerTWAP execution ID

builder_address, builder_fee, deployer_fee, priority_gas, cloid, and twap_id are optional — only present when non-zero/non-empty. deployer_fee is specific to HIP-3. priority_gas appears on any order that paid for write priority (most common on HIP-3 IOC orders).

Pagination

When meta.next_cursor is present in the response, more data is available. Append &cursor=VALUE to fetch the next page:

# First page
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/trades/BTC?start=$START&end=$END&limit=1000"

# Next page (use next_cursor from previous response)
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/trades/BTC?start=$START&end=$END&limit=1000&cursor=1706000000000_12345"

Tier Limits

TierPriceCoinsOrderbook DepthLighter GranularityHistorical DepthRate Limit
Free$0BTC only (HIP-3: km:US500 only)20 levels--30 days15 RPS
Build$49/moAll200 levelscheckpoint, 30s, 10s1 year50 RPS
Pro$199/moAllFull depth+ 1sFull history150 RPS
EnterpriseCustomAllFull depth+ tickFull historyCustom

Error Handling

HTTP StatusMeaningAction
400Bad request / validation errorCheck params (missing start/end, invalid interval)
401Missing or invalid API keySet $OXARCHIVE_API_KEY
403Tier restrictionUpgrade plan (e.g., non-BTC coin on Free tier)
404Symbol not foundCheck coin name spelling and exchange
429Rate limitedBack off and retry

Error responses return { "code": 400, "error": "description" }.

Example Queries

# List Hyperliquid instruments
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/instruments" | jq '.data | length'

# Current BTC orderbook (top 10 levels)
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC?depth=10" | jq '.data'

# ETH trades from the last hour
NOW=$(( $(date +%s) * 1000 )); HOUR_AGO=$(( NOW - 3600000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/trades/ETH?start=$HOUR_AGO&end=$NOW&limit=100" | jq '.data'

# SOL 4h candles for the last week
NOW=$(( $(date +%s) * 1000 )); WEEK_AGO=$(( NOW - 604800000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/candles/SOL?start=$WEEK_AGO&end=$NOW&interval=4h" | jq '.data'

# Current BTC funding rate
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/funding/BTC/current" | jq '.data'

# BTC open interest aggregated to 1h intervals (last week)
NOW=$(( $(date +%s) * 1000 )); WEEK_AGO=$(( NOW - 604800000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/openinterest/BTC?start=$WEEK_AGO&end=$NOW&interval=1h" | jq '.data'

# ETH funding rates aggregated to 4h intervals (last 30 days)
NOW=$(( $(date +%s) * 1000 )); MONTH_AGO=$(( NOW - 2592000000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/funding/ETH?start=$MONTH_AGO&end=$NOW&interval=4h" | jq '.data'

# HIP-3 km:US500 current orderbook (Free tier safe)
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/hip3/orderbook/km:US500" | jq '.data'

# HIP-3 km:US500 orderbook history (Free tier safe)
NOW=$(( $(date +%s) * 1000 )); HOUR_AGO=$(( NOW - 3600000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/hip3/orderbook/km:US500/history?start=$HOUR_AGO&end=$NOW&limit=10" | jq '.data'

# HIP-3 km:US500 candles (last 24h, 1h interval)
NOW=$(( $(date +%s) * 1000 )); DAY_AGO=$(( NOW - 86400000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/hip3/candles/km:US500?start=$DAY_AGO&end=$NOW&interval=1h" | jq '.data'

# Lighter BTC orderbook history (30s granularity, last hour)
NOW=$(( $(date +%s) * 1000 )); HOUR_AGO=$(( NOW - 3600000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/lighter/orderbook/BTC/history?start=$HOUR_AGO&end=$NOW&granularity=30s&limit=100" | jq '.data'

# System health status
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/data-quality/status" | jq '.'

# SLA report for current month
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/data-quality/sla" | jq '.'

# BTC market summary (price, funding, OI, volume, liquidations in one call)
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/summary/BTC" | jq '.data'

# BTC data freshness (lag per data type)
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/freshness/BTC" | jq '.data'

# BTC price history (mark/oracle/mid) aggregated to 1h
NOW=$(( $(date +%s) * 1000 )); DAY_AGO=$(( NOW - 86400000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/prices/BTC?start=$DAY_AGO&end=$NOW&interval=1h" | jq '.data'

# BTC liquidation volume aggregated to 4h buckets
NOW=$(( $(date +%s) * 1000 )); WEEK_AGO=$(( NOW - 604800000 ))
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/hyperliquid/liquidations/BTC/volume?start=$WEEK_AGO&end=$NOW&interval=4h" | jq '.data'

# Data coverage for Hyperliquid BTC
curl -s -H "x-api-key: $OXARCHIVE_API_KEY" \
  "https://api.0xarchive.io/v1/data-quality/coverage/hyperliquid/BTC" | jq '.'

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Web3

tcm-constitution-recognition-analysis

Determines nine TCM constitution types including Yin deficiency, Yang deficiency, Qi deficiency, phlegm-dampness, and blood stasis through facial features and physical signs, and provides personalized health preservation and conditioning suggestions. | 中医体质识别分析技能,通过面部特征与体征判别阴虚、阳虚、气虚、痰湿、血瘀等九种中医体质类型,给出个性化养生调理建议

Archived SourceRecently Updated
Web3

E2E Test Recorder

# Screen Recorder Demo Skill ## 概述 基于 Puppeteer 的自动化端到端测试录制 Skill,支持录制浏览器操作并生成演示视频/GIF。 ## 功能特性 ### 核心功能 - 🎥 **浏览器操作录制**:录制网页操作过程 - 🎯 **智能区域录制**:支持全屏或指定区域录制 - 🔄 **格式转换**:支持 MP4、GIF、WebM 格式 - ⚡ **自动化测试集成**:与测试框架无缝集成 ### 高级功能 - 📊 **性能监控**:录制时显示FPS和文件大小 - 🎨 **视频编辑**:添加水印、字幕、片头片尾 - 🔧 **配置灵活**:支持多种录制参数配置 - 📱 **跨平台**:支持 Windows、macOS、Linux ## 安装要求 ### 系统要求 - Node.js 16+ - npm 或 yarn - Chrome/Chromium 浏览器 ### 依赖安装 ```bash npm install puppeteer puppeteer-screen-recorder ffmpeg-static # 或 yarn add puppeteer puppeteer-screen-recorder ffmpeg-static ``` ## 快速开始 ### 1. 基础录制 ```javascript const { ScreenRecorder } = require('./scripts/record-browser'); const recorder = new ScreenRecorder({ outputPath: './recordings/demo.mp4', fps: 30, quality: 80 }); await recorder.startRecording('https://your-app.com'); // 执行操作... await recorder.stopRecording(); ``` ### 2. 端到端测试录制 ```javascript const { recordE2ETest } = require('./scripts/record-test'); await recordE2ETest({ url: 'http://localhost:3000', testSteps: [ { action: 'click', selector: '#login-btn' }, { action: 'type', selector: '#username', text: 'testuser' }, { action: 'type', selector: '#password', text: 'password123' }, { action: 'click', selector: '#submit-btn' } ], output: './recordings/login-test.mp4' }); ``` ## API 文档 ### ScreenRecorder 类 #### 构造函数 ```javascript new ScreenRecorder(options) ``` **options**: - `outputPath` (string): 输出文件路径 - `fps` (number): 帧率,默认 30 - `quality` (number): 视频质量 0-100,默认 80 - `aspectRatio` (string): 宽高比,如 '16:9' - `codec` (string): 视频编码器,默认 'libx264' #### 方法 - `startRecording(url, options)`: 开始录制 - `stopRecording()`: 停止录制 - `pauseRecording()`: 暂停录制 - `resumeRecording()`: 恢复录制 - `addAnnotation(text, position)`: 添加标注 - `addWatermark(imagePath, position)`: 添加水印 ### 工具函数 #### recordE2ETest(config) 录制端到端测试过程 **config**: - `url` (string): 测试页面URL - `testSteps` (Array): 测试步骤数组 - `output` (string): 输出文件路径 - `headless` (boolean): 是否无头模式,默认 false #### convertVideo(input, output, options) 视频格式转换 #### mergeVideos(videos, output) 合并多个视频文件 ## 配置示例 ### 基础配置 ```json { "recorder": { "fps": 30, "quality": 80, "outputDir": "./recordings", "defaultFormat": "mp4" }, "browser": { "headless": false, "viewport": { "width": 1920, "height": 1080 }, "slowMo": 50 }, "annotations": { "enabled": true, "fontSize": 24, "fontColor": "#ffffff", "backgroundColor": "#00000080" } } ``` ### 测试配置 ```json { "testSuites": { "login": { "url": "http://localhost:3000/login", "steps": "scripts/test-steps/login.json", "output": "recordings/login-test.mp4" }, "dashboard": { "url": "http://localhost:3000/dashboard", "steps": "scripts/test-steps/dashboard.json", "output": "recordings/dashboard-test.mp4" } } } ``` ## 与测试框架集成 ### Jest 集成 ```javascript // jest.config.js module.exports = { setupFilesAfterEnv: ['./jest.setup.js'], reporters: [ 'default', ['./scripts/jest-video-reporter', { outputDir: './test-recordings' }] ] }; ``` ### Playwright 集成 ```javascript // playwright.config.js const { defineConfig } = require('@playwright/test'); module.exports = defineConfig({ use: { video: 'on', screenshot: 'on', }, reporter: [ ['html', { outputFolder: 'playwright-report' }], ['./scripts/playwright-video-reporter', { format: 'gif' }] ] }); ``` ## 目录结构 ``` e2e-test/ ├── SKILL.md # 技能文档 ├── package.json # 项目配置 ├── scripts/ │ ├── record-browser.js # 浏览器录制核心 │ ├── record-test.js # 测试录制 │ ├── record-screen.js # 屏幕录制 │ ├── convert-format.js # 格式转换 │ ├── add-annotations.js # 添加标注 │ └── utils.js # 工具函数 ├── configs/ │ ├── default.json # 默认配置 │ ├── test.json # 测试配置 │ └── production.json # 生产配置 ├── templates/ │ ├── demo-template.js # 演示模板 │ └── test-template.js # 测试模板 ├── examples/ │ ├── basic-recording.js # 基础录制示例 │ ├── e2e-test.js # 端到端测试示例 │ └── api-test.js # API测试示例 └── recordings/ # 录制文件输出目录 ``` ## 使用示例 ### 示例 1:录制登录流程 ```javascript const { recordE2ETest } = require('./scripts/record-test'); await recordE2ETest({ url: 'http://localhost:3000', testName: '用户登录测试', steps: [ { description: '访问登录页面', action: 'goto', url: '/login' }, { description: '输入用户名', action: 'type', selector: '#username', text: 'test@example.com' }, { description: '输入密码', action: 'type', selector: '#password', text: 'password123' }, { description: '点击登录按钮', action: 'click', selector: 'button[type="submit"]' }, { description: '验证登录成功', action: 'waitFor', selector: '.dashboard', timeout: 5000 } ], output: 'recordings/login-demo.mp4', annotations: true }); ``` ### 示例 2:录制API测试 ```javascript const { recordAPITest } = require('./scripts/record-test'); await recordAPITest({ apiUrl: 'http://localhost:8000/api', tests: [ { name: '健康检查API', endpoint: '/health', method: 'GET', expectedStatus: 200 }, { name: '用户注册API', endpoint: '/auth/register', method: 'POST', data: { username: 'testuser', email: 'test@example.com', password: 'Password123!' }, expectedStatus: 201 } ], output: 'recordings/api-test.gif' }); ``` ## 故障排除 ### 常见问题 #### 1. 录制失败 - **问题**: 无法启动浏览器 - **解决**: 确保已安装 Chrome/Chromium,或设置 `executablePath` #### 2. 视频质量差 - **问题**: 视频模糊或卡顿 - **解决**: 调整 `fps` 和 `quality` 参数,确保网络稳定 #### 3. 文件过大 - **问题**: 录制文件太大 - **解决**: 降低 `fps`、`quality`,或使用 `convertVideo` 压缩 #### 4. 内存不足 - **问题**: 录制过程中内存占用过高 - **解决**: 减少录制时长,或增加系统内存 ### 调试模式 ```javascript const recorder = new ScreenRecorder({ debug: true, // 启用调试模式 logLevel: 'verbose' }); ``` ## 性能优化建议 ### 录制优化 1. **降低帧率**: 非必要情况下使用 15-24 FPS 2. **调整分辨率**: 根据需求调整录制区域大小 3. **使用硬件加速**: 启用 GPU 加速录制 ### 文件优化 1. **格式选择**: MP4 适合长视频,GIF 适合短视频 2. **压缩设置**: 使用合适的压缩参数 3. **分段录制**: 长时间录制可分段保存 ## 许可证 MIT License ## 更新日志 ### v1.0.0 (2026-04-11) - 初始版本发布 - 支持基础浏览器录制 - 支持 MP4/GIF 格式输出 - 提供端到端测试录制功能 ## 贡献指南 1. Fork 项目 2. 创建功能分支 3. 提交更改 4. 推送到分支 5. 创建 Pull Request ## 联系支持 - 问题反馈: [GitHub Issues](https://github.com/your-org/e2e-test/issues) - 文档: [项目 Wiki](https://github.com/your-org/e2e-test/wiki) - 邮件: support@example.com

Archived SourceRecently Updated
Web3

hap-mongodb-slowlog-analysis

Analyze MongoDB 4.4.x slow logs from pasted slow-log text, uploaded log files, or mongodb.log content and produce practical query optimization advice, index recommendations, evidence-backed reasoning, and ready-to-run Mongo shell index commands. The skill is AI-first and should analyze logs directly in conversation without relying on local PowerShell by default. It should also be able to group repeated entries by namespace, deduplicate repeated query shapes, and summarize repeated patterns before giving advice. Only treat DOCX or PDF export as optional conversion steps that may require local tooling. Prefer Chinese output by default, but support English when requested. Treat ctime as already indexed and never recommend a new index on it. Treat status as a low-cardinality field with only 1 and 9, where 1 means active/in-use, and do not include status in recommended index definitions.

Archived SourceRecently Updated
Web3

auto-memory

Indestructible agent memory — permanently stored, never lost. Save decisions, identity, and context as a memory chain on the Autonomys Network. Rebuild your full history from a single CID, even after total state loss.

Archived SourceRecently Updated