List news topics
curl --request GET \
--url https://api.andiai.com/api/v1/news \
--header 'x-api-key: <api-key>'import requests
url = "https://api.andiai.com/api/v1/news"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.andiai.com/api/v1/news', 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.andiai.com/api/v1/news",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://api.andiai.com/api/v1/news"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.andiai.com/api/v1/news")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.andiai.com/api/v1/news")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"topics": [
{
"slug": "<string>",
"title": "<string>",
"category": "news",
"formats": [
"<string>"
],
"detail": [
"full"
],
"count_48h": 123
}
],
"hours": 123,
"count": 123
}{
"error": "Unauthorized",
"message": "Invalid API key"
}{
"error": "Insufficient Credits",
"message": "Your account has insufficient credits. Please add credits to continue."
}{
"error": "Too Many Requests",
"message": "Rate limit of N requests per second exceeded"
}API Reference
List news topics
Lists every topic available at GET /api/v1/news/{topic} with its title, category, supported formats, whether a detailed brief is available and its recent story count. Requires an API key; not billed. A feed key can be sent in the key query parameter. Add format=html for a page of ready links.
GET
/
api
/
v1
/
news
List news topics
curl --request GET \
--url https://api.andiai.com/api/v1/news \
--header 'x-api-key: <api-key>'import requests
url = "https://api.andiai.com/api/v1/news"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.andiai.com/api/v1/news', 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.andiai.com/api/v1/news",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://api.andiai.com/api/v1/news"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.andiai.com/api/v1/news")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.andiai.com/api/v1/news")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"topics": [
{
"slug": "<string>",
"title": "<string>",
"category": "news",
"formats": [
"<string>"
],
"detail": [
"full"
],
"count_48h": 123
}
],
"hours": 123,
"count": 123
}{
"error": "Unauthorized",
"message": "Invalid API key"
}{
"error": "Insufficient Credits",
"message": "Your account has insufficient credits. Please add credits to continue."
}{
"error": "Too Many Requests",
"message": "Rate limit of N requests per second exceeded"
}Authorizations
API key from the API Console.
Query Parameters
A feed key, for links that cannot send a header. Only feed keys are accepted here; a full API key in a URL returns 403.
json (default) returns the topics list. html returns the same list as a page of ready links; a feed key is added to every link. Any other value returns the JSON list.
Available options:
json, html 
