openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Stock Prices

Query real-time stock prices and market data using the Stock Prices API. Responses are in TOON format—decode with @toon-format/toon. Use when fetching stock...

开发与 DevOps

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v1.0.1

统计:⭐ 0 · 2.5k · 12 current installs · 12 all-time installs

0

安装量(当前) 12

🛡 VirusTotal :可疑 · OpenClaw :良性

Package:anthonylee1994/stock-prices

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :良性

OpenClaw 评估

The skill's requests and runtime instructions are consistent with its stated purpose (fetching stock quotes); it does not ask for credentials or broad system access and contains no install-time surprises, but you should still verify the third-party API domain and the TOON npm package before use.

目的

Name/description, API base URL, endpoints, example requests, and decoding instructions all align with a stock-quote retrieval skill. There are no declared env vars, binaries, or config paths that are unrelated to fetching or decoding quotes.

说明范围

SKILL.md only instructs the agent to call the provided HTTPS endpoint and decode the TOON response with an npm package; it does not direct access to unrelated files, environment variables, or external endpoints beyond the described API and the suggested decoder.

安装机制

The skill is instruction-only (no install spec), which is low-risk. It suggests installing @toon-format/toon via pnpm for decoding; this is reasonable for the stated purpose but is an external package so verify its provenance before installing in environments with strict supply-chain requirements.

证书

The skill requests no environment variables, credentials, or config paths. This is proportionate to a public-stock-quote fetcher that does not advertise authenticated endpoints.

持久

The skill does not request persistent/always-on privilege and uses default invocation settings. It does not instruct modifying other skills or system-wide settings.

综合结论

This skill appears coherent and limited to fetching and decoding stock data. Before installing or using it, verify two things: (1) the API host (https://stock-prices.on99.app) — confirm you trust the operator, check HTTPS/TLS and any privacy or rate-limit policies; (2) the npm package @toon-format/toon — inspect the package source, maintainers, and download counts to ensure it's legitimate. If you plan to use this with private or sensitive dat…

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Stock Prices」。简介:Query real-time stock prices and market data using the Stock Prices API. Respon…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/anthonylee1994/stock-prices/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: stock-prices
description: Query real-time stock prices and market data using the Stock Prices API. Responses are in TOON format—decode with @toon-format/toon. Use when fetching stock quotes, analyzing market data, or working with symbols like AAPL, NVDA, GOOGL, or any ticker symbols.
---

# Stock Prices API Skill

This skill helps you work with the Stock Prices API to fetch real-time market data and stock quotes.

## API Endpoint

**Base URL**: `https://stock-prices.on99.app`

**Primary Endpoint**: `/quotes?symbols={SYMBOLS}`

## Quick Start

Fetch stock quotes for one or more symbols (responses are in TOON format):

```bash
curl "https://stock-prices.on99.app/quotes?symbols=NVDA"
curl "https://stock-prices.on99.app/quotes?symbols=AAPL,GOOGL,MSFT"
```

Install the TOON decoder for parsing: `pnpm add @toon-format/toon`

## Response Format

The API returns **TOON** (Token-Oriented Object Notation) format—a compact, human-readable encoding that uses ~40% fewer tokens than JSON. This makes it ideal for LLM prompts and streaming.

### TOON Response Example

```
quotes[1]{symbol,currentPrice,change,percentChange,highPrice,lowPrice,openPrice,previousClosePrice,preMarketPrice,preMarketChange,preMarketTime,preMarketChangePercent,...}:
  NVDA,188.54,-1.5,-0.789308,192.48,188.12,191.405,190.04,191.8799,3.3399048,2026-02-11T13:49:16.000Z,1.771457,...
```

### Decoding TOON Responses

Use `@toon-format/toon` to parse responses back to JavaScript/JSON:

```typescript
import { decode } from "@toon-format/toon";

const response = await fetch("https://stock-prices.on99.app/quotes?symbols=NVDA");
const toonText = await response.text();
const data = decode(toonText);

// data.quotes is an array of quote objects
const quote = data.quotes[0];
console.log(`${quote.symbol}: $${quote.currentPrice}`);
```

The decoded structure matches JSON—same objects, arrays, and primitives.

## Available Data Fields

| Field                    | Type              | Description                           |
| ------------------------ | ----------------- | ------------------------------------- |
| `symbol`                 | string            | Stock ticker symbol                   |
| `currentPrice`           | number            | Current trading price                 |
| `change`                 | number            | Price change from previous close      |
| `percentChange`          | number            | Percentage change from previous close |
| `highPrice`              | number            | Day's high price                      |
| `lowPrice`               | number            | Day's low price                       |
| `openPrice`              | number            | Opening price                         |
| `previousClosePrice`     | number            | Previous day's closing price          |
| `preMarketPrice`         | number            | Pre-market trading price              |
| `preMarketChange`        | number            | Pre-market price change               |
| `preMarketTime`          | string (ISO 8601) | Pre-market data timestamp             |
| `preMarketChangePercent` | number            | Pre-market percentage change          |

## Usage Guidelines

### Multiple Symbols

Query multiple stocks by separating symbols with commas (max 50):

```bash
curl "https://stock-prices.on99.app/quotes?symbols=AAPL,GOOGL,MSFT,TSLA,AMZN"
```

### Error Handling

Always check for valid responses. Decode TOON before accessing data:

```typescript
import { decode } from "@toon-format/toon";

const response = await fetch("https://stock-prices.on99.app/quotes?symbols=NVDA");
const data = decode(await response.text());

if (data.quotes && data.quotes.length > 0) {
    const quote = data.quotes[0];
    console.log(`${quote.symbol}: $${quote.currentPrice}`);
}
```

### Price Analysis

Calculate common metrics:

```typescript
// Determine if stock is up or down
const isUp = quote.change > 0;
const direction = isUp ? "📈" : "📉";

// Calculate day's range percentage
const rangePct = ((quote.highPrice - quote.lowPrice) / quote.lowPrice) * 100;

// Compare current to open
const vsOpen = quote.currentPrice - quote.openPrice;
```

## Common Use Cases

### 1. Price Monitoring

```typescript
import { decode } from "@toon-format/toon";

async function checkPrice(symbol: string) {
    const res = await fetch(`https://stock-prices.on99.app/quotes?symbols=${symbol}`);
    const data = decode(await res.text());
    const quote = data.quotes[0];

    return {
        price: quote.currentPrice,
        change: quote.change,
        changePercent: quote.percentChange,
    };
}
```

### 2. Portfolio Tracking

```typescript
import { decode } from "@toon-format/toon";

