Get latest articles
curl --request GET \
--url https://openapi.ainvest.com/open/news/v1/article/page/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.ainvest.com/open/news/v1/article/page/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openapi.ainvest.com/open/news/v1/article/page/history', 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://openapi.ainvest.com/open/news/v1/article/page/history",
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>"
],
]);
$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://openapi.ainvest.com/open/news/v1/article/page/history"
req, _ := http.NewRequest("GET", url, nil)
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://openapi.ainvest.com/open/news/v1/article/page/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.ainvest.com/open/news/v1/article/page/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"start_id": "<string>",
"size": 123,
"data": [
{
"news_id": "<string>",
"content_id": "<string>",
"publish_time": 123,
"title": "<string>",
"seo_key": "<string>",
"cover_image": "<string>",
"author": {
"account_id": "<string>",
"nickname": "<string>",
"portrait": "<string>"
},
"tag_list": [
{
"code": "<string>",
"market": "<string>",
"name_en": "<string>"
}
],
"language": "<string>"
}
]
},
"status_code": 123,
"status_msg": "<string>"
}News
Articles
Returns latest articles ordered by time latest first, supports pagination and filtering options.
GET
/
news
/
v1
/
article
/
page
/
history
Get latest articles
curl --request GET \
--url https://openapi.ainvest.com/open/news/v1/article/page/history \
--header 'Authorization: Bearer <token>'import requests
url = "https://openapi.ainvest.com/open/news/v1/article/page/history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://openapi.ainvest.com/open/news/v1/article/page/history', 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://openapi.ainvest.com/open/news/v1/article/page/history",
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>"
],
]);
$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://openapi.ainvest.com/open/news/v1/article/page/history"
req, _ := http.NewRequest("GET", url, nil)
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://openapi.ainvest.com/open/news/v1/article/page/history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.ainvest.com/open/news/v1/article/page/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"start_id": "<string>",
"size": 123,
"data": [
{
"news_id": "<string>",
"content_id": "<string>",
"publish_time": 123,
"title": "<string>",
"seo_key": "<string>",
"cover_image": "<string>",
"author": {
"account_id": "<string>",
"nickname": "<string>",
"portrait": "<string>"
},
"tag_list": [
{
"code": "<string>",
"market": "<string>",
"name_en": "<string>"
}
],
"language": "<string>"
}
]
},
"status_code": 123,
"status_msg": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your key. Get the key here
Query Parameters
Used for paging. If specified, return the latest items earlier than this id. If not specified, return the latest items from now.
Example:
"US_ARTICLEd7c3a136cc8822f4"
Number of items to return. Default is 10, maximum is 50.
Required range:
1 <= x <= 50⌘I