获取新闻动态分页
curl --request GET \
--url https://open.ainvest.com/open/news/page \
--header 'Authorization: Bearer <token>' \
--header 'Cookie: <cookie>'import requests
url = "https://open.ainvest.com/open/news/page"
headers = {
"Cookie": "<cookie>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Cookie: '<cookie>', Authorization: 'Bearer <token>'}};
fetch('https://open.ainvest.com/open/news/page', 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://open.ainvest.com/open/news/page",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Cookie: <cookie>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.ainvest.com/open/news/page"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Cookie", "<cookie>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://open.ainvest.com/open/news/page")
.header("Cookie", "<cookie>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open.ainvest.com/open/news/page")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Cookie"] = '<cookie>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"page": 123,
"size": 123,
"data": [
{
"news_id": "<string>",
"content_id": "<string>",
"news_type": "<string>",
"news_from": "<string>",
"news_format": "<string>",
"news_important": 123,
"publish_time": 123,
"title": "<string>",
"summary": "<string>",
"content": "<string>",
"source": "<string>",
"seo_key": "<string>",
"cover_image": {
"src": "<string>",
"type": "<string>"
},
"source_url": "<string>",
"tag_list": [
{
"code": "<string>",
"market": "<string>",
"name_en": "<string>",
"type": 123
}
],
"lang": "<string>",
"read_time": "<string>"
}
]
},
"status_code": 123,
"status_msg": "<string>"
}{
"status_code": 123,
"status_msg": "<string>"
}1.1 快讯
快讯列表页
可以通过该接口,以分页方式获取最近快讯列表。
GET
/
news
/
page
获取新闻动态分页
curl --request GET \
--url https://open.ainvest.com/open/news/page \
--header 'Authorization: Bearer <token>' \
--header 'Cookie: <cookie>'import requests
url = "https://open.ainvest.com/open/news/page"
headers = {
"Cookie": "<cookie>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Cookie: '<cookie>', Authorization: 'Bearer <token>'}};
fetch('https://open.ainvest.com/open/news/page', 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://open.ainvest.com/open/news/page",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Cookie: <cookie>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://open.ainvest.com/open/news/page"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Cookie", "<cookie>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://open.ainvest.com/open/news/page")
.header("Cookie", "<cookie>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://open.ainvest.com/open/news/page")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Cookie"] = '<cookie>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"page": 123,
"size": 123,
"data": [
{
"news_id": "<string>",
"content_id": "<string>",
"news_type": "<string>",
"news_from": "<string>",
"news_format": "<string>",
"news_important": 123,
"publish_time": 123,
"title": "<string>",
"summary": "<string>",
"content": "<string>",
"source": "<string>",
"seo_key": "<string>",
"cover_image": {
"src": "<string>",
"type": "<string>"
},
"source_url": "<string>",
"tag_list": [
{
"code": "<string>",
"market": "<string>",
"name_en": "<string>",
"type": 123
}
],
"lang": "<string>",
"read_time": "<string>"
}
]
},
"status_code": 123,
"status_msg": "<string>"
}{
"status_code": 123,
"status_msg": "<string>"
}当前免费用户调用5次接口后就会报错,显示免费额度用尽


授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求头
cookie值
查询参数
有pro(付费内容)、latest(全量内容)、markets、stock_ideas、economy、pre_market、earningscall可选
开始id
大小
⌘I