Company Search
curl --request POST \
--url https://api.reportify.cn/v1/stock/company-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "腾讯",
"top_k": 10,
"strict": true
}
'import requests
url = "https://api.reportify.cn/v1/stock/company-search"
payload = {
"query": "腾讯",
"top_k": 10,
"strict": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '腾讯', top_k: 10, strict: true})
};
fetch('https://api.reportify.cn/v1/stock/company-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reportify.cn/v1/stock/company-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '腾讯',
'top_k' => 10,
'strict' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reportify.cn/v1/stock/company-search"
payload := strings.NewReader("{\n \"query\": \"腾讯\",\n \"top_k\": 10,\n \"strict\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reportify.cn/v1/stock/company-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"腾讯\",\n \"top_k\": 10,\n \"strict\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/stock/company-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"腾讯\",\n \"top_k\": 10,\n \"strict\": true\n}"
response = http.request(request)
puts response.read_body{
"companies": [
{
"id": 123,
"symbol": "<string>",
"market": "<string>",
"region": "<string>",
"ticker": "<string>",
"name": "<string>",
"full_name": "<string>",
"chinese_name": "<string>",
"chinese_full_name": "<string>",
"english_name": "<string>",
"english_full_name": "<string>",
"synonyms": "<string>",
"logo": "<string>",
"rank": 123,
"following": true,
"status": 123
}
],
"words": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}公司信息
Company Search
Search listed companies by name, ticker or keyword (Chinese/English) and return matching company profiles
POST
/
v1
/
stock
/
company-search
Company Search
curl --request POST \
--url https://api.reportify.cn/v1/stock/company-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "腾讯",
"top_k": 10,
"strict": true
}
'import requests
url = "https://api.reportify.cn/v1/stock/company-search"
payload = {
"query": "腾讯",
"top_k": 10,
"strict": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({query: '腾讯', top_k: 10, strict: true})
};
fetch('https://api.reportify.cn/v1/stock/company-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.reportify.cn/v1/stock/company-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => '腾讯',
'top_k' => 10,
'strict' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.reportify.cn/v1/stock/company-search"
payload := strings.NewReader("{\n \"query\": \"腾讯\",\n \"top_k\": 10,\n \"strict\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.reportify.cn/v1/stock/company-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"腾讯\",\n \"top_k\": 10,\n \"strict\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.reportify.cn/v1/stock/company-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"腾讯\",\n \"top_k\": 10,\n \"strict\": true\n}"
response = http.request(request)
puts response.read_body{
"companies": [
{
"id": 123,
"symbol": "<string>",
"market": "<string>",
"region": "<string>",
"ticker": "<string>",
"name": "<string>",
"full_name": "<string>",
"chinese_name": "<string>",
"chinese_full_name": "<string>",
"english_name": "<string>",
"english_full_name": "<string>",
"synonyms": "<string>",
"logo": "<string>",
"rank": 123,
"following": true,
"status": 123
}
],
"words": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}公司搜索
URL:/v1/stock/company-search
方法: POST描述: 通过公司名称、股票代码或关键词(支持中英文)搜索上市公司,返回最匹配的公司信息列表。
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| query | str | 是 | 搜索关键词:公司名称 / 简称 / 股票代码 / 自由文本,如 腾讯、AAPL |
| top_k | int | 否 | 返回的最大公司数量,默认 10 |
| strict | bool | 否 | 是否启用严格关键词匹配,默认 true |
响应参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| companies | array | 匹配到的公司列表,按相关度排序。 |
| id | int | 公司 ID。 |
| symbol | str | 完整股票标识,如 HK:00700。 |
| market | str | 市场代码,如 HK / US / SH / SZ。 |
| region | str | 地区代码。 |
| ticker | str | 股票代码,如 00700 / AAPL。 |
| name | str | 公司显示名称。 |
| full_name | str | 公司全称。 |
| chinese_name | str | 中文名称。 |
| chinese_full_name | str | 中文全称。 |
| english_name | str | 英文名称。 |
| english_full_name | str | 英文全称。 |
| synonyms | str | 别名/同义词(逗号分隔)。 |
| logo | str | 公司 Logo 地址。 |
| rank | int | 相关度排序值(越小越靠前)。 |
| words | array | 从查询中抽取的关键词(严格匹配时返回)。 |
请求示例
cURLcurl -X POST https://api.reportify.cn/v1/stock/company-search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "腾讯",
"top_k": 3
}'
import requests
url = "https://api.reportify.cn/v1/stock/company-search"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
# 支持中文名称、英文名称或股票代码
data = {"query": "腾讯", "top_k": 3}
response = requests.post(url, headers=headers, json=data)
print(response.json())
响应示例
{
"companies": [
{
"id": 1407,
"symbol": "HK:00700",
"market": "HK",
"region": "HK",
"ticker": "00700",
"name": "腾讯控股",
"full_name": "腾讯控股有限公司",
"chinese_name": "腾讯控股",
"chinese_full_name": "腾讯控股有限公司",
"english_name": "TENCENT",
"english_full_name": "Tencent Holdings Limited",
"synonyms": "腾讯,腾讯控股",
"logo": "https://files.reportify.cn/logos_all/700.HK.svg",
"rank": 1
}
],
"words": []
}
query 为空时返回空列表 {"companies": [], "words": []}。错误响应
| 状态码 | 描述 |
|---|---|
| 403 | 未认证(缺少或无效的 API Key)。 |
| 422 | 请求参数验证失败。 |
Authorizations
Enter your Bearer token
Body
application/json
⌘I
