Skip to main content
POST
/
v1
/
followings
/
topics
Create Topic
curl --request POST \
  --url https://api.reportify.cn/v1/followings/topics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "meta_data": {}
}
'
import requests

url = "https://api.reportify.cn/v1/followings/topics"

payload = {
"query": "<string>",
"meta_data": {}
}
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: '<string>', meta_data: {}})
};

fetch('https://api.reportify.cn/v1/followings/topics', 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/followings/topics",
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' => '<string>',
'meta_data' => [

]
]),
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/followings/topics"

payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"meta_data\": {}\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/followings/topics")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"meta_data\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.reportify.cn/v1/followings/topics")

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\": \"<string>\",\n \"meta_data\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "follow_id": "<string>",
  "follow_type": 123,
  "follow_sub_type": 123,
  "follow_value": "<string>",
  "name": "<string>",
  "logo": "<string>",
  "title": "<string>",
  "followed_at": 123
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

说明

URL: /v1/followings/topics 方法: POST
描述: 创建话题,为当前用户新增一个话题关注,返回创建后的关注项。

请求参数

参数名类型必填描述
querystr话题查询文本。
meta_dataobject可选的话题范围限定信息。

响应参数

参数名类型描述
follow_idstr关注 ID。
follow_typeint关注类型:1 公司,2 话题,3 渠道。
follow_sub_typeint关注子类型:1 机构,2 媒体,3 社交。
follow_valuestr关注对象的取值。
namestr名称。
logostr图标 URL。
titlestr标题。
followed_atint关注时间戳(毫秒)。

请求示例

cURL
curl -X POST https://api.reportify.cn/v1/followings/topics \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
    "query": "AI 芯片行业趋势"
}'
Python
import requests

url = "https://api.reportify.cn/v1/followings/topics"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

data = {
    "query": "AI 芯片行业趋势",
    # 可选:限定话题范围
    # "meta_data": {"symbols": ["00700", "AAPL"]}
}

response = requests.post(url, headers=headers, json=data)
print(response.json())

响应示例

{
  "follow_id": "2002",
  "follow_type": 2,
  "follow_sub_type": 0,
  "follow_value": "AI 芯片行业趋势",
  "name": "AI 芯片行业趋势",
  "logo": "",
  "title": "AI 芯片行业趋势",
  "followed_at": 1720000100000
}

错误响应

状态码描述
422请求参数验证失败。

Authorizations

Authorization
string
header
required

Enter your Bearer token

Body

application/json

Request model for creating a topic following

query
string
required

Topic query text

meta_data
Meta Data · object

Optional topic scope

Response

Successful Response

A unified following item (company/topic/channel)

follow_id
string
required
follow_type
integer
required

1 company, 2 topic, 3 channel

follow_sub_type
integer

1 institution, 2 media, 3 social

follow_value
string
name
string
title
string
followed_at
integer