symbol-search
Instrument Symbol Search
Supports searching for contract symbols of global financial instruments like stocks, futures, forex, and cryptocurrencies by name, Pinyin initials, or category, returning a list of matching instruments.
Usage Cost
5 coins/call
Quick Start
Use a unified response envelope and call directly from your backend.
https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-symbolscURL Example
curl --request GET \
--url 'https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-symbols' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: YOUR_API_KEY' \
--data '{\n "pidx": "页码,每页最多50",\n "rout": "分类rout和keywords两参数中至少输入其中一个,参考(CNST,USST,HKST,GBFSB,GBCFD,GBFT,CNFT,GBDC,GBIDX,C...",\n "keywords": "模糊关键字,拼音首字母/代码等(rout和keywords两参数中必须至少输入其中一个)",\n "futmain": "是否筛选主力合约(1是0否),针对期货分类有效"\n}'Python Example
import os
import requests
url = "https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-symbols"
payload = {
"pidx": "页码,每页最多50",
"rout": "分类rout和keywords两参数中至少输入其中一个,参考(CNST,USST,HKST,GBFSB,GBCFD,GBFT,CNFT,GBDC,GBIDX,C...",
"keywords": "模糊关键字,拼音首字母/代码等(rout和keywords两参数中必须至少输入其中一个)",
"futmain": "是否筛选主力合约(1是0否),针对期货分类有效"
}
headers = {
"Content-Type": "application/json",
"X-API-Key": os.getenv("TOOLKK_API_KEY", "YOUR_API_KEY"),
}
response = requests.get(url, headers=headers, params=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/aliyunmarket-cmapi029045-query-symbols"
payload := []byte("{\n \"pidx\": \"页码,每页最多50\",\n \"rout\": \"分类rout和keywords两参数中至少输入其中一个,参考(CNST,USST,HKST,GBFSB,GBCFD,GBFT,CNFT,GBDC,GBIDX,C...\",\n \"keywords\": \"模糊关键字,拼音首字母/代码等(rout和keywords两参数中必须至少输入其中一个)\",\n \"futmain\": \"是否筛选主力合约(1是0否),针对期货分类有效\"\n}")
req, err := http.NewRequest("GET", 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 \"pidx\": \"页码,每页最多50\",\n \"rout\": \"分类rout和keywords两参数中至少输入其中一个,参考(CNST,USST,HKST,GBFSB,GBCFD,GBFT,CNFT,GBDC,GBIDX,C...\",\n \"keywords\": \"模糊关键字,拼音首字母/代码等(rout和keywords两参数中必须至少输入其中一个)\",\n \"futmain\": \"是否筛选主力合约(1是0否),针对期货分类有效\"\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://openapi.toolkk.com/v1/aliyunmarket-cmapi029045-query-symbols"))
.method("GET", 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/aliyunmarket-cmapi029045-query-symbols';
$payload = "{\n \"pidx\": \"页码,每页最多50\",\n \"rout\": \"分类rout和keywords两参数中至少输入其中一个,参考(CNST,USST,HKST,GBFSB,GBCFD,GBFT,CNFT,GBDC,GBIDX,C...\",\n \"keywords\": \"模糊关键字,拼音首字母/代码等(rout和keywords两参数中必须至少输入其中一个)\",\n \"futmain\": \"是否筛选主力合约(1是0否),针对期货分类有效\"\n}";
$ch = curl_init($endpoint);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
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
{}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 |
|---|---|---|---|---|
| pidx | int | Yes | 页码,每页最多50 | Unspecified |
| rout | string | No | 分类rout和keywords两参数中至少输入其中一个,参考(CNST,USST,HKST,GBFSB,GBCFD,GBFT,CNFT,GBDC,GBIDX,CNCFD,CNFOP,CMDTY,TB,JPST,INST,TWST,CNZZ,CNFD...) 美股,港股,外汇,商品股指CFD,国际期货,期货,数字货币,全球股指,黄金市场,期货期权,商品贵金属,政府债券,日股,印股,台股,基金... | Unspecified |
| keywords | string | No | 模糊关键字,拼音首字母/代码等(rout和keywords两参数中必须至少输入其中一个) | Unspecified |
| futmain | int | No | 是否筛选主力合约(1是0否),针对期货分类有效 | Unspecified |
Request Example
{
"pidx": "页码,每页最多50",
"rout": "分类rout和keywords两参数中至少输入其中一个,参考(CNST,USST,HKST,GBFSB,GBCFD,GBFT,CNFT,GBDC,GBIDX,C...",
"keywords": "模糊关键字,拼音首字母/代码等(rout和keywords两参数中必须至少输入其中一个)",
"futmain": "是否筛选主力合约(1是0否),针对期货分类有效"
}- 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.
No field definitions yet. Refer to the JSON examples and documentation.
Response Example
{}API overview
Capabilities, use cases, limitations, and frequently asked questions.
API Capabilities
This API provides an instrument symbol search service for global financial markets. It supports retrieving corresponding contract symbols via fuzzy keywords (e.g., name, Pinyin initials, code snippets) or specified categories (e.g., US stocks, HK stocks, forex, futures, digital currencies, etc.). For the futures category, it also supports filtering for main contracts.
Request and Response
- Request Parameters: Requires
pidx(page number, max 50 items per page). At least one ofrout(category, e.g., USST, HKST, CMDTY, etc.) andkeywords(fuzzy keyword) must be provided. For futures,futmaincan be passed to filter for main contracts. - Response Result: Returns a list of instruments matching the search criteria, including basic information such as contract symbol, name, and category, facilitating subsequent market data retrieval or chart display for developers.
Use Cases
- Financial Terminal Development: Provide instrument search and watchlist addition features in stock, futures, or forex trading software.
- Quantitative Analysis Platforms: Help users quickly find corresponding standardized contract symbols by name for data backtesting.