List datasource categories
curl --request GET \
--url https://api.valyu.ai/v1/datasources/categories \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.valyu.ai/v1/datasources/categories"
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.valyu.ai/v1/datasources/categories', 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.valyu.ai/v1/datasources/categories",
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.valyu.ai/v1/datasources/categories"
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.valyu.ai/v1/datasources/categories")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/datasources/categories")
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{
"success": true,
"categories": [
{
"id": "research",
"name": "Research",
"description": "Academic papers, preprints, and scholarly articles.",
"dataset_count": 8
},
{
"id": "healthcare",
"name": "Healthcare",
"description": "Medical literature, clinical trials, drug data, and health records.",
"dataset_count": 6
},
{
"id": "markets",
"name": "Markets",
"description": "Stock prices, earnings, SEC filings, and financial data.",
"dataset_count": 5
}
]
}List Categories
Returns all datasource categories with dataset counts
GET
/
v1
/
datasources
/
categories
List datasource categories
curl --request GET \
--url https://api.valyu.ai/v1/datasources/categories \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.valyu.ai/v1/datasources/categories"
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.valyu.ai/v1/datasources/categories', 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.valyu.ai/v1/datasources/categories",
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.valyu.ai/v1/datasources/categories"
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.valyu.ai/v1/datasources/categories")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valyu.ai/v1/datasources/categories")
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{
"success": true,
"categories": [
{
"id": "research",
"name": "Research",
"description": "Academic papers, preprints, and scholarly articles.",
"dataset_count": 8
},
{
"id": "healthcare",
"name": "Healthcare",
"description": "Medical literature, clinical trials, drug data, and health records.",
"dataset_count": 6
},
{
"id": "markets",
"name": "Markets",
"description": "Stock prices, earnings, SEC filings, and financial data.",
"dataset_count": 5
}
]
}List source categories and their dataset counts to build category navigation or narrow a source-discovery interface. Category names describe the catalog; they are not a guarantee that every dataset in the category is available to your account.
Use List datasources to inspect individual sources.
Authorizations
API key for authentication. Get yours at platform.valyu.ai.
Was this page helpful?