Usage Cost
5 coins/call
Quick Start
Use a unified response envelope and call directly from your backend.
https://openapi.toolkk.com/v1/finance-us-shares-pricecURL Example
curl --request POST \
--url 'https://openapi.toolkk.com/v1/finance-us-shares-price' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "symbol": "品种代码,以英文逗号分割,如:INTC,AAPL"\n}'Python Example
import os
import requests
url = "https://openapi.toolkk.com/v1/finance-us-shares-price"
payload = {
"symbol": "品种代码,以英文逗号分割,如:INTC,AAPL"
}
headers = {
"Content-Type": "application/json",
"X-API-Key": os.getenv("TOOLKK_API_KEY", "YOUR_API_KEY"),
}
response = requests.request("POST", url, headers=headers, json=payload, timeout=30)
response.raise_for_status()
print(response.json())Go Example
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
endpoint := "https://openapi.toolkk.com/v1/finance-us-shares-price"
payload := []byte("{\n \"symbol\": \"品种代码,以英文逗号分割,如:INTC,AAPL\"\n}")
req, err := http.NewRequest("POST", endpoint, bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}Java Example
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class ToolkkExample {
public static void main(String[] args) throws Exception {
String payload = "{\n \"symbol\": \"品种代码,以英文逗号分割,如:INTC,AAPL\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/finance-us-shares-price"))
.method("POST", HttpRequest.BodyPublishers.ofString(payload))
.header("Content-Type", "application/json")
.header("X-API-Key", "YOUR_API_KEY")
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP Example
<?php
$endpoint = 'https://openapi.toolkk.com/v1/finance-us-shares-price';
$payload = "{\n \"symbol\": \"品种代码,以英文逗号分割,如:INTC,AAPL\"\n}";
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-Key: YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
curl_close($ch);
echo $response;Response Example
{
"msg": "成功",
"code": 200,
"taskNo": "200966658220607506216602",
"data": {
"AAPL": {
"after_price": "221.0800",
"volume_avg10": "86695457",
"market_value": "3397265867100",
"trade_time": "2024-07-04 01:00:00",
"change": "1.2800",
"eps": "6.46",
"after_volume": "1132411",
"volume": "37369801",
"shares": "15334082000",
"after_change": "-0.47",
"high": "221.5500",
"update_time": "2024-07-04 09:45:24",
"low": "219.0300",
"pe": "34.300000",
"price": "221.5500",
"name": "苹果",
"dividend": "0.25",
"52week_low": "163.8300",
"after_changeRate": "-0.21",
"changeRate": "0.58",
"preclose": "220.2700",
"open": "220.0000",
"52week_high": "221.5500",
"after_time": "2024-07-04 05:00:00"
}
}
}Examples illustrate the response structure. Actual results depend on the API response.
- Authentication
- Send X-API-Key in request headers
- Rate limit
- 60 req/min
- Timeout
- 5000 ms
Send your API Key in the X-API-Key header from your backend.
Check both HTTP status and business fields before treating a call as successful.
Use retries and backoff together with rate limits in high-frequency scenarios.
Request Fields
Send requests from your server with the key in the X-API-Key header.
Request Fields
Fields are read from the API schema. Missing descriptions and examples are marked as unspecified.
| Path | Type | Required | Description | Sample |
|---|---|---|---|---|
| symbol | string | Yes | 品种代码,以英文逗号分割,如:INTC,AAPL | Unspecified |
Request Example
{
"symbol": "品种代码,以英文逗号分割,如:INTC,AAPL"
}- Authentication
- Send X-API-Key in request headers
- Rate limit
- 60 req/min
- Timeout
- 5000 ms
Response Fields
Examples illustrate the response structure. Actual results depend on the API response.
Response Fields
Fields are read from the API schema. Missing descriptions and examples are marked as unspecified.
| Path | Type | Required | Description | Sample |
|---|---|---|---|---|
| msg | string | No | 返回码对应描述 | 成功 |
| code | number | No | 返回码,详见返回码说明 | 200 |
| taskNo | string | No | 本次请求号 | 200966658220607506216602 |
| data | object | No | Unspecified | Unspecified |
| data.AAPL | object | No | Unspecified | Unspecified |
| data.AAPL.after_price | string | No | 盘后价格 | 221.0800 |
| data.AAPL.volume_avg10 | string | No | 10日平均成交量 | 86695457 |
| data.AAPL.market_value | string | No | 总市值 | 3397265867100 |
| data.AAPL.trade_time | string | No | 交易时间 | 2024-07-04 01:00:00 |
| data.AAPL.change | string | No | 涨跌额 | 1.2800 |
| data.AAPL.eps | string | No | 每股收益 | 6.46 |
| data.AAPL.after_volume | string | No | 盘后成交量 | 1132411 |
| data.AAPL.volume | string | No | 成交量 | 37369801 |
| data.AAPL.shares |
API overview
Capabilities, use cases, limitations, and frequently asked questions.
API Introduction
This API provides real-time quote data query service for the US stock market. By passing a stock trading symbol, you can obtain multi-dimensional financial information including real-time price, open price, high/low prices, trading volume, Price-to-Earnings ratio (PE), Earnings Per Share (EPS), total market capitalization, and after-hours trading data. The data covers mainstream US stock symbols and is suitable for business systems requiring integration of US stock market quotes.
Use Cases
- Financial News Applications: Display real-time trends and key financial indicators for individual US stocks in apps or on websites.
- Quantitative Trading Assistance: Provide fundamental price, trading volume, and historical high/low data references for strategy models.
- Portfolio Management: Monitor current market value, change amount, and 52-week price range of held stocks.
- Market Data Analysis: Analyze individual stock liquidity (trading volume) and valuation levels (PE ratio, dividend yield).
Request and Response Description
Request Method: POST Request Parameters:
symbol(Required): Stock symbol, supports single or multiple codes, separated by English commas (e.g., ).