async function getPortfolio(symbols: string[]) {
    const symbolString = symbols.join(",");
    const res = await fetch(`https://stock-prices.on99.app/quotes?symbols=${symbolString}`);
    const data = decode(await res.text());

    return data.quotes.map(q => ({
        symbol: q.symbol,
        value: q.currentPrice,
        dailyChange: q.percentChange,
    }));
}
```

### 3. Market Summary

```typescript
import { decode } from "@toon-format/toon";

async function marketSummary(symbols: string[]) {
    const res = await fetch(`https://stock-prices.on99.app/quotes?symbols=${symbols.join(",")}`);
    const data = decode(await res.text());

    const gainers = data.quotes.filter(q => q.change > 0);
    const losers = data.quotes.filter(q => q.change < 0);

    return {
        totalStocks: data.quotes.length,
        gainers: gainers.length,
        losers: losers.length,
        avgChange: data.quotes.reduce((sum, q) => sum + q.percentChange, 0) / data.quotes.length,
    };
}
```

## Popular Stock Symbols

### Tech Giants (FAANG+)

- `AAPL` - Apple
- `GOOGL` - Alphabet (Google)
- `META` - Meta (Facebook)
- `AMZN` - Amazon
- `NFLX` - Netflix
- `MSFT` - Microsoft

### High-Profile Stocks

- `NVDA` - NVIDIA
- `TSLA` - Tesla
- `AMD` - Advanced Micro Devices
- `INTC` - Intel
- `ORCL` - Oracle

### Indices

- `^GSPC` - S&P 500
- `^DJI` - Dow Jones
- `^IXIC` - NASDAQ

## Notes

- **Response format**: API returns TOON, not JSON. Use `decode()` from `@toon-format/toon` to parse.
- All prices are in USD
- Data updates in real-time during market hours
- Pre-market and after-hours data is available
- Timestamps are in ISO 8601 format (UTC)
- Maximum 50 symbols per